This commit is contained in:
venbatechnologies@gmail.com 2019-03-29 20:42:14 +05:30
parent 91e43a7e6c
commit 15e9f5a3ab
9 changed files with 323 additions and 219 deletions

File diff suppressed because one or more lines are too long

View File

@ -90,8 +90,7 @@ applicants: any;
this.qustCat.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data['dataStatus']==true){
this.existCompanyList=data['records'].filter(val =>val.is_active===true && val.is_company_applicant===true)
this.existCompanyList=data['records'].filter(val =>val.is_active===true )// && val.is_company_applicant===true
}
let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){
@ -134,7 +133,6 @@ applicants: any;
if(val =="Yes")
{
this.addLoanDetails();
}
@ -368,7 +366,7 @@ submitCurrentloan(answerData) {
}
})
this.currentLoans.controls['loan_details'].setValue(result);
this.currentLoans.controls['loan_details'].patchValue(result);
}
}

View File

@ -1,194 +1,201 @@
<ion-header>
<ion-navbar color="optblue">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title *ngIf="!viewchange">Employee Salary Category</ion-title>
</ion-navbar>
<ion-navbar color="optblue">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<form [formGroup]="employmentForm">
<mat-card>
<form [formGroup]="employmentForm">
<mat-card>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width:100%">
<mat-select placeholder="Name of Employer" formControlName="employer_name">
<mat-option *ngFor="let cl of company_list" [value]="cl.company_order_id+'-'+cl.company_name">{{
cl.company_name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls.employer_name.value != ''">
<mat-form-field style="width: 100%" required>
<textarea matInput placeholder="Company Profile in brief" formControlName="employer_in_brief"></textarea>
</mat-form-field>
</div>
<mat-label>Since how long working with this employer?</mat-label>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 45%">
<input matInput type="number" formControlName="how_long_year" autocomplete="off" placeholder="Year" min='0'>
</mat-form-field>
&nbsp;&nbsp;&nbsp;
<mat-form-field style="width: 45%">
<input matInput type="number" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width:100%">
<input matInput placeholder="Total Work Experience" formControlName="total_business_experience" type="number" #workExp
OnlyNumber autocomplete="off" (change)="checkWorkingExperiences()">
<mat-hint style="color: red;" *ngIf="employmentForm.controls.total_business_experience.value !=undefined && this.workExperienceErrorFlag">
Total working Experience is Lower
</mat-hint>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="workExperienceFlag" >
<mat-form-field style="width:100%">
<input matInput placeholder="Previous Work Experience Details" formControlName="total_business_previous_experience" (change)="checkWorkingExperiences()">
</mat-form-field>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Was the Employer Met</p>
<mat-radio-group name="was_met" formControlName="was_met"><!-- //(change)="checkotherDetails($event.value)" -->
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
<!-- *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'" -->
<div *ngIf="employmentForm.controls.was_met.value == 'yes'">
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="pd_cus_segment!='SAL-CHQ'">
<mat-form-field style="width: 100%">
<mat-select placeholder="Name of Person Met" formControlName="name_person_met"
required (selectionChange)="filtercompanyrelationship(employmentForm.controls.employer_name.value,$event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let person of person_met_list" [value]="person.pd_co_applicant_id">
{{person.applicant_name | titlecase}}
</mat-option>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width:100%">
<mat-select placeholder="Name of Employer" formControlName="employer_name" (selectionChange)="checkWithExistYear($event.value)">
<mat-option *ngFor="let cl of company_list" [value]="cl.company_order_id+'-'+cl.company_name">{{
cl.company_name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="pd_cus_segment!='SAL-CHQ'">
<mat-form-field style="width: 100%">
<input matInput placeholder="Designation of Person Met" formControlName="designation_person_met"
required>
</mat-form-field>
</div>
</mat-form-field>
</div>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Salary amount confirmed ?</p>
<mat-radio-group formControlName="confirm_salary">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls.employer_name.value != ''">
<mat-form-field style="width: 100%" required>
<textarea matInput placeholder="Company Profile in brief" formControlName="employer_in_brief"></textarea>
</mat-form-field>
</div>
<div *ngIf="employmentForm.controls.confirm_salary.value == 'yes'">
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-label>Since how long working with this employer?</mat-label>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 45%">
<input matInput type="number" formControlName="how_long_year" autocomplete="off" placeholder="Year"
min='0'>
<mat-error *ngIf="employmentForm.controls.how_long_year.hasError('max')">Higer then business vintage</mat-error>
</mat-form-field>
&nbsp;&nbsp;&nbsp;
<mat-form-field style="width: 45%">
<input matInput type="number" placeholder="Month" formControlName="how_long_month" min='0' (change)="ConvertMonthintoYear($event.target.value)">
<mat-error *ngIf="employmentForm.controls.how_long_month.hasError('max')">Higer then business vintage</mat-error>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width:100%">
<input matInput placeholder="Total Work Experience" formControlName="total_business_experience"
type="number" #workExp OnlyNumber autocomplete="off" (change)="checkWorkingExperiences()">
<!-- <mat-hint style="color: red;" *ngIf="employmentForm.controls.total_business_experience.value !=undefined && this.workExperienceErrorFlag"> -->
<!-- Total working Experience is Lower -->
<!-- </mat-hint> -->
<mat-error *ngIf="employmentForm.controls.total_business_experience.hasError('min')">Total working Experience is Lower</mat-error>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="workExperienceFlag">
<mat-form-field style="width:100%">
<input matInput placeholder="Previous Work Experience Details" formControlName="total_business_previous_experience"
(change)="checkWorkingExperiences()">
</mat-form-field>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Was the Employer Met</p>
<mat-radio-group name="was_met" formControlName="was_met">
<!-- //(change)="checkotherDetails($event.value)" -->
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
<!-- *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'" -->
<div *ngIf="employmentForm.controls.was_met.value == 'yes'">
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="pd_cus_segment!='SAL-CHQ'">
<mat-form-field style="width: 100%">
<input matInput placeholder="What is the salary amount confirmed?" formControlName="confirm_salary_amount" type="number"
OnlyNumber (keyup)="inWords($event.target.value,1)">
<mat-hint align="end" *ngIf="employmentForm.controls.confirm_salary_amount.value != ''">{{"&#8377;"}} {{mthlySlryAmtInWords}} Only</mat-hint>
<mat-select placeholder="Name of Person Met" formControlName="name_person_met" required
(selectionChange)="filtercompanyrelationship(employmentForm.controls.employer_name.value,$event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let person of person_met_list" [value]="person.pd_co_applicant_id">
{{person.applicant_name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="pd_cus_segment!='SAL-CHQ'">
<mat-form-field style="width: 100%">
<input matInput placeholder="Designation of Person Met" formControlName="designation_person_met"
required>
</mat-form-field>
</div>
</div>
</div>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Attendance register seen ?</p>
<mat-radio-group name="attendance_seen" formControlName="attendance_seen">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Salary amount confirmed ?</p>
<mat-radio-group formControlName="confirm_salary">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<P >Salary register seen ?</P>
<mat-radio-group name="sal_reg_seen" formControlName="sal_reg_seen">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
</div>
</mat-card>
<div *ngIf="employmentForm.controls.confirm_salary.value == 'yes'">
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="What is the salary amount confirmed?" formControlName="confirm_salary_amount"
type="number" (keyup)="inWords($event.target.value,1)">
<mat-hint align="end" *ngIf="employmentForm.controls.confirm_salary_amount.value != ''">{{"&#8377;"}}
{{mthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
</div>
</div>
<mat-card>
<h5>Salary Details</h5>
<mat-card-content>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<p>Attendance register seen ?</p>
<mat-radio-group name="attendance_seen" formControlName="attendance_seen">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
</div>
<div *ngIf="pd_cus_segment!='SAL-CHQ'">
<P>Salary register seen ?</P>
<mat-radio-group name="sal_reg_seen" formControlName="sal_reg_seen">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
</div>
</mat-card>
<mat-card>
<h5>Salary Details</h5>
<mat-card-content>
<div fxLayout="column" fxLayoutAlign="start stretch">
<p>Date of Salary</p>&nbsp;
<mat-form-field style="width: 35%">
<mat-select placeholder="From" formControlName="from_date_the_salary_is_rcv" (selectionChange)="formDate($event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let date of dateonly" [value]="date.date" [disabled]="date.isdisabled">
{{date.date}}
</mat-option>
</mat-select>
<mat-select placeholder="From" formControlName="from_date_the_salary_is_rcv" (selectionChange)="formDate($event.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let date of dateonly" [value]="date.date" [disabled]="date.isdisabled">
{{date.date}}
</mat-option>
</mat-select>
</mat-form-field>
&nbsp;&nbsp;&nbsp;
<mat-form-field style="width: 35%">
<mat-select placeholder="To" formControlName="to_date_the_salary_is_rcv">
<mat-option>Select</mat-option>
<mat-option *ngFor="let date of todate" [value]="date.date" [disabled]="date.isdisabled">
{{date.date}}
</mat-option>
</mat-select>
<mat-select placeholder="To" formControlName="to_date_the_salary_is_rcv">
<mat-option>Select</mat-option>
<mat-option *ngFor="let date of todate" [value]="date.date" [disabled]="date.isdisabled">
{{date.date}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" type="number"
OnlyNumber required (keyup)="inWords($event.target.value,2)">
<mat-hint align="end" *ngIf="employmentForm.controls.gross_monthly_salary.value != ''">{{"&#8377;"}} {{grossMthlySlryAmtInWords}} Only</mat-hint>
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" type="number" required (keyup)="inWords($event.target.value,2)">
<mat-hint align="end" *ngIf="employmentForm.controls.gross_monthly_salary.value != ''">{{"&#8377;"}}
{{grossMthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Net Monthly Salary" formControlName="net_monthly_salary" type="number"
OnlyNumber required (keyup)="inWords($event.target.value,3)">
<mat-hint align="end" *ngIf="employmentForm.controls.net_monthly_salary.value != ''">{{"&#8377;"}} {{netMthlySlryAmtInWords}} Only</mat-hint>
required (keyup)="inWords($event.target.value,3)">
<mat-hint align="end" *ngIf="employmentForm.controls.net_monthly_salary.value != ''">{{"&#8377;"}}
{{netMthlySlryAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid in Cash"
formControlName="amount_paid_in_cash" OnlyNumber type="number" autocomplete="off" (keyup)="inWords($event.target.value,6)">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_in_cash.value != ''">{{"&#8377;"}} {{cashAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Amount paid through Bank"
formControlName="amount_paid_through_bank" OnlyNumber type="number" autocomplete="off" (keyup)="inWords($event.target.value,5)">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_through_bank.value != ''">{{"&#8377;"}} {{bankAmtInWords}} Only</mat-hint>
</mat-form-field>
<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()">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_in_cash.value != ''">{{"&#8377;"}}
{{cashAmtInWords}} Only</mat-hint>
<mat-error *ngIf="employmentForm.controls.amount_paid_in_cash.hasError('max')">Given Value is Maximum of Net Salary</mat-error>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<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()">
<mat-hint align="end" *ngIf="employmentForm.controls.amount_paid_through_bank.value != ''">{{"&#8377;"}}
{{bankAmtInWords}} Only</mat-hint>
<mat-error *ngIf="employmentForm.controls.amount_paid_through_bank.hasError('max')">Given Value is Maximum of Net Salary</mat-error>
</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">
<mat-form-field style="width: 100%">
<mat-select placeholder="Is the Amount is 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>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%">
<mat-select placeholder="Is the Amount is 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>
</mat-select>
</mat-form-field>
</div>
@ -200,19 +207,19 @@
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['check_validated'].value == 'not validated'">
<mat-form-field style="width: 100%">
<input matInput placeholder="Why was it not Validated"
formControlName="why_was_it_not_validated">
<input matInput placeholder="Why was it not Validated" formControlName="why_was_it_not_validated">
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch">
<mat-form-field style="width: 100%">
<input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive" type="number"
OnlyNumber required (keyup)="inWords($event.target.value,4)">
<mat-hint align="end" *ngIf="employmentForm.controls.bonus_incentive.value != ''">{{"&#8377;"}} {{bonusIncentiveAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 100%">
<input matInput placeholder="Bonus or Incentive" formControlName="bonus_incentive" type="number"
required (keyup)="inWords($event.target.value,4)">
<mat-hint align="end" *ngIf="employmentForm.controls.bonus_incentive.value != ''">{{"&#8377;"}}
{{bonusIncentiveAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
@ -243,16 +250,16 @@
</mat-form-field>
</div>
<P>Any Delays</P>
<mat-radio-group name="any_delays" formControlName="any_delays">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
</mat-card-content>
</mat-card>
<P>Is there any delay in receiving the salary</P>
<mat-radio-group name="any_delays" formControlName="any_delays">
<mat-radio-button value="yes">YES</mat-radio-button>
<mat-radio-button value="no">NO</mat-radio-button>
</mat-radio-group>
<mat-card>
</mat-card-content>
</mat-card>
<mat-card>
<div fxLayout="row">
<div fxFlex="60" class="pb-0 text-sm-left">
<mat-form-field appearance="outline" style="width: 100%">
@ -263,12 +270,12 @@
</div>
</mat-card>
<ion-row>
</ion-row>
<ion-row>
</form>
</ion-row>
</form>
</ion-content>
<ion-footer>
<button ion-button full color="optblue" (click)="saveEmpInfo()"> Save</button>
<button ion-button full color="optblue" (click)="saveEmpInfo()"> Save</button>
</ion-footer>

View File

@ -2,6 +2,9 @@ page-pd-question-emp-info {
mat-hint{
font-size:11px;
}
mat-error{
font-size:11px;
}
mat-card{
margin-bottom: 15px;
border-radius: 10px !important;

View File

@ -1,6 +1,6 @@
import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {FormBuilder,FormControl,FormArray, FormGroup} from '@angular/forms';
import {FormBuilder,FormControl,FormArray, FormGroup,Validators} from '@angular/forms';
import { QuestionCategoryProvider } from '../../../providers/question-category/question-category';
import { AwsServiceProvider } from '../../../providers/aws-service/aws-service';
import { ToastProvider } from '../../../providers/common-provider/toast';
@ -42,6 +42,8 @@ export class PdQuestionEmpInfoPage {
workExperienceFlag: boolean = false;
workExperienceErrorFlag:boolean = false;
generalExistBusinessYear:any;
generalExistBusinessMonth:any;
public dateonly: any = [{date:1,isdisabled:false},{date:2,isdisabled:false},{date:3,isdisabled:false},{date:4,isdisabled:false},{date:5,isdisabled:false},{date:6,isdisabled:false},{date:7,isdisabled:false},{date:8,isdisabled:false},{date:9,isdisabled:false},{date:10,isdisabled:false},{date:11,isdisabled:false},{date:12,isdisabled:false},{date:13,isdisabled:false},{date:14,isdisabled:false},{date:15,isdisabled:false},{date:16,isdisabled:false},{date:17,isdisabled:false},{date:18,isdisabled:false},{date:19,isdisabled:false},{date:20,isdisabled:false},{date:21,isdisabled:false},{date:22,isdisabled:false},{date:23,isdisabled:false},{date:24,isdisabled:false},{date:25,isdisabled:false},{date:26,isdisabled:false},{date:27,isdisabled:false},{date:28,isdisabled:false},{date:29,isdisabled:false},{date:30,isdisabled:false},{date:31,isdisabled:false}];
public todate: any[] = this.dateonly;
@ -55,6 +57,8 @@ export class PdQuestionEmpInfoPage {
this.pdid=this.pdDetails.pd_id;
this.customer_segment_abbr = this.pdDetails.customer_segment_abbr;
this.pd_cus_segment = this.pdDetails.customer_segment_abbr.toUpperCase();
this.generalExistBusinessYear=100;
this.generalExistBusinessMonth=12;
this.getDropDownList();
this.getCompanyFromGeneralDetails();
this.getEmploymentDetails();
@ -62,7 +66,11 @@ export class PdQuestionEmpInfoPage {
{
employer_name: [''],
employer_in_brief:[''],
how_long_year: [''],
// members.controls.current_business_experiance_year.setValue(this.generalExistBusinessYear);
// members.controls.current_business_experiance_month.setValue(this.generalExistBusinessMonth);
how_long_year: ['',Validators.max(this.generalExistBusinessYear)],
how_long_month: [''],
total_business_experience: [''],
total_business_previous_experience: [''],
@ -141,6 +149,39 @@ export class PdQuestionEmpInfoPage {
}
ValidateNetSalary(){
let salary = this.employmentForm.controls['net_monthly_salary'].value;
console.log('this.employmentForm.controls[amount_paid_in_cash].value',this.employmentForm.controls['amount_paid_in_cash'].value);
if(salary != ''){
let cash_amount = this.employmentForm.controls['amount_paid_in_cash'].value;
// let Bank_amount = this.employmentForm.controls['amount_paid_through_bank'].value;
this.employmentForm.controls['amount_paid_in_cash'].setValidators([Validators.max(salary)]);
this.employmentForm.controls['amount_paid_in_cash'].updateValueAndValidity();
let maxamt = salary-cash_amount
if(maxamt >= 0 ){
this.employmentForm.controls['amount_paid_through_bank'].setValidators([Validators.max(salary-cash_amount)]);
}
else{
this.employmentForm.controls['amount_paid_through_bank'].setValue('0');
this.employmentForm.controls['amount_paid_through_bank'].setValidators([Validators.max(0)]);
}
this.employmentForm.controls['amount_paid_through_bank'].updateValueAndValidity();
}
else{
this.toast.pdTriggerappmessage('Net Monthly Salary Is Empty.!');
this.employmentForm.controls['amount_paid_in_cash'].setValue('');
this.employmentForm.controls['amount_paid_in_cash'].updateValueAndValidity();
this.employmentForm.controls['amount_paid_through_bank'].setValue('');
this.employmentForm.controls['amount_paid_through_bank'].updateValueAndValidity();
return;
}
}
saveEmpInfo(){
if (!this.employmentForm.valid) {
this.toast.pdTriggerappmessage('Form Invalid Try Again.!');
@ -242,6 +283,24 @@ export class PdQuestionEmpInfoPage {
}
}
checkWithExistYear(e) {
let data1 = this.company_list.filter(c => c.company_name == e.split('-')[1])[0];
// console.log(data1);
console.log('this.generalExistBusinessMonth',this.generalExistBusinessMonth);
console.log('this.generalExistBusinessYear',this.generalExistBusinessYear);
if(data1.business_month != null && data1.business_month != '' && data1.business_month != undefined){
this.generalExistBusinessMonth = data1.business_month
}
if(data1.business_years){
this.generalExistBusinessYear = data1.business_years
}
this.employmentForm.controls['how_long_year'].setValidators([Validators.max(this.generalExistBusinessYear)]);
this.employmentForm.controls['how_long_year'].updateValueAndValidity();
// console.log('this.generalExistBusinessMonth',this.generalExistBusinessMonth);
// console.log('this.generalExistBusinessYear',this.generalExistBusinessYear);
}
ConvertMonthintoYear(e) {
@ -250,24 +309,49 @@ ConvertMonthintoYear(e) {
let converted_month: number = e % 12;
let converted_year: number = e / 12;
this.employmentForm.controls.how_long_year.setValue(+how_long_year + +Math.floor(converted_year));
this.employmentForm.controls.how_long_month.setValue(Math.floor(converted_month));
if (how_long_year > this.generalExistBusinessYear) {
this.employmentForm.controls['how_long_year'].setValidators([Validators.max(this.generalExistBusinessYear)]);
this.employmentForm.controls['how_long_year'].updateValueAndValidity();
this.employmentForm.controls['how_long_year'].setValue('');
this.employmentForm.controls['how_long_month'].setValue('');
}
else {
if (how_long_year == this.generalExistBusinessYear && +converted_month > this.generalExistBusinessMonth) {
this.employmentForm.controls['how_long_year'].setValidators([Validators.max(this.generalExistBusinessYear)]);
this.employmentForm.controls['how_long_year'].updateValueAndValidity();
this.employmentForm.controls['how_long_month'].setValidators([Validators.max(this.generalExistBusinessMonth)]);
this.employmentForm.controls['how_long_month'].updateValueAndValidity();
} else {
this.employmentForm.controls.how_long_year.setValue(+how_long_year + +Math.floor(converted_year));
this.employmentForm.controls.how_long_month.setValue(Math.floor(converted_month));
}
}
}
checkWorkingExperiences(){
// this.workExperienceErrorFlag = (+this.employmentForm.controls.total_business_experience.value ) <= (+this.employmentForm.controls.how_long_year.value) ? true : false;
// this.workExperienceFlag = (+this.employmentForm.controls.total_business_experience.value ) < (+this.employmentForm.controls.how_long_year.value) ? false : true;
if((+this.employmentForm.controls.total_business_experience.value ) < (+this.employmentForm.controls.how_long_year.value)){
console.log(+this.employmentForm.controls.total_business_experience.value , +this.employmentForm.controls.how_long_year.value);
this.workExperienceFlag = false;
this.workExperienceErrorFlag = true;
this.expFocus.nativeElement.focus();
this.employmentForm.controls['total_business_experience'].setValidators([Validators.min(+this.employmentForm.controls.how_long_year.value)]);
this.employmentForm.controls['total_business_experience'].updateValueAndValidity();
if(!this.employmentForm.controls['total_business_experience'].valid){
this.expFocus.nativeElement.focus();
}
else{
this.workExperienceFlag = true;
this.workExperienceErrorFlag = false;
this.workExperienceFlag = +this.employmentForm.controls.total_business_experience.value > +this.employmentForm.controls.how_long_year.value ? true : false;
if(!this.workExperienceFlag){
this.employmentForm.controls['total_business_previous_experience'].setValue('');
this.employmentForm.controls['total_business_previous_experience'].updateValueAndValidity();
}
}
inWords(val,flag:number){

View File

@ -66,6 +66,7 @@ export class PdQuestionLoansPage {
sourceList:any=[];
pdid:number;
m_endUseForLoan:any;
subProductName : any;
//public filterCtrl:FormControl=new FormControl
private dbmasters: Dbmaster[];
/** Subject that emits when the component has been destroyed. */
@ -78,6 +79,7 @@ export class PdQuestionLoansPage {
this.applicants = this.pdDetails.applicat_details
this.applicants = this.applicants.filter(appt => appt.applicant_type != 2);
this.productAbbr = this.pdDetails.product_abbr;
this.subProductName = this.pdDetails.subproduct_name;
this.users = this.aws.getlocale();
this.pdid=this.pdDetails.pd_id;
this.getDropdown();
@ -211,9 +213,9 @@ export class PdQuestionLoansPage {
}
return 0
});
console.log("drop",this.dbmasters)
this.filteredBanks.next(this.dbmasters.slice())
console.log("filtere first",this.filteredBanks);
})
this.qustCat.getEndUseForLoan(this.pdid,this.pdDetails.fk_subproduct_id).subscribe(data=>{
@ -230,44 +232,27 @@ export class PdQuestionLoansPage {
this.qustCat.getcommondrop('MORTAGEPROPERTIES').subscribe(
data => {
if(data['dataStatus']==true){
console.log('data[records]',data['records']);
let that = this;
this.m_mortageTypeProperty = data['records'].filter(
// function(data){
// if(that.pdDetails.product_abbr !="LAP" && data.group_name==that.pdDetails.product_abbr && data.isactive==1 )
// {
// return data;
// }else if(that.pdDetails.product_abbr =="LAP" && data.sub_group_name==that.pdDetails.subproduct_name)
// {
// return data;
// }else
// {
// return ;
// }
// });
function (data) {
if (that.pdDetails.product_abbr != "LAP") {
if (data.group_name == that.pdDetails.product_abbr && data.isactive == 1) {
return data;
}
}
else if (that.pdDetails.product_abbr == "LAP") {
if (data.group_name == that.pdDetails.product_abbr && data.sub_group_name == that.pdDetails.subproduct_name && data.isactive == 1) {
if (data.group_name == that.productAbbr && data.sub_group_name == that.subProductName && data.isactive == 1) {
return data;
}
else if (data.group_name == that.pdDetails.product_abbr && data.sub_group_name != null && data.isactive == 1) {
else if (data.group_name == that.pdDetails.product_abbr && data.sub_group_name == null && data.isactive == 1) {
return data;
}
}
});
// this.mortage_type(this.propertyType);
}
console.log('this.m_mortageTypeProperty',this.m_mortageTypeProperty);
});
this.qustCat.getcommondrop('SOURCEOFBALANCETRANSFER').subscribe(
data => {
@ -362,10 +347,11 @@ export class PdQuestionLoansPage {
mortage_type(mortage_value)
{
console.log('mortage_value',mortage_value);
console.log('this.m_mortageTypeProperty',this.m_mortageTypeProperty);
let mortagetypes = this.m_mortageTypeProperty.filter(mor=>mor.mortage_property_id==mortage_value)[0];
var property_name=mortagetypes.property_name
if(property_name=='Others (Please Specify)')
let property_name = mortagetypes.property_name.replace(/\s/g, "").toLowerCase();
if(property_name=='others(pleasespecify)')
{
this.mortageAccess = true;
}else

View File

@ -38,10 +38,14 @@ export class PdQuestionOtherIncomePage {
mergeCompanyApplicant: any=[];
applicants: any=[];
isOrganisationOwner: any=[];
customer_segment_abbr: any;
constructor(public navCtrl: NavController, public navParams: NavParams,public fb:FormBuilder,public qustCat:QuestionCategoryProvider,public aws:AwsServiceProvider,public toast:ToastProvider, public constant:ConstantsProvider) {
this.pdDetails = this.navParams.get('pdDetails');
this.pdid=this.pdDetails.pd_id;
this.FormId = this.navParams.get('FormId');
this.customer_segment_abbr = this.pdDetails.customer_segment_abbr;
console.log('this.customer_segment_abbr',this.customer_segment_abbr)
this.applicants=this.pdDetails.applicat_details.filter(val=>val.pd_co_applicant_id != 0)
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
this.getFrequency();
@ -163,6 +167,15 @@ getFrequency() {
if(res['dataStatus']==true)
{
this.sourceIncome = res['records'];
if (this.customer_segment_abbr == 'SE-RI') {
let inx = this.sourceIncome.map(data => data.name).indexOf("Rental Income")
/** -X- Please NOTE THIS :
* inx is '-1' -> this will remove the last item from array
* so that If Condition is given. */
if (inx !== -1) {
this.sourceIncome.splice(this.sourceIncome.map(data => data.name).indexOf("Rental Income"), 1);
}
}
}
});

View File

@ -23,7 +23,11 @@ page-pd-question-rental-info {
mat-select{
margin-top:7px;
}
textarea.mat-input-element {
padding: 0px 0;
margin: 10px 0;
}
input{
height: 30px;
height: 32px;
}
}

View File

@ -29680,6 +29680,10 @@ page-pd-question-emp-info mat-hint {
font-size: 11px;
}
page-pd-question-emp-info mat-error {
font-size: 11px;
}
page-pd-question-emp-info mat-card {
margin-bottom: 15px;
border-radius: 10px !important;
@ -29903,6 +29907,11 @@ page-pd-question-rental-info mat-select {
margin-top: 7px;
}
page-pd-question-rental-info input {
height: 30px;
page-pd-question-rental-info textarea.mat-input-element {
padding: 0px 0;
margin: 10px 0;
}
page-pd-question-rental-info input {
height: 32px;
}