SAL and Rental changes done

This commit is contained in:
sriram-at-840620226347 2020-01-04 13:15:35 +05:30
parent 549bfe9088
commit a23b2fab49
4 changed files with 49 additions and 32 deletions

View File

@ -306,7 +306,7 @@
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.value.mode_of_getting_salary == 'paid_in_cash' || employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'">
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'">
<mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid in Cash" formControlName="amount_paid_in_cash"
type="number" autocomplete="off" (keyup)="inWords($event.target.value,6)" (change)="ValidateNetSalary()" #cashPaidFocus>
@ -316,7 +316,7 @@
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.value.mode_of_getting_salary == 'bank_transfer' || employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'">
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.value.mode_of_getting_salary == 'both_bank_transfer_cash'">
<mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid through Bank" formControlName="amount_paid_through_bank"
type="number" autocomplete="off" (keyup)="inWords($event.target.value,5)" (change)="ValidateNetSalary()">
@ -326,9 +326,9 @@
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls.amount_paid_in_cash.value != '' && employmentForm.controls.amount_paid_in_cash.value != 0">
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<mat-select placeholder="Is the Amount is Validated or Not" formControlName="check_validated">
<mat-select placeholder="Is the Amount Validated or Not" formControlName="check_validated">
<mat-option>Select</mat-option>
<mat-option value="validated">Validated</mat-option>
<mat-option value="not validated">Not Validated</mat-option>

View File

@ -347,12 +347,16 @@ this.pd_value_params={pd_id:this.pdDetails.pd_id,form_id:this.FormId.form_id,com
records.net_monthly_salary = this.employmentForm.controls['net_monthly_salary'].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;
}
if(records.mode_of_getting_salary == 'both_bank_transfer_cash'){
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;
}
// 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;
@ -599,12 +603,16 @@ inWords(val,flag:number){
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['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);
}
if(Emp.mode_of_getting_salary == 'both_bank_transfer_cash'){
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);
}
// 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);

View File

@ -416,7 +416,7 @@
</mat-card>
</ng-container>
<!-- end floor details -->
<hr>
<!-- this is for property unit details-->
<ng-container formArrayName="property_unit_details" *ngIf="rentalForms.value.property_unit_details.length>0">
@ -430,6 +430,7 @@
<mat-card-content>
<div fxLayout="row wrap">
<!-- start tenant/lessees -->
<mat-card-title style="color:#e00201;"><strong>As per Applicant Questions</strong></mat-card-title>
<mat-form-field style="width:100%">
<mat-label>Name of the Tenant(s)/Lessees(s) of the Let out Property</mat-label>
<mat-select placeholder="" formControlName="tenant_lessees_options" (selectionChange)="generateTenantOptions(units.value,u)"
@ -534,8 +535,10 @@
</mat-select>
</mat-form-field>
<!-- end -->
<hr>
<!-- start rent agreement -->
<div *ngIf="units.controls['rent_agreement_seen']">
<mat-card-title style="color:#e00201;"><strong>As per rent agreement Questions</strong></mat-card-title>
<mat-form-field style="width:100%" *ngIf="units.controls['rent_agreement_seen']">
<mat-label>Rent Agreement Seen</mat-label>
<mat-select placeholder="" formControlName="rent_agreement_seen" (selectionChange)="generateRegisterOptions(units.value,u)"
@ -658,10 +661,12 @@
<mat-label>Name of Tenants / Lessees as per Rent Agreement</mat-label>
<textarea matInput rows="4" placeholder="" formControlName="agreement_tenant_lessees_name" required></textarea>
</mat-form-field>
</div>
<!-- end -->
<!-- end -->
<hr>
<!-- start met tenant/lessees-->
<mat-card-title style="color:#e00201;"><strong>As per Tenant(s)/Lessee Met Questions</strong></mat-card-title>
<mat-form-field style="width:100%" *ngIf="units.controls['met_tenant_lessees_options']">
<mat-label>Tenant(s) / Lessee(s) Met During Visit of the Rented Property</mat-label>
<mat-select placeholder="" formControlName="met_tenant_lessees_options" (selectionChange)="generateTenantMetDetails(units.value,u)"
@ -776,10 +781,10 @@
</mat-form-field>
<!-- start validate appplicant/agreement payment options -->
<mat-form-field style="width:100%" *ngIf="(units.value.monthly_rent_amount>0 && units.value.paid_monthly_rent_per_met>0 && units.value.payment_mode!='' && units.value.payment_mode_per_met!='') && (units.value.monthly_rent_amount!=units.value.paid_monthly_rent_per_met || units.value.payment_mode.id!=units.value.payment_mode_per_met.id)">
<!-- <mat-form-field style="width:100%" *ngIf="(units.value.monthly_rent_amount>0 && units.value.paid_monthly_rent_per_met>0 && units.value.payment_mode!='' && units.value.payment_mode_per_met!='') && (units.value.monthly_rent_amount!=units.value.paid_monthly_rent_per_met || units.value.payment_mode.id!=units.value.payment_mode_per_met.id)">
<mat-label>What is the Reason for Difference in Rent Amount or Mode of Payment</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="payment_difference_per_met">
</mat-form-field>
</mat-form-field> -->
<!-- end -->
<!-- end met payment -->

View File

@ -411,13 +411,15 @@ addMoreUnitDetails(){
if(type==1){
let control: any = <FormArray>this.rentalForms.controls['property_unit_details'];
if(value && value.payment_mode.id==1){
control.controls[index].addControl('amount_received_cash', new FormControl(value.amount_received_cash ? value.amount_received_cash : '', Validators.required));
// control.controls[index].addControl('amount_received_cash', new FormControl(value.amount_received_cash ? value.amount_received_cash : '', Validators.required));
control.controls[index].removeControl('amount_received_cash');
control.controls[index].removeControl('amount_received_bank');
control.controls[index].removeControl('payment_received_reason');
}
else if(value && value.payment_mode.id==2){
control.controls[index].addControl('amount_received_bank', new FormControl(value.amount_received_bank ? value.amount_received_bank : '', Validators.required));
// control.controls[index].addControl('amount_received_bank', new FormControl(value.amount_received_bank ? value.amount_received_bank : '', Validators.required));
control.controls[index].removeControl('amount_received_cash');
control.controls[index].removeControl('amount_received_bank');
control.controls[index].removeControl('payment_received_reason');
}
else if(value && value.payment_mode.id==3){
@ -435,19 +437,21 @@ addMoreUnitDetails(){
else if(type==2){
let control: any = <FormArray>this.rentalForms.controls['property_unit_details'];
console.log("controls",control.controls['index'])
if( control.controls[index].controls['payment_difference_per_met']){
console.log("pay");
control.controls[index].controls['payment_difference_per_met'].setValue('')
}
// if( control.controls[index].controls['payment_difference_per_met']){
// console.log("pay");
// control.controls[index].controls['payment_difference_per_met'].setValue('')
// }
if(value && value.payment_mode_per_met.id==1){
control.controls[index].addControl('amount_received_cash_per_met', new FormControl(value.amount_received_cash_per_met ? value.amount_received_cash_per_met : '', Validators.required));
// control.controls[index].addControl('amount_received_cash_per_met', new FormControl(value.amount_received_cash_per_met ? value.amount_received_cash_per_met : '', Validators.required));
control.controls[index].removeControl('amount_received_cash_per_met');
control.controls[index].removeControl('amount_received_bank_per_met');
control.controls[index].removeControl('payment_received_reason_per_met');
}
else if(value && value.payment_mode_per_met.id==2){
control.controls[index].addControl('amount_received_bank_per_met', new FormControl(value.amount_received_bank_per_met ? value.amount_received_bank_per_met : '', Validators.required));
// control.controls[index].addControl('amount_received_bank_per_met', new FormControl(value.amount_received_bank_per_met ? value.amount_received_bank_per_met : '', Validators.required));
control.controls[index].removeControl('amount_received_cash_per_met');
control.controls[index].removeControl('amount_received_bank_per_met');
control.controls[index].removeControl('payment_received_reason_per_met');
}
else if(value && value.payment_mode_per_met.id==3){
@ -701,7 +705,7 @@ generateTenantMetDetails(value: any, index: number){
control.controls[index].addControl('paid_monthly_rent_per_met', new FormControl('', Validators.required));
control.controls[index].addControl('period_of_stay_per_met', new FormControl('', Validators.required));
control.controls[index].addControl('payment_mode_per_met', new FormControl('', Validators.required));
control.controls[index].addControl('payment_difference_per_met', new FormControl(''));
// control.controls[index].addControl('payment_difference_per_met', new FormControl(''));
}
@ -711,7 +715,7 @@ generateTenantMetDetails(value: any, index: number){
control.controls[index].removeControl('paid_monthly_rent_per_met');
control.controls[index].removeControl('period_of_stay_per_met');
control.controls[index].removeControl('payment_mode_per_met');
control.controls[index].removeControl('payment_difference_per_met');
// control.controls[index].removeControl('payment_difference_per_met');
// remove other owner details
@ -1197,7 +1201,7 @@ this.spinner_access=true;
element.amount_received_cash_per_met ? control.controls[index].addControl('amount_received_cash_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('amount_received_cash_per_met');
element.amount_received_bank_per_met ? control.controls[index].addControl('amount_received_bank_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('amount_received_bank_per_met');
element.payment_received_reason_per_met ? control.controls[index].addControl('payment_received_reason_per_met', new FormControl('', Validators.required)) : control.controls[index].removeControl('payment_received_reason_per_met');
if( element.payment_difference_per_met =='' || element.payment_difference_per_met !='') { control.controls[index].addControl('payment_difference_per_met', new FormControl('')) }
// if( element.payment_difference_per_met =='' || element.payment_difference_per_met !='') { control.controls[index].addControl('payment_difference_per_met', new FormControl('')) }
// control.controls[index].removeControl('payment_difference_per_met');
this.inWords(element.monthly_rent_amount != '' ? +element.monthly_rent_amount : '',index,5);
this.inWords(element.amount_received_cash != '' ? +element.amount_received_cash : '',index,6);