From b82fdfbb40f6c8be87b700a6ee91f464d3d668af Mon Sep 17 00:00:00 2001 From: gayathri1990 Date: Thu, 11 Mar 2021 00:10:31 +0530 Subject: [PATCH] latest change by done --- .../financial-info.component.html | 31 ++++++- .../financial-info.component.ts | 90 +++++++++++++++++-- .../loan-details/loan-details.component.html | 53 +++++++++-- .../loan-details/loan-details.component.ts | 70 +++++++++++++-- 4 files changed, 221 insertions(+), 23 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index 20b52188e..2421dc04d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -889,7 +889,36 @@ formControlName="od_limit"> OD Limit Required - + + + Name of the Lender Required + + + + Loan Amount Required + + + + Loan Type Required + + + + Loan Tenor Required + + + + Loan start date Required + + + + Monthly obligation-Interest/EMI Required + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts index 3a8960a27..3c7a29e1c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts @@ -154,21 +154,29 @@ export class FinancialInfoComponent implements OnInit { ngOnInit() { + console.log(this.av); this.initstockForm(); if(this.lender_short_name == "IIB"){ this.financialForm.addControl('tot_business_FY',new FormControl()) this.financialForm.addControl('orders_hand_FY',new FormControl()) this.financialForm.addControl('remarks_tot_business_FY',new FormControl()) } + if(this.lender_short_name == 'CFPL') + { + + this.av.push({id:8,name:'Name of Lender'}); + this.av.push({id:9,name:'Loan amount'}); + this.av.push({id:10,name:'Loan Type'}); + this.av.push({id:11,name:'Loan Tenor'}); + this.av.push({id:12,name:'Loan start date'}); + this.av.push({id:13,name:'Monthly obligation-Interest/EMI'}); + } if(this.customer_segment_abbr == "SE-DI"){ this.financialForm.addControl('kuccha_records_shown',new FormControl()) this.financialForm.addControl('customer_declared_turnover',new FormControl()) this.financialForm.addControl('kuccha_bill_allowed',new FormControl()) } - if(this.lender_short_name == 'CFPL') - { - - } + if(this.lender_short_name == 'CHFPL'){ this.financialForm.addControl('is_turnover_validated',new FormControl('yes',Validators.compose([Validators.required]))) this.financialForm.addControl('how_turnover_validated',new FormControl('',Validators.compose([Validators.required]))) @@ -259,6 +267,31 @@ export class FinancialInfoComponent implements OnInit { this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl('')); this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl('')); } + if (val.exist_status == 1 && val.id == 8) { + this.financialForm.addControl('lender_name', new FormControl('')); + + } + if (val.exist_status == 1 && val.id == 9) { + this.financialForm.addControl('loan_amount', new FormControl('')); + + } + if (val.exist_status == 1 && val.id == 10) { + this.financialForm.addControl('loan_type', new FormControl('')); + + } + if (val.exist_status == 1 && val.id == 11) { + this.financialForm.addControl('loan_tenor', new FormControl('')); + + } + if (val.exist_status == 1 && val.id == 12) { + this.financialForm.addControl('loan_start_date', new FormControl('')); + + } + if (val.exist_status == 1 && val.id == 13) { + this.financialForm.addControl('monthly_emi', new FormControl('')); + + } + }); @@ -502,6 +535,43 @@ export class FinancialInfoComponent implements OnInit { this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl('')); this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl('')); } + if (event.value.exist_status == true && event.value.id == 8) { + this.financialForm.removeControl('lender_name'); + } + else if (event.value.exist_status == false && event.value.id == 8) { + this.financialForm.addControl('lender_name', new FormControl('')); + } + if (event.value.exist_status == true && event.value.id == 9) { + this.financialForm.removeControl('loan_amount'); + } + else if (event.value.exist_status == false && event.value.id == 9) { + this.financialForm.addControl('loan_amount', new FormControl('')); + } + if (event.value.exist_status == true && event.value.id == 10) { + this.financialForm.removeControl('loan_type'); + } + else if (event.value.exist_status == false && event.value.id == 10) { + this.financialForm.addControl('loan_type', new FormControl('')); + } + if (event.value.exist_status == true && event.value.id == 11) { + this.financialForm.removeControl('loan_tenor'); + } + else if (event.value.exist_status == false && event.value.id == 11) { + this.financialForm.addControl('loan_tenor', new FormControl('')); + } + if (event.value.exist_status == true && event.value.id == 12) { + this.financialForm.removeControl('loan_start_date'); + } + else if (event.value.exist_status == false && event.value.id == 12) { + this.financialForm.addControl('loan_start_date', new FormControl('')); + } + if (event.value.exist_status == true && event.value.id == 13) { + this.financialForm.removeControl('monthly_emi'); + } + else if (event.value.exist_status == false && event.value.id == 13) { + this.financialForm.addControl('monthly_emi', new FormControl('')); + } + // if(event.value.exist_status==true && event.value.id==1){ // let othersControl = this.businessForm.controls['others_activity_details']; @@ -2034,9 +2104,17 @@ export class FinancialInfoComponent implements OnInit { if(records.od_limit) delete records.od_limit; if(records.other_reason_for_working_capital_facilities_availed) delete records.other_reason_for_working_capital_facilities_availed ; if(records.reason_for_working_capital_facilities_availed) delete records.reason_for_working_capital_facilities_availed ; + if(this.lender_short_name='CFPL') + { + if(records.lender_name) delete records.lender_name ; + if(records.loan_amount) delete records.loan_amount; + if(records.loan_type) delete records.loan_type; + if(records.loan_tenor) delete records.loan_tenor; + if(records.loan_start_date) delete records.loan_start_date; + if(records.monthly_emi) delete records.monthly_emi; + } } - - + this._pd.saveForm(records).subscribe(data => { if(data.status == 200) { this.notifier.notify('success', 'Saved Successfully.'); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html index c424cd3b4..103bc9fe4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html @@ -392,16 +392,53 @@ - - - {{"₹"}} {{ loanDetailsForm.controls['peakseasons_anchor'].value | numberToWords }} Only - +
+ + + + Yes + No Major Changes In Sales + + + Is The Business Seasonal Required + + + + January + February + March + April + May + June + July + August + September + October + November + December + + + In Which Period Is Maximum Sale / Service Done Required + +
+
+ + + Comments Required + +
+ - Select Yes @@ -409,7 +446,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts index c2a0de435..c381f6528 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts @@ -95,6 +95,8 @@ export class LoanDetailsComponent implements OnInit { image_doc_params: { pdid: number; form_id: number; company_id: string; }; addressList: any = []; prod_catagory: any; + debitcredit_notes: string; + peakseasons: string; @@ -146,7 +148,7 @@ export class LoanDetailsComponent implements OnInit { ngOnInit() { this.initloanDetailsForm(); console.log(this.loanDetailsForm.controls); - console.log('maran'); + this.getM_EndUseofLoad(); this.getM_EndUseForLoan(this.pdid,this.pd_all_details.pdmaster_details.fk_subproduct_id); this.getM_State(); @@ -202,9 +204,7 @@ export class LoanDetailsComponent implements OnInit { params.pd_id = this.pdid; params.pd_form_id = this.form_id; this._pd.retriveForm(params).subscribe(value => { - console.log(value); - console.log('fetching'); - console.log(this.lenderShortName); + if(this.lenderShortName=='CFPL') { @@ -218,8 +218,21 @@ export class LoanDetailsComponent implements OnInit { this.loanDetailsForm.controls['payment_mechanism'].setValue(value.records.payment_mechanism); this.loanDetailsForm.controls['average_invoicevalue'].setValue(value.records.average_invoicevalue); this.loanDetailsForm.controls['peakseasons_anchor'].setValue(value.records.peakseasons_anchor); - this.loanDetailsForm.controls['anchor_notes'].setValue(value.records.anchor_notes); - this.loanDetailsForm.controls['debitcredit_notes'].setValue(value.records.debitcredit_notes); + this.loanDetailsForm.controls['anchor_notes'].setValue(value.records.anchor_notes); + + if(value.records.anchor_notes=='yes') + { + this.debitcredit_notes='yes'; + this.loanDetailsForm.controls['debitcredit_notes'].setValue(value.records.debitcredit_notes); + } + if(value.records.peakseasons_anchor=='yes') + { + this.peakseasons='yes'; + this.loanDetailsForm.controls['peak_period_of_business'].setValue(value.records.peak_period_of_business); + this.loanDetailsForm.controls['month_of_business_run'].setValue(value.records.month_of_business_run); + } + + this.loanDetailsForm.controls['stock_related_anchor'].setValue(value.records.stock_related_anchor); this.loanDetailsForm.controls['sample_invoices'].setValue(value.records.sample_invoices); } @@ -538,11 +551,43 @@ export class LoanDetailsComponent implements OnInit { this.loanDetailsForm.addControl('average_invoicevalue', new FormControl('', Validators.required)); this.loanDetailsForm.addControl('peakseasons_anchor', new FormControl('', Validators.required)); this.loanDetailsForm.addControl('anchor_notes', new FormControl('', Validators.required)); - this.loanDetailsForm.addControl('debitcredit_notes', new FormControl('', Validators.required)); + // if(this.debitcredit_notes=='yes') + // { + this.loanDetailsForm.addControl('debitcredit_notes', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('peak_period_of_business', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('month_of_business_run', new FormControl('', Validators.required)); + // } + this.loanDetailsForm.addControl('stock_related_anchor', new FormControl('', Validators.required)); this.loanDetailsForm.addControl('sample_invoices', new FormControl('', Validators.required)); } } + selecteddebitcreditChanges(event: any) { + // console.log(this.lenderShortName); + + + if (event == 'no') { + this.loanDetailsForm.removeControl('debitcredit_notes'); + this.debitcredit_notes='no'; + } + else if (event == 'yes') { + this.loanDetailsForm.addControl('debitcredit_notes', new FormControl('')); + this.debitcredit_notes='yes'; + } + } + peakseasonsChanges(event: any) { + // console.log(this.lenderShortName); + if (event == 'no') { + this.loanDetailsForm.removeControl('peak_period_of_business'); + this.loanDetailsForm.removeControl('month_of_business_run'); + this.peakseasons='no'; + } + else if (event == 'yes') { + this.loanDetailsForm.addControl('peak_period_of_business', new FormControl('')); + this.loanDetailsForm.addControl('month_of_business_run', new FormControl('')); + this.peakseasons='yes'; + } + } // compare objects for merge two master table details @@ -948,7 +993,16 @@ export class LoanDetailsComponent implements OnInit { records.average_invoicevalue = this.loanDetailsForm.controls['average_invoicevalue'].value; records.peakseasons_anchor = this.loanDetailsForm.controls['peakseasons_anchor'].value; records.anchor_notes = this.loanDetailsForm.controls['anchor_notes'].value; - records.debitcredit_notes = this.loanDetailsForm.controls['debitcredit_notes'].value; + if(this.loanDetailsForm.controls['anchor_notes'].value=='yes') + { + records.debitcredit_notes = this.loanDetailsForm.controls['debitcredit_notes'].value; + } + if(this.loanDetailsForm.controls['peakseasons_anchor'].value=='yes') + { + records.peak_period_of_business = this.loanDetailsForm.controls['peak_period_of_business'].value; + records.month_of_business_run = this.loanDetailsForm.controls['month_of_business_run'].value; + } + records.stock_related_anchor = this.loanDetailsForm.controls['stock_related_anchor'].value; records.sample_invoices = this.loanDetailsForm.controls['sample_invoices'].value; }