latest change by done

This commit is contained in:
gayathri1990 2021-03-11 00:10:31 +05:30
parent a2f4056e87
commit b82fdfbb40
4 changed files with 221 additions and 23 deletions

View File

@ -889,7 +889,36 @@
formControlName="od_limit">
<mat-error *ngIf="financialForm.controls['od_limit'].hasError('required')">OD Limit Required</mat-error>
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['lender_name']">
<input matInput autocomplete="off" placeholder="Name of the Lender"
formControlName="lender_name">
<mat-error *ngIf="financialForm.controls['lender_name'].hasError('required')">Name of the Lender Required</mat-error>
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['loan_amount']">
<input matInput autocomplete="off" placeholder="Loan Amount"
formControlName="loan_amount">
<mat-error *ngIf="financialForm.controls['loan_amount'].hasError('required')">Loan Amount Required</mat-error>
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['loan_type']">
<input matInput autocomplete="off" placeholder="Loan Type"
formControlName="loan_type">
<mat-error *ngIf="financialForm.controls['loan_type'].hasError('required')">Loan Type Required</mat-error>
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['loan_tenor']">
<input matInput autocomplete="off" placeholder="Loan Tenor"
formControlName="loan_tenor">
<mat-error *ngIf="financialForm.controls['loan_tenor'].hasError('required')">Loan Tenor Required</mat-error>
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['loan_start_date']">
<input matInput autocomplete="off" placeholder="Loan start date"
formControlName="loan_start_date">
<mat-error *ngIf="financialForm.controls['loan_start_date'].hasError('required')">Loan start date Required</mat-error>
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['monthly_emi']">
<input matInput autocomplete="off" placeholder="Monthly obligation-Interest/EMI"
formControlName="monthly_emi">
<mat-error *ngIf="financialForm.controls['monthly_emi'].hasError('required')">Monthly obligation-Interest/EMI Required</mat-error>
</mat-form-field>
</div>
</mat-card-content>
</mat-card>

View File

@ -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 = <FormArray>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.');

View File

@ -392,16 +392,53 @@
</mat-form-field>
<span>
<mat-form-field style="width: 64%">
<input matInput placeholder="Are there peak seasons for the business with Anchor"
OnlyNumber type="text" formControlName="peakseasons_anchor"
(change)="loanCalc()" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['peakseasons_anchor'].value != ''">{{"&#8377;"}} {{ loanDetailsForm.controls['peakseasons_anchor'].value | numberToWords }} Only</mat-hint>
<div fxLayout="row wrap">
<mat-form-field style="width: 28%">
<!-- <input matInput placeholder="Seasonality" formControlName="seasonality" required> -->
<mat-select placeholder="Is The Business Seasonal" (selectionChange)="peakseasonsChanges($event.value)"
formControlName="peakseasons_anchor"
required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No Major Changes In Sales
</mat-option>
</mat-select>
<mat-error *ngIf="loanDetailsForm.controls['peakseasons_anchor'].hasError('required')">Is The Business Seasonal Required</mat-error>
</mat-form-field>
<mat-form-field style="width: 60%" *ngIf="peakseasons == 'yes'">
<mat-select multiple placeholder="Months in which sales/service is low?"
formControlName="peak_period_of_business" required>
<mat-option value="1">January</mat-option>
<mat-option value="2">February</mat-option>
<mat-option value="3">March</mat-option>
<mat-option value="4">April</mat-option>
<mat-option value="5">May</mat-option>
<mat-option value="6">June</mat-option>
<mat-option value="7">July</mat-option>
<mat-option value="8">August</mat-option>
<mat-option value="9">September</mat-option>
<mat-option value="10">October</mat-option>
<mat-option value="11">November</mat-option>
<mat-option value="12">December</mat-option>
</mat-select>
<mat-error *ngIf="loanDetailsForm.controls['peak_period_of_business'].hasError('required')">In Which Period Is Maximum Sale / Service Done Required</mat-error>
</mat-form-field>
</div>
<div fxLayout="row nowrap" *ngIf="peakseasons == 'yes'">
<mat-form-field style="width: 60%">
<textarea matInput placeholder="Comments" formControlName="month_of_business_run"
required></textarea>
<mat-error *ngIf="loanDetailsForm.controls['month_of_business_run'].hasError('required')">Comments Required</mat-error>
</mat-form-field>
<!-- <mat-form-field>
<input matInput placeholder="Any delays"
formControlName="any_delays" required>
</mat-form-field> -->
</div>
<mat-form-field style="width: 64%">
<mat-select placeholder="Are there debit/credit notes being issued to/by Anchor" (selectionChange)="selectedBalancesTransferChanges($event.value)"
<mat-select placeholder="Are there debit/credit notes being issued to/by Anchor" (selectionChange)="selecteddebitcreditChanges($event.value)"
formControlName="anchor_notes">
<mat-option>Select</mat-option>
<mat-option value="yes">Yes</mat-option>
@ -409,7 +446,7 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width: 28%">
<mat-form-field style="width: 28%" *ngIf="debitcredit_notes == 'yes'">
<input matInput placeholder="Reason for such debit/credit notes"
type="text" formControlName="debitcredit_notes"
autocomplete="off">

View File

@ -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;
}