diff --git a/src/pages/pd-question/pd-question-address/pd-question-address.html b/src/pages/pd-question/pd-question-address/pd-question-address.html index db653ca2..1dbdc1b1 100755 --- a/src/pages/pd-question/pd-question-address/pd-question-address.html +++ b/src/pages/pd-question/pd-question-address/pd-question-address.html @@ -355,6 +355,7 @@ + @@ -372,6 +373,7 @@ autocomplete="off"> +
- - + + + Select + + {{deslist.designation}} + + + Designation of Person Met Required + + + + + Specify Person Met Required +
@@ -163,6 +177,11 @@ YES NO + + + + +
@@ -177,21 +196,72 @@
-
+ +

Attendance register seen ?

- + YES NO -
+ + +
+
+
+
+ +
+ +
+ +
+
+
+
+ -
+ +

Salary register seen ?

- + YES NO -
+ + +
+
+
+
+ +
+ +
+ +
+
+
+
+ + + + + Select + Bank Transfer + Paid in Cash + Both Bank Transfer & Cash + + + @@ -234,7 +304,7 @@ -
+
@@ -244,7 +314,7 @@
-
+
@@ -321,6 +391,46 @@ YES NO +
+ + + Select + Yes + No + + ID Card issued by the Company seen ? Required + + + + + why company’s ID proof is not available Required + +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +

Office photographs

+
+ + + +
diff --git a/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.ts b/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.ts index 1cadf1f6..4c1bf60e 100755 --- a/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.ts +++ b/src/pages/pd-question/pd-question-emp-info/pd-question-emp-info.ts @@ -63,6 +63,9 @@ export class PdQuestionEmpInfoPage { pd_value_params:any; @ViewChild('childComp') child: PdGeneralImagesPage + split_customer_abbr: any; + designationdatalist: any []; + @ViewChild('docsSightedScroll') docsSightedScroll: ElementRef constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder, public qustCat:QuestionCategoryProvider,public aws: AwsServiceProvider, @@ -77,6 +80,11 @@ export class PdQuestionEmpInfoPage { this.pdid=this.pdDetails.pd_id; this.customer_segment_abbr = this.pdDetails.customer_segment_abbr; this.pd_cus_segment = this.pdDetails.customer_segment_abbr.toUpperCase(); + this.split_customer_abbr = this.customer_segment_abbr.split('-') + if(this.split_customer_abbr.length > 0){ + this.split_customer_abbr = this.split_customer_abbr[0]; + console.log(this.split_customer_abbr) + } this.generalExistBusinessYear=100; this.generalExistBusinessMonth=12; this.getDropDownList(); @@ -97,7 +105,9 @@ export class PdQuestionEmpInfoPage { was_met: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''], name_person_met: [''], designation_person_met: [''], + others_person_met:[], confirm_salary: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''], + sal_amount_was_not_confirmed: [''], confirm_salary_amount: [''], attendance_seen: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''], sal_reg_seen: [this.pd_cus_segment == 'SAL-CHQ' ? 'No' : ''], @@ -107,6 +117,7 @@ export class PdQuestionEmpInfoPage { net_monthly_salary: [''], amount_paid_in_cash: [''], amount_paid_through_bank: [''], + mode_of_getting_salary: [''], check_validated:[''], how_was_it_validated: [''], why_was_it_not_validated: [''], @@ -114,6 +125,8 @@ export class PdQuestionEmpInfoPage { bonus_frequency: [''], bonus_type: [''], bonus_type_other: [''], + id_card_issued_company:[''], + why_company_id_proof_not_available: [''], any_delays: [''], employment_remarks: [''], // nameOfEmp:[null], @@ -166,6 +179,17 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com } }); + this.qustCat.getcommondrop('DESIGNATION').subscribe( + data => { + if (data.status == 200) { + console.log('DESIGNATION',data); + this.designationdatalist = data.records; + this.designationdatalist = this.designationdatalist.filter(des => des.isactive == 1); + + } + + }); + this.qustCat.getcommondrop('COMPANYRELATIONSHIPS').subscribe( data => { if(data['dataStatus']==true){ @@ -256,6 +280,8 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com this.toast.pdTriggerappmessage('Form Invalid Try Again.!'); return; } + + let records: any = {}; @@ -273,21 +299,55 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com if (this.employmentForm.controls['was_met'].value == 'yes') { records.name_person_met = this.employmentForm.controls['name_person_met'].value; records.designation_person_met = this.employmentForm.controls['designation_person_met'].value; + if(records.designation_person_met == '1'){ + records.others_person_met = this.employmentForm.controls['others_person_met'].value; + } }else{ records.name_person_met = ''; records.designation_person_met = ''; + records.others_person_met = ''; } records.confirm_salary = this.employmentForm.controls['confirm_salary'].value; + if(records.confirm_salary == 'no'){ + records.sal_amount_was_not_confirmed = this.employmentForm.controls['sal_amount_was_not_confirmed'].value; + } records.confirm_salary_amount = this.employmentForm.controls['confirm_salary'].value == 'yes' ? this.employmentForm.controls['confirm_salary_amount'].value : ''; records.attendance_seen = this.employmentForm.controls['attendance_seen'].value; + if (this.employmentForm.controls['attendance_seen_pic'] && this.employmentForm.value.attendance_seen == 'yes') { + + if (this.employmentForm.controls['attendance_seen_pic'].invalid) { + this.toast.pdTriggerappmessage("Attendance seen pic is required"); + this.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"}) + return; + }else { + records.attendance_seen_pic = this.employmentForm.controls['attendance_seen_pic'].value; + } + } records.sal_reg_seen = this.employmentForm.controls['sal_reg_seen'].value; + if (this.employmentForm.controls['sal_reg_seen_pic'] && this.employmentForm.value.sal_reg_seen == 'yes') { + + if (this.employmentForm.controls['sal_reg_seen_pic'].invalid) { + this.toast.pdTriggerappmessage("Salary register seen pic is required"); + this.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"}) + return; + }else { + records.sal_reg_seen_pic = this.employmentForm.controls['sal_reg_seen_pic'].value; + } + } records.from_date_the_salary_is_rcv = this.employmentForm.controls['from_date_the_salary_is_rcv'].value; records.to_date_the_salary_is_rcv = this.employmentForm.controls['to_date_the_salary_is_rcv'].value; records.gross_monthly_salary = this.employmentForm.controls['gross_monthly_salary'].value; records.net_monthly_salary = this.employmentForm.controls['net_monthly_salary'].value; - records.amount_paid_in_cash = this.employmentForm.controls['amount_paid_in_cash'].value; - records.amount_paid_through_bank = this.employmentForm.controls['amount_paid_through_bank'].value; + records.mode_of_getting_salary = this.employmentForm.controls['mode_of_getting_salary'].value; + if(records.mode_of_getting_salary == 'paid_in_cash' || records.mode_of_getting_salary == 'both_bank_transfer_cash'){ + records.amount_paid_in_cash = this.employmentForm.controls['amount_paid_in_cash'].value; + } + if(records.mode_of_getting_salary == 'bank_transfer' || records.mode_of_getting_salary == 'both_bank_transfer_cash'){ + records.amount_paid_through_bank = this.employmentForm.controls['amount_paid_through_bank'].value; + } + + records.check_validated = this.employmentForm.controls['check_validated'].value; records.how_was_it_validated = this.employmentForm.controls['check_validated'].value == 'validated' ? this.employmentForm.controls['how_was_it_validated'].value : ''; records.why_was_it_not_validated = this.employmentForm.controls['check_validated'].value != 'validated' ? this.employmentForm.controls['why_was_it_not_validated'].value : ''; @@ -299,9 +359,29 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com records.bonus_type = this.employmentForm.controls['bonus_type'].value; records.bonus_type_other = this.employmentForm.controls['bonus_type_other'].value; + records.id_card_issued_company = this.employmentForm.controls['id_card_issued_company'].value; + if(records.id_card_issued_company == 'no'){ + records.why_company_id_proof_not_available = this.employmentForm.controls['why_company_id_proof_not_available'].value; + } + if (this.employmentForm.controls['id_card_image'] && this.employmentForm.value.id_card_issued_company == 'yes') { + + if (this.employmentForm.controls['id_card_image'].invalid) { + this.toast.pdTriggerappmessage("ID card issued pic is required"); + this.docsSightedScroll.nativeElement.scrollIntoView({behavior:"smooth",block:"start"}) + return; + }else { + records.id_card_image = this.employmentForm.controls['id_card_image'].value; + } + } + records.employment_remarks = this.employmentForm.controls['employment_remarks'].value; this.spinner_access=true; - this.qustCat.saveForm(records).subscribe(data => { + + records.hasOwnProperty('id_card_image') && records.id_card_image != '' ? records.id_card_image = 'SAVED' :'' + records.hasOwnProperty('attendance_seen_pic') && records.attendance_seen_pic != '' ? records.attendance_seen_pic = 'SAVED' :'' + records.hasOwnProperty('sal_reg_seen_pic') && records.sal_reg_seen_pic != '' ? records.sal_reg_seen_pic = 'SAVED' :'' + + this.qustCat.saveForm(records).subscribe(data => { if(data['dataStatus']== true){ @@ -475,8 +555,14 @@ inWords(val,flag:number){ } if (Emp.designation_person_met) { this.employmentForm.controls['designation_person_met'].setValue(Emp.designation_person_met); + if(Emp.designation_person_met == '1'){ + this.employmentForm.controls['others_person_met'].setValue(Emp.others_person_met); + } } this.employmentForm.controls['confirm_salary'].setValue(Emp.confirm_salary); + if(Emp.confirm_salary == 'no'){ + this.employmentForm.controls['sal_amount_was_not_confirmed'].setValue(Emp.sal_amount_was_not_confirmed); + } console.log('Emp.confirm_salary_amount',Emp.confirm_salary_amount,Emp.confirm_salary); if (Emp.confirm_salary) { this.employmentForm.controls['confirm_salary_amount'].setValue(Emp.confirm_salary_amount); @@ -484,13 +570,35 @@ inWords(val,flag:number){ } this.employmentForm.controls['attendance_seen'].setValue(Emp.attendance_seen); + if(Emp.attendance_seen == 'yes'){ + if (Emp.attendance_seen == 'yes') { + this.employmentForm.addControl('attendance_seen_pic', new FormControl('', Validators.compose([Validators.required]))); + } else { + this.employmentForm.removeControl('attendance_seen_pic'); + } + this.employmentForm.controls['attendance_seen_pic'].setValue(Emp.attendance_seen_pic); + } this.employmentForm.controls['sal_reg_seen'].setValue(Emp.sal_reg_seen); + if(Emp.sal_reg_seen == 'yes'){ + if (Emp.sal_reg_seen == 'yes') { + this.employmentForm.addControl('sal_reg_seen_pic', new FormControl('', Validators.compose([Validators.required]))); + } else { + this.employmentForm.removeControl('sal_reg_seen_pic'); + } + this.employmentForm.controls['sal_reg_seen_pic'].setValue(Emp.sal_reg_seen_pic); + } this.employmentForm.controls['from_date_the_salary_is_rcv'].setValue(Emp.from_date_the_salary_is_rcv); this.employmentForm.controls['to_date_the_salary_is_rcv'].setValue(Emp.to_date_the_salary_is_rcv); this.employmentForm.controls['gross_monthly_salary'].setValue(Emp.gross_monthly_salary); this.employmentForm.controls['net_monthly_salary'].setValue(Emp.net_monthly_salary); - this.employmentForm.controls['amount_paid_in_cash'].setValue(Emp.amount_paid_in_cash); - this.employmentForm.controls['amount_paid_through_bank'].setValue(Emp.amount_paid_through_bank); + this.employmentForm.controls['mode_of_getting_salary'].setValue(Emp.mode_of_getting_salary); + if(Emp.mode_of_getting_salary == 'paid_in_cash' || Emp.mode_of_getting_salary == 'both_bank_transfer_cash'){ + this.employmentForm.controls['amount_paid_in_cash'].setValue(Emp.amount_paid_in_cash); + } + if(Emp.mode_of_getting_salary == 'bank_transfer' || Emp.mode_of_getting_salary == 'both_bank_transfer_cash'){ + this.employmentForm.controls['amount_paid_through_bank'].setValue(Emp.amount_paid_through_bank); + } + this.employmentForm.controls['check_validated'].setValue(Emp.check_validated); this.employmentForm.controls['how_was_it_validated'].setValue(Emp.how_was_it_validated); this.employmentForm.controls['why_was_it_not_validated'].setValue(Emp.why_was_it_not_validated); @@ -498,6 +606,18 @@ inWords(val,flag:number){ this.employmentForm.controls['bonus_frequency'].setValue(Emp.bonus_frequency); this.employmentForm.controls['bonus_type'].setValue(Emp.bonus_type); this.employmentForm.controls['bonus_type_other'].setValue(Emp.bonus_type_other); + this.employmentForm.controls['id_card_issued_company'].setValue(Emp.id_card_issued_company); + if(Emp.id_card_issued_company == 'no'){ + this.employmentForm.controls['why_company_id_proof_not_available'].setValue(Emp.why_company_id_proof_not_available); + } + if(Emp.id_card_issued_company == 'yes'){ + if (Emp.id_card_issued_company == 'yes') { + this.employmentForm.addControl('id_card_image', new FormControl('', Validators.compose([Validators.required]))); + } else { + this.employmentForm.removeControl('id_card_image'); + } + this.employmentForm.controls['id_card_image'].setValue(Emp.id_card_image); + } this.employmentForm.controls['any_delays'].setValue(Emp.any_delays); this.employmentForm.controls['employment_remarks'].setValue(Emp.employment_remarks); @@ -612,5 +732,65 @@ inWords(val,flag:number){ }) } + + ImageUpload(Flag: any) { + let img_name + + this.cameraProvider.getpicture().then(res => { + if(res != 'error'){ + let geoCoordinates=localStorage.getItem('current_coordinates') + // this.cons.getGeoTag().then(geoCoordinates=>{ + this.cameraProvider.addWatermarks(res).then(watermarkedImage=>{ + + if (Flag == 1) { this.employmentForm.controls.id_card_image.setValue(res != 'error' ? watermarkedImage : ''); img_name="id_card_image"}//alert('Inside Mobile Upload Function' + Flag);} + if (Flag == 2) { this.employmentForm.controls.attendance_seen_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="attendance_seen_pic"}//alert('Inside Mobile Upload Function' + Flag);} + if (Flag == 3) { this.employmentForm.controls.sal_reg_seen_pic.setValue(res != 'error' ? watermarkedImage : ''); img_name="sal_reg_seen_pic"}//alert('Inside Mobile Upload Function' + Flag);} + + let bucket:any=[] + bucket.push({ 'image': watermarkedImage, 'Name': img_name, 'link': geoCoordinates }); + let records: any = { + 'pd_id': this.pdDetails.pd_id, + 'formid': this.FormId.form_id, + 'images': bucket, + 'company_id': '', + } + console.log("params savePDImage",JSON.stringify(records)) + this.qustCat.savePDImages(records).subscribe(result=>{ + if(result['dataStatus']){ + console.log("img saved successfully",this.pdDetails.pd_id,this.FormId.form_id,this.imageBucket,''); + } + }) + }) + // }) + } + }, error => { + console.log("Camera Error ", JSON.stringify(error)); + }) + } + + idcardChange(event, Flag) { + console.log(event) + + if (Flag == 1) { event.value == 'yes' ? this.employmentForm.addControl('id_card_image', new FormControl('', Validators.compose([Validators.required]))) : this.employmentForm.removeControl('id_card_image'); } + if (Flag == 2) { event.value == 'yes' ? this.employmentForm.addControl('attendance_seen_pic', new FormControl('', Validators.compose([Validators.required]))) : this.employmentForm.removeControl('attendance_seen_pic'); } + if (Flag == 3) { event.value == 'yes' ? this.employmentForm.addControl('sal_reg_seen_pic', new FormControl('', Validators.compose([Validators.required]))) : this.employmentForm.removeControl('sal_reg_seen_pic'); } + + } + savePhoto(flag){ + this.tab='1'; + // const modalOption:ModalOptions={ + // cssClass:'imageNameModal' + // } + // let records:any={form_id:'5',doc_name:''} + // const modalCtrl=this.modalCtrl.create(ImageNameModelPage,{'FormDet':records},modalOption) + // modalCtrl.present(); + + setTimeout(()=>{ + if(flag == 1){ + this.child.capture() + // this.imageDisplay.push({'image':this.base64,'Name':''}) + } + }) + } } diff --git a/src/pages/pd-question/pd-question-general-info/pd-question-general-info.html b/src/pages/pd-question/pd-question-general-info/pd-question-general-info.html index 42112f30..a96ef77e 100755 --- a/src/pages/pd-question/pd-question-general-info/pd-question-general-info.html +++ b/src/pages/pd-question/pd-question-general-info/pd-question-general-info.html @@ -268,9 +268,8 @@
- - - + + @@ -370,7 +369,10 @@
- + Entity type + Business Entity Type + Company/Firm Entity Type + Select {{business.business_entity_type_name}} @@ -384,8 +386,9 @@

- Number of Years in Current Profession - Number of Years For Which The Business Has Been Running

+ Number of Years in Current Profession + Number of Years For Which The Business Has Been Running + Number of Years For Which The Company/Firm Has Been Running

Year diff --git a/src/pages/pd-question/pd-question-general-info/pd-question-general-info.ts b/src/pages/pd-question/pd-question-general-info/pd-question-general-info.ts index a949f5f6..9b73a337 100755 --- a/src/pages/pd-question/pd-question-general-info/pd-question-general-info.ts +++ b/src/pages/pd-question/pd-question-general-info/pd-question-general-info.ts @@ -92,6 +92,8 @@ export class PdQuestionGeneralInfoPage { @ViewChild('individualPersonScroll') individualPersonScroll:ElementRef @ViewChild('companyScroll') companyScroll:ElementRef public KYC: any = [{value:"yes",isdisplayvalue:"Yes"},{value:"no",isdisplayvalue:"No"}]; + split_customer_abbr: any; + checksalaried: boolean = false; constructor(public navCtrl: NavController, public navParams: NavParams, public aws:AwsServiceProvider,public qustCat:QuestionCategoryProvider, @@ -109,6 +111,11 @@ export class PdQuestionGeneralInfoPage { //this.maxDate=new Date(get_max_date) this.FormId = this.navParams.get('FormId'); this.customer_segment_abbr = this.pdDetails.customer_segment_abbr; + this.split_customer_abbr = this.customer_segment_abbr.split('-') + if(this.split_customer_abbr.length > 0){ + this.split_customer_abbr = this.split_customer_abbr[0]; + console.log(this.split_customer_abbr) + } // console.log('this.customer_segment_abbr',this.customer_segment_abbr) this.users = localStorage.getItem('pd_user_details') this.users=JSON.parse(this.users).userid @@ -676,6 +683,9 @@ dataobj:any; // console.log(this.generalForm.controls['company_value']['controls'][this.updateIndex_comp]) } } + if(this.split_customer_abbr == 'SAL'){ + this.salariedcheck(); + } } @@ -734,7 +744,9 @@ dataobj:any; this.initCompanyValue(this.generalForm.value.companies,'ins') } } - + if(this.split_customer_abbr == 'SAL'){ + this.salariedcheck(); + } } saveApplicants(datas,purpose){ this.applicant_spinner_access=true @@ -1119,7 +1131,7 @@ console.log('1)',this.temp); // console.log('3)',this.temp); }); // console.log('4)',this.temp,'length',valuesData_indi.length); - if (this.temp == valuesData_indi.length) { + if (this.temp == valuesData_indi.length && this.split_customer_abbr != 'SAL') { // console.log('5)',this.temp); this.toast.pdTriggerappmessage('Please Choose Name of Person Met.!'); this.temp = 0; @@ -1329,6 +1341,9 @@ console.log('1)',this.temp); // if(this.data_all.company_with_relationships != ''){ // this.initCompanyRelationShip(this.data_all.company_with_relationships); // } + if(this.split_customer_abbr == 'SAL'){ + this.salariedcheck(); + } } else{ @@ -1585,5 +1600,25 @@ console.log('1)',this.temp); kycchange(event){ console.log(event); event =='no' ? this.generalForm.addControl('kyc_and_captur_the_name', new FormControl('')) : this.generalForm.removeControl('kyc_and_captur_the_name'); - } + } + + salariedcheck(){ + console.log('checkbox',this.generalForm) + // this._generalForm.value.list_value.forEach((valueChanges) => { + // console.log(valueChanges); + // if(valueChanges.is_applicant == false || valueChanges.is_person_met == false){ + // this.checksalaried = false; + // }else { + // this.checksalaried = true; + // } + + // console.log('check box status',this.checksalaried); + // }) + let control_value=this.generalForm.value.list_value + control_value=control_value.filter(val=>val.is_applicant == false || val.is_person_met == false) + console.log(control_value.length >0) + + this.checksalaried = control_value.length > 0 + + } } diff --git a/src/providers/question-category/question-category.ts b/src/providers/question-category/question-category.ts index 47211b42..a5a03350 100755 --- a/src/providers/question-category/question-category.ts +++ b/src/providers/question-category/question-category.ts @@ -148,11 +148,13 @@ stockFormAccess(pdid: any,companyid: any) { /*****Save Images */ savePDImages(imagesDetails) { + console.log('savepdimg',imagesDetails); let record = {'records':imagesDetails}; return this.http.post(this.apiurl+'savePDPhotos',record) .map(response=>{ - console.log(response); + console.log('img response',response); this.checkSavedPics(response['dataStatus'],imagesDetails) + console.log('check Img',this.checkSavedPics); return response; },err=>{ console.log("Error in savePDImages",err)