add mandatory field in financial information

This commit is contained in:
gayathri1990 2021-04-24 13:03:38 +05:30
parent daa6b7d89c
commit 36d708072f
2 changed files with 45 additions and 45 deletions

View File

@ -844,7 +844,7 @@
<mat-form-field style="width:92%" *ngIf="!ServiceDataAvailability">
<input matInput autocomplete="off" placeholder="What is the average no of days for which stock lies unsold during the year?"
formControlName="unsold_stock_lies_in_days" OnlyNumber type="text">
<mat-error *ngIf="financialForm.controls['unsold_stock_lies_in_days'].hasError('required')">What is the average no of days for which stock lies unsold during the year Required</mat-error>
<!--<mat-error *ngIf="financialForm.controls['unsold_stock_lies_in_days'].hasError('required')">What is the average no of days for which stock lies unsold during the year Required</mat-error>-->
</mat-form-field>
<mat-form-field style="width:92%">
<mat-select placeholder="Is there {{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}}?" formControlName="is_there_working_capital_available">
@ -852,7 +852,7 @@
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
<mat-error *ngIf="financialForm.controls['is_there_working_capital_available'].hasError('required')">Is there Facilities Required</mat-error>
<!--<mat-error *ngIf="financialForm.controls['is_there_working_capital_available'].hasError('required')">Is there Facilities Required</mat-error>-->
</mat-form-field>
<!-- <mat-form-field style="width:45%;" *ngIf="financialForm.controls.is_there_working_capital_available.value == 'yes'">
<mat-select multiple formControlName="working_capital_facilities_availed"
@ -882,31 +882,31 @@
{{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}}?
availed"
formControlName="other_reason_for_working_capital_facilities_availed">
<mat-error *ngIf="financialForm.controls['other_reason_for_working_capital_facilities_availed'].hasError('required')">Other Reason For{{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}} Availed Required</mat-error>
<!--<mat-error *ngIf="financialForm.controls['other_reason_for_working_capital_facilities_availed'].hasError('required')">Other Reason For{{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}} Availed Required</mat-error>-->
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['reason_for_working_capital_facilities_availed']">
<input matInput autocomplete="off" placeholder="Details of Others Facility"
formControlName="reason_for_working_capital_facilities_availed">
<mat-error *ngIf="financialForm.controls['reason_for_working_capital_facilities_availed'].hasError('required')">Reason For {{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}} Availed Required</mat-error>
<!--<mat-error *ngIf="financialForm.controls['reason_for_working_capital_facilities_availed'].hasError('required')">Reason For {{lender_short_name == 'CFPL' ? 'Total Banking Facilities' :'Working Capital Facilities'}} Availed Required</mat-error>-->
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['bank_guarantee']">
<input matInput autocomplete="off" placeholder="Details of Bank Guarantee Facility"
formControlName="bank_guarantee">
<mat-error *ngIf="financialForm.controls['bank_guarantee'].hasError('required')">Bank Guarantee Required</mat-error>
<!--<mat-error *ngIf="financialForm.controls['bank_guarantee'].hasError('required')">Bank Guarantee Required</mat-error>-->
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['cash_credit_limit']">
<input matInput autocomplete="off" placeholder="Details of Cash Credit Limit"
formControlName="cash_credit_limit">
<mat-error *ngIf="financialForm.controls['cash_credit_limit'].hasError('required')">Cash Credit Limit Required</mat-error>
<!--<mat-error *ngIf="financialForm.controls['cash_credit_limit'].hasError('required')">Cash Credit Limit Required</mat-error>-->
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['factoring']">
<input matInput autocomplete="off" placeholder="Details of Factoring"
formControlName="factoring">
<mat-error *ngIf="financialForm.controls['factoring'].hasError('required')">Factoring Required</mat-error>
<!--<mat-error *ngIf="financialForm.controls['factoring'].hasError('required')">Factoring Required</mat-error>-->
</mat-form-field>
@ -920,44 +920,44 @@
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['forfaiting']">
<input matInput autocomplete="off" placeholder="Details of Forfaiting"
formControlName="forfaiting">
<mat-error *ngIf="financialForm.controls['forfaiting'].hasError('required')">Forfaiting Required</mat-error>
<!--<mat-error *ngIf="financialForm.controls['forfaiting'].hasError('required')">Forfaiting Required</mat-error>-->
</mat-form-field>
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['od_limit']">
<input matInput autocomplete="off" placeholder="Details of OD Limit"
formControlName="od_limit">
<mat-error *ngIf="financialForm.controls['od_limit'].hasError('required')">OD Limit Required</mat-error>
<!--<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-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-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-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-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-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-error *ngIf="financialForm.controls['monthly_emi'].hasError('required')">Monthly obligation-Interest/EMI Required</mat-error>-->
</mat-form-field>
</div>
</mat-card-content>

View File

@ -258,52 +258,52 @@ export class FinancialInfoComponent implements OnInit {
workingCptlControl.push(this.workingCptl(val));
if (val.exist_status == 1 && val.id == 2) {
this.financialForm.addControl('bank_guarantee', new FormControl('', Validators.required));
this.financialForm.addControl('bank_guarantee', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 3) {
this.financialForm.addControl('cash_credit_limit', new FormControl('', Validators.required));
this.financialForm.addControl('cash_credit_limit', new FormControl(''));
console.log("retrivedata",retriveData)
!retriveData.hasOwnProperty('cash_credit_limit')? retriveData.cash_credit_limit='' : retriveData.cash_credit_limit
}
if (val.exist_status == 1 && val.id == 4) {
this.financialForm.addControl('factoring', new FormControl('', Validators.required));
this.financialForm.addControl('factoring', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 5) {
this.financialForm.addControl('forfaiting', new FormControl('', Validators.required));
this.financialForm.addControl('forfaiting', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 6) {
this.financialForm.addControl('letter_of_credit', new FormControl('', Validators.required));
this.financialForm.addControl('letter_of_credit', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 7) {
this.financialForm.addControl('od_limit', new FormControl('', Validators.required));
this.financialForm.addControl('od_limit', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 1) {
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
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('', Validators.required));
this.financialForm.addControl('lender_name', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 9) {
this.financialForm.addControl('loan_amount', new FormControl('', Validators.required));
this.financialForm.addControl('loan_amount', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 10) {
this.financialForm.addControl('loan_type', new FormControl('', Validators.required));
this.financialForm.addControl('loan_type', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 11) {
this.financialForm.addControl('loan_tenor', new FormControl('', Validators.required));
this.financialForm.addControl('loan_tenor', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 12) {
this.financialForm.addControl('loan_start_date', new FormControl('', Validators.required));
this.financialForm.addControl('loan_start_date', new FormControl(''));
}
if (val.exist_status == 1 && val.id == 13) {
this.financialForm.addControl('monthly_emi', new FormControl('', Validators.required));
this.financialForm.addControl('monthly_emi', new FormControl(''));
}
@ -464,8 +464,8 @@ export class FinancialInfoComponent implements OnInit {
// reason_for_working_capital_facilities_availed:[value.reason_for_working_capital_facilities_availed]
receive_the_money_in_days:['', Validators.compose([Validators.required])],
pay_the_money_in_days:['', Validators.compose([Validators.required])],
unsold_stock_lies_in_days:['', Validators.compose([Validators.required])],
is_there_working_capital_available:['', Validators.compose([Validators.required])],
unsold_stock_lies_in_days:[''],
is_there_working_capital_available:[''],
working_capital_facilities_availed:[''],
// reason_for_working_capital_facilities_availed:[''],
// same_as_financial_statements:[''],
@ -510,81 +510,81 @@ export class FinancialInfoComponent implements OnInit {
this.financialForm.removeControl('bank_guarantee');
}
else if (event.value.exist_status == false && event.value.id == 2) {
this.financialForm.addControl('bank_guarantee', new FormControl('', Validators.required));
this.financialForm.addControl('bank_guarantee', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 3) {
this.financialForm.removeControl('cash_credit_limit');
}
else if (event.value.exist_status == false && event.value.id == 3) {
this.financialForm.addControl('cash_credit_limit', new FormControl('', Validators.required));
this.financialForm.addControl('cash_credit_limit', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 4) {
this.financialForm.removeControl('factoring');
}
else if (event.value.exist_status == false && event.value.id == 4) {
this.financialForm.addControl('factoring', new FormControl('', Validators.required));
this.financialForm.addControl('factoring', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 5) {
this.financialForm.removeControl('forfaiting');
}
else if (event.value.exist_status == false && event.value.id == 5) {
this.financialForm.addControl('forfaiting', new FormControl('', Validators.required));
this.financialForm.addControl('forfaiting', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 6) {
this.financialForm.removeControl('letter_of_credit');
}
else if (event.value.exist_status == false && event.value.id == 6) {
this.financialForm.addControl('letter_of_credit', new FormControl('', Validators.required));
this.financialForm.addControl('letter_of_credit', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 7) {
this.financialForm.removeControl('od_limit');
}
else if (event.value.exist_status == false && event.value.id == 7) {
this.financialForm.addControl('od_limit', new FormControl('', Validators.required));
this.financialForm.addControl('od_limit', new FormControl(''));
}
if (event.value.exist_status == true && event.value.id == 1) {
this.financialForm.removeControl('other_reason_for_working_capital_facilities_availed');
this.financialForm.removeControl('reason_for_working_capital_facilities_availed');
}
else if (event.value.exist_status == false && event.value.id == 1) {
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
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('', Validators.required));
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('', Validators.required));
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('', Validators.required));
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('', Validators.required));
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('', Validators.required));
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('', Validators.required));
this.financialForm.addControl('monthly_emi', new FormControl(''));
}