diff --git a/ng6-seed/Sparqsineedge(WEB 13-03-2021)Test.zip b/ng6-seed/Sparqsineedge(WEB 13-03-2021)Test.zip new file mode 100644 index 000000000..6960cee5e Binary files /dev/null and b/ng6-seed/Sparqsineedge(WEB 13-03-2021)Test.zip differ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html index fa23addd0..131a965ed 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html @@ -392,7 +392,7 @@
- Is There a Loan Against This Asset? + Facility to Loan? Select diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html index f38e2a30f..d4d2f0295 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html @@ -10,7 +10,7 @@ matTooltipPosition="right" mat-dialog-close> close -
+ @@ -188,7 +188,7 @@
- Is There a {{lender_short_name == 'CFPL' ? 'Facility' :'Loan'}} Existing Against This Asset? + Is There a Loan Existing Against This Asset? Select @@ -448,7 +448,7 @@ *ngIf="(sup.get('business_assets_mode').value != '') && sup.get('business_ownership_type').value == 'owned' && (lender_short_name != 'CLIX' && lender_short_name != 'MWISE' || prod_catagory === 'LFMP')">
- Is There a {{lender_short_name == 'CFPL' ? 'Facility' :'Loan'}} Existing Against This Asset? + Is There a Loan Existing Against This Asset? Select 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 71b8e31eb..385969b50 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 @@ -12,11 +12,11 @@
- +
-
+
@@ -241,7 +241,7 @@
-
+
@@ -787,12 +787,39 @@
+
+ +

Financial Data

+
+ + + + + + + + + + + + + + + + + +
-

Working Capital Details

+

Total Banking Facilities

@@ -810,7 +837,7 @@ formControlName="unsold_stock_lies_in_days" OnlyNumber type="text"> - + Yes No @@ -824,9 +851,9 @@ -->
- + -

Working Capital Facilities availed

+

{{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}} availed

@@ -840,15 +867,17 @@ - - Other Reason For Working Capital Facilities Availed Required + Other Reason For{{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}} Availed Required - Reason For Working Capital Facilities Availed Required + Reason For {{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}} Availed Required @@ -889,7 +918,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 c3635ae29..36efeac6d 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 @@ -12,7 +12,7 @@ import { FormArray, FormControl, AbstractControl, } from '@angular/forms'; -import { NotifierService } from 'angular-notifier'; +import { NotifierService } from 'angular-notifier'; import { MatDialog, @@ -101,6 +101,7 @@ export class FinancialInfoComponent implements OnInit { }, ] fk_pd_type: any; + financial: string; constructor(notifier: NotifierService, private fb: FormBuilder, @@ -119,6 +120,10 @@ export class FinancialInfoComponent implements OnInit { this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.lender_short_name = this.pd_all_details.pdmaster_details.lender_short_name; + if(this.lender_short_name=='CFPL') + { + this.financial='no'; + } this.product_abbr = this.pd_all_details.pdmaster_details.product_abbr; this.prod_catagory = this.pd_all_details.pdmaster_details.prod_catagory; this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; @@ -154,17 +159,38 @@ export class FinancialInfoComponent implements OnInit { ngOnInit() { + 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') + { + /* for check box view based on 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'}); + /*--------------------------*/ + + /*for financial data */ + this.financialForm.addControl('turnover_lastcomplete_year',new FormControl()) + this.financialForm.addControl('ytd_turnover',new FormControl()) + this.financialForm.addControl('deptor_collection_period',new FormControl()) + this.financialForm.addControl('inventory_holding_period',new FormControl()) + this.financialForm.addControl('creditor_payment_period',new FormControl()) + /*--------------------------*/ + } 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 == '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]))) @@ -255,6 +281,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('')); + + } + }); @@ -498,6 +549,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']; @@ -2030,9 +2118,25 @@ 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; + /* for remove control */ + if(records.turnover_lastcomplete_year) delete records.turnover_lastcomplete_year; + if(records.ytd_turnover) delete records.ytd_turnover; + if(records.deptor_collection_period) delete records.deptor_collection_period; + if(records.inventory_holding_period) delete records.inventory_holding_period; + if(records.creditor_payment_period) delete records.creditor_payment_period; + /*-----------------------*/ + } + } + 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 7ca6d59c1..292719398 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 @@ -13,7 +13,7 @@ - + @@ -317,6 +317,163 @@ + + + Anchor Details Section + + + + + + {{"₹"}} {{ loanDetailsForm.controls['facility_amount'].value | numberToWords }} Only + + + + + + + +
Applicant's association vintage with the Anchor
+ + + + + + + + + + + + {{"₹"}} {{ loanDetailsForm.controls['monthly_business_anchor'].value | numberToWords }} Only + + + + + + {{ loanDetailsForm.controls['business_concentration'].value }} % + + +
Credit period with the Anchor (Days)
+ + + + +
+ + + Select + Bill-Wise + Open Account + + + + + + {{"₹"}} {{ loanDetailsForm.controls['average_invoicevalue'].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 + No + + + + + + + + + + + + {{"₹"}} {{ loanDetailsForm.controls['stock_related_anchor'].value | numberToWords }} Only + + + + Observations on Sample Invoices Required + +
+ + +
+ +
+
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 82ae8e1ee..5860ca434 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 @@ -2,7 +2,7 @@ import { Component, OnInit, Inject, - Input + Input } from '@angular/core'; import { FormBuilder, FormGroup, Validators, FormArray, FormControl } from '@angular/forms'; @@ -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; @@ -127,6 +129,7 @@ export class LoanDetailsComponent implements OnInit { this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; this.lenderShortName = this.pd_all_details.pdmaster_details.lender_short_name; + if(this.lenderShortName == 'CFPL') { this.pageTitle = 'Facility & Anchor Details' } @@ -148,6 +151,8 @@ export class LoanDetailsComponent implements OnInit { /** init Fns */ ngOnInit() { this.initloanDetailsForm(); + console.log(this.loanDetailsForm.controls); + this.getM_EndUseofLoad(); this.getM_EndUseForLoan(this.pdid,this.pd_all_details.pdmaster_details.fk_subproduct_id); this.getM_State(); @@ -203,6 +208,38 @@ export class LoanDetailsComponent implements OnInit { params.pd_id = this.pdid; params.pd_form_id = this.form_id; this._pd.retriveForm(params).subscribe(value => { + + if(this.lenderShortName=='CFPL') + { + + this.loanDetailsForm.controls['facility_amount'].setValue(value.records.facility_amount); + this.loanDetailsForm.controls['anchor_name'].setValue(value.records.anchor_name); + this.loanDetailsForm.controls['vintage_anchor_year'].setValue(value.records.vintage_anchor_year); + this.loanDetailsForm.controls['vintage_anchor_month'].setValue(value.records.vintage_anchor_month); + this.loanDetailsForm.controls['monthly_business_anchor'].setValue(value.records.monthly_business_anchor); + this.loanDetailsForm.controls['business_concentration'].setValue(value.records.business_concentration); + this.loanDetailsForm.controls['credit_period_days'].setValue(value.records.credit_period_days); + 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); + + 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['sales_low_months'].setValue(value.records.sales_low_months); + this.loanDetailsForm.controls['peak_season_comment'].setValue(value.records.peak_season_comment); + } + + + this.loanDetailsForm.controls['stock_related_anchor'].setValue(value.records.stock_related_anchor); + this.loanDetailsForm.controls['sample_invoices'].setValue(value.records.sample_invoices); + } // *ngIf="prod_catagory === 'HL' || prod_catagory === 'LL' || prod_catagory === 'LAP' " if (value.status == 200) { let result = Object.keys(value.records.end_use_group).map(function (key) { @@ -502,8 +539,59 @@ export class LoanDetailsComponent implements OnInit { pinSearch: [''], other_pincode:[''], loandetails_remarks: [''], + }); + + if(this.lenderShortName=='CFPL') + { + this.loanDetailsForm.addControl('facility_amount', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('anchor_name', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('vintage_anchor_year', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('vintage_anchor_month', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('monthly_business_anchor', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('business_concentration', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('credit_period_days', new FormControl('', Validators.required)); + this.loanDetailsForm.addControl('payment_mechanism', new FormControl('', Validators.required)); + 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)); + // if(this.debitcredit_notes=='yes') + // { + this.loanDetailsForm.addControl('debitcredit_notes', new FormControl('')); + this.loanDetailsForm.addControl('sales_low_months', new FormControl('')); + this.loanDetailsForm.addControl('peak_season_comment', new FormControl('')); + // } + + 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('sales_low_months'); + this.loanDetailsForm.removeControl('peak_season_comment'); + this.peakseasons='no'; + } + else if (event == 'yes') { + this.loanDetailsForm.addControl('sales_low_months', new FormControl('')); + this.loanDetailsForm.addControl('peak_season_comment', new FormControl('')); + this.peakseasons='yes'; + } + } // compare objects for merge two master table details @@ -775,7 +863,7 @@ export class LoanDetailsComponent implements OnInit { /** To save Loan FOrm Details */ submitLoanDetails() { - + if(this.isOtherSource == false){ this.loanDetailsForm.controls['other_source'].setValue(''); this.loanDetailsForm.controls['other_source'].clearValidators(); @@ -879,6 +967,7 @@ export class LoanDetailsComponent implements OnInit { if (!this.loanDetailsForm.valid) { this.validateAllFormFields(this.loanDetailsForm); + this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); const invalid = []; const controls = this.loanDetailsForm.controls; @@ -891,8 +980,36 @@ export class LoanDetailsComponent implements OnInit { this.disableAfterSubmit = false; return; } + this.disableAfterSubmit = true; let records: any = {}; + if(this.lenderShortName=='CFPL') + { + + records.facility_amount = this.loanDetailsForm.controls['facility_amount'].value; + records.anchor_name = this.loanDetailsForm.controls['anchor_name'].value; + records.vintage_anchor_year = this.loanDetailsForm.controls['vintage_anchor_year'].value; + records.vintage_anchor_month = this.loanDetailsForm.controls['vintage_anchor_month'].value; + records.monthly_business_anchor = this.loanDetailsForm.controls['monthly_business_anchor'].value; + records.business_concentration = this.loanDetailsForm.controls['business_concentration'].value; + records.credit_period_days = this.loanDetailsForm.controls['credit_period_days'].value; + records.payment_mechanism = this.loanDetailsForm.controls['payment_mechanism'].value; + 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; + 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.sales_low_months = this.loanDetailsForm.controls['sales_low_months'].value; + records.peak_season_comment = this.loanDetailsForm.controls['peak_season_comment'].value; + } + + records.stock_related_anchor = this.loanDetailsForm.controls['stock_related_anchor'].value; + records.sample_invoices = this.loanDetailsForm.controls['sample_invoices'].value; + } records.parent_pdid = this.parent_pdid; records.pdid = this.pdid; records.formid = this.form_id; @@ -989,9 +1106,13 @@ export class LoanDetailsComponent implements OnInit { records.city=this.loanDetailsForm.controls['city'].value; records.pincode=this.loanDetailsForm.controls['pincode'].value; records.other_pincode=this.loanDetailsForm.controls['other_pincode'].value; - + + console.log(records); + console.log('latest'); this._pd.saveForm(records).subscribe(data => { if (data.status == 200) { + console.log(data); + console.log('success'); this.notifier.notify('success', 'Saved Successfully.'); // this.dialogRef.close(); setTimeout(() => {