changes:ps

This commit is contained in:
venbatechnologies@gmail.com 2019-02-04 09:15:50 +05:30
parent 6e377c6d3b
commit 12cfe21f25
13 changed files with 359 additions and 103 deletions

Binary file not shown.

View File

@ -57,7 +57,8 @@
</mat-form-field> </mat-form-field>
</div> </div>
<p style="margin-left: 2% !important" *ngIf='!EntityTypeFlag'>No of Years since formation of {{pageTitle}} </p> <p style="margin-left: 2% !important" *ngIf='!EntityTypeFlag'>No of Years in Current Business </p>
<div fxLayout="row nowrap" class="state-margin" *ngIf='!EntityTypeFlag'> <div fxLayout="row nowrap" class="state-margin" *ngIf='!EntityTypeFlag'>
<mat-form-field style="width: 20%;"> <mat-form-field style="width: 20%;">
@ -69,8 +70,8 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%;"> <mat-form-field style="width: 35%;">
<input matInput placeholder="Total Work Experience" <input matInput placeholder="Total Work Experience"
formControlName="total_business_experiance" (keypress)="keyPress($event)" (keyup)="getWorkExperience(members.value,i)" autocomplete="off" required> formControlName="total_business_experiance" (keypress)="keyPress($event)" (keyup)="getWorkExperience(members.value,i)" autocomplete="off" required (change)="checkWithExistTotalWorkExperience($event.target.value,i,members)">
<mat-hint style="color: red;" *ngIf="members.value.total_business_experiance != '' && members.value.current_business_experiance_year > members.value.total_business_experiance"> Total Experience is Lower Than The Current Company </mat-hint> <mat-hint style="color: red;">{{errorMessageForExistTotalWorkExperience[i]}}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row nowrap" *ngIf="members.value.total_business_previous_experience!=undefined && !EntityTypeFlag"> <div fxLayout="row nowrap" *ngIf="members.value.total_business_previous_experience!=undefined && !EntityTypeFlag">
@ -211,7 +212,7 @@
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required> <input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%;"> <mat-form-field style="width: 30%;">
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeManufacturingAreaSale(manufacturing,m)" required> <mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeManufacturingAreaSale(manufacturing,m);CheckExport($event.value,1);" required>
<mat-option value="Within India">Within India</mat-option> <mat-option value="Within India">Within India</mat-option>
<mat-option value="Export">Export</mat-option> <mat-option value="Export">Export</mat-option>
<mat-option value="Both">Both</mat-option> <mat-option value="Both">Both</mat-option>
@ -448,7 +449,7 @@
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required> <input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%;"> <mat-form-field style="width: 30%;">
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeRetailAreaSale(retail,r)" required> <mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeRetailAreaSale(retail,r);CheckExport($event.value,2);" required>
<mat-option value="Within India">Within India</mat-option> <mat-option value="Within India">Within India</mat-option>
<mat-option value="Export">Export</mat-option> <mat-option value="Export">Export</mat-option>
<mat-option value="Both">Both</mat-option> <mat-option value="Both">Both</mat-option>
@ -687,7 +688,7 @@
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required> <input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%;"> <mat-form-field style="width: 30%;">
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeWholesaleAreaSale(wholesale,w)" required> <mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeWholesaleAreaSale(wholesale,w);CheckExport($event.value,3);" required>
<mat-option value="Within India">Within India</mat-option> <mat-option value="Within India">Within India</mat-option>
<mat-option value="Export">Export</mat-option> <mat-option value="Export">Export</mat-option>
<mat-option value="Both">Both</mat-option> <mat-option value="Both">Both</mat-option>
@ -924,7 +925,7 @@
<input matInput type="text" placeholder="Services Provided" formControlName="main_products" required> <input matInput type="text" placeholder="Services Provided" formControlName="main_products" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%;"> <mat-form-field style="width: 30%;">
<mat-select formControlName="area_of_sale" placeholder="Area of Service" (selectionChange)="changeServiceArea(serviceprovider,sp)" required> <mat-select formControlName="area_of_sale" placeholder="Area of Service" (selectionChange)="changeServiceArea(serviceprovider,sp);CheckExport($event.value,4);" required>
<mat-option value="Within India">Within India</mat-option> <mat-option value="Within India">Within India</mat-option>
<mat-option value="Export">Export</mat-option> <mat-option value="Export">Export</mat-option>
<mat-option value="Both">Both</mat-option> <mat-option value="Both">Both</mat-option>
@ -1172,7 +1173,7 @@
</button> </button>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
<mat-card> <mat-card *ngIf="ExportFlag">
<mat-card-header> <mat-card-header>
<mat-card-title>Export Sale As a % Total Sales</mat-card-title> <mat-card-title>Export Sale As a % Total Sales</mat-card-title>
</mat-card-header> </mat-card-header>
@ -1255,6 +1256,7 @@
</mat-card-header> </mat-card-header>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<div fxLayout="row nowrap">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Total" <input matInput placeholder="Total"
formControlName="employees_total" required> formControlName="employees_total" required>
@ -1267,6 +1269,13 @@
<input matInput placeholder="Temporary" (change)="checkTotalEmployee(businessForm)" <input matInput placeholder="Temporary" (change)="checkTotalEmployee(businessForm)"
formControlName="employees_temporary" required> formControlName="employees_temporary" required>
</mat-form-field> </mat-form-field>
</div>
<mat-form-field style="width:62%">
<input matInput placeholder="Approximate total monthly salary paid to employees" (keyup)="inWords($event,1)"
formControlName="employees_appx_salary" required type="number">
<mat-hint align="start" style="font-size:90%" *ngIf="businessForm.controls['employees_appx_salary'].value != ''">{{"&#8377;"}} {{appxSalaryAmtInwords}} Only</mat-hint>
</mat-form-field>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
<mat-card> <mat-card>

View File

@ -68,6 +68,9 @@ export class BusinessInfoComponent implements OnInit {
generalExistBusinessYear:Number; generalExistBusinessYear:Number;
generalExistBusinessMonth:Number; generalExistBusinessMonth:Number;
errorMessage: any = []; errorMessage: any = [];
errorMessageForExistTotalWorkExperience:any = [];
ExportFlag: boolean = false;
appxSalaryAmtInwords: any;
constructor(notifier: NotifierService, constructor(notifier: NotifierService,
private fb: FormBuilder, private fb: FormBuilder,
@ -576,7 +579,7 @@ export class BusinessInfoComponent implements OnInit {
fk_createdby: this.pdid, fk_createdby: this.pdid,
//industry: [''], //industry: [''],
seasonality: ['', Validators.compose([Validators.required])], seasonality: ['', Validators.compose([Validators.required])],
export_sale_of_total_sales:[], export_sale_of_total_sales:[''],
//month_of_business_run : [''], //month_of_business_run : [''],
// peak_period_of_business : [''], // peak_period_of_business : [''],
//designation: this.fb.array([]), //designation: this.fb.array([]),
@ -584,6 +587,7 @@ export class BusinessInfoComponent implements OnInit {
employees_total: ['', Validators.compose([Validators.required])], employees_total: ['', Validators.compose([Validators.required])],
employees_permanent: ['', Validators.compose([Validators.required])], employees_permanent: ['', Validators.compose([Validators.required])],
employees_temporary: ['', Validators.compose([Validators.required])], employees_temporary: ['', Validators.compose([Validators.required])],
employees_appx_salary:['', Validators.compose([Validators.required])],
officer_total: ['', Validators.compose([Validators.required])], officer_total: ['', Validators.compose([Validators.required])],
// officer_permanent: ['', Validators.compose([Validators.required])], // officer_permanent: ['', Validators.compose([Validators.required])],
// officer_temporary: ['', Validators.compose([Validators.required])], // officer_temporary: ['', Validators.compose([Validators.required])],
@ -687,14 +691,12 @@ export class BusinessInfoComponent implements OnInit {
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required)); control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([])); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
} }
else if(getDetails.value.area_of_sale=="Export"){ else if(getDetails.value.area_of_sale=="Export"){
control.controls[getIndex].removeControl('countries_where_export_done'); control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].removeControl('pan_india_options'); control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name'); control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
} }
else if(getDetails.value.area_of_sale=="Both") { else if(getDetails.value.area_of_sale=="Both") {
@ -789,7 +791,6 @@ export class BusinessInfoComponent implements OnInit {
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required)); control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([])); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
} }
else if(getDetails.value.area_of_sale=="Export"){ else if(getDetails.value.area_of_sale=="Export"){
control.controls[getIndex].removeControl('countries_where_export_done'); control.controls[getIndex].removeControl('countries_where_export_done');
@ -1337,12 +1338,11 @@ export class BusinessInfoComponent implements OnInit {
control2.controls['total_business_experiance'].clearValidators(); control2.controls['total_business_experiance'].clearValidators();
control2.controls['total_business_experiance'].updateValueAndValidity(); control2.controls['total_business_experiance'].updateValueAndValidity();
control2.controls['total_business_experiance'].setValue(''); control2.controls['total_business_experiance'].setValue('');
// if(control2.controls['total_business_previous_experience'].value !=undefined){
control2.controls['total_business_previous_experience'].clearValidators(); // control2.controls['total_business_previous_experience'].clearValidators();
control2.controls['total_business_previous_experience'].updateValueAndValidity(); // control2.controls['total_business_previous_experience'].updateValueAndValidity();
control2.controls['total_business_previous_experience'].setValue('0'); // control2.controls['total_business_previous_experience'].setValue('0');
// }
} }
@ -1575,7 +1575,7 @@ export class BusinessInfoComponent implements OnInit {
} }
checkWithExistBusinessYear(e,i,members){ checkWithExistBusinessYear(e,i,members){
if(e > this.generalExistBusinessYear){ if(+e > this.generalExistBusinessYear){
this.errorMessage[i] = "Higher than Business Vintage"; this.errorMessage[i] = "Higher than Business Vintage";
members.controls.current_business_experiance_year.setValue(''); members.controls.current_business_experiance_year.setValue('');
} }
@ -1584,4 +1584,76 @@ export class BusinessInfoComponent implements OnInit {
} }
} }
checkWithExistTotalWorkExperience(e,i,members){
if(+members.value.current_business_experiance_year > +e){
this.errorMessageForExistTotalWorkExperience[i] = "Total Experience is Lower Than Experience in The Current Company";
members.controls.total_business_experiance.setValue('');
}
else{
this.errorMessageForExistTotalWorkExperience[i] = '';
}
}
// flag: number = 0;
// CheckExport(e,val){
// console.log(e);
// console.log(val);
// console.log(this.)
// if(val == 1){
// e != "Within India" ?
// this.flag++ :this.flag--;
// }
// if(val == 2){
// e != "Within India" ?
// this.flag++ :this.flag--;
// }
// if(val == 3){
// e != "Within India" ?
// this.flag++ :this.flag--;
// }
// if(val == 4){
// e != "Within India" ?
// this.flag++ :this.flag--;
// }
// if(this.flag > 0){
// this.ExportFlag = true;
// }
// }
CheckExport(e,val){
console.log(e);
console.log(val);
let flag: number = 0;
if(val == 1){
e != "Within India" ?
flag++ :flag--;
}
if(val == 2){
e != "Within India" ?
flag++ :flag--;
}
if(val == 3){
e != "Within India" ?
flag++ :flag--;
}
if(val == 4){
e != "Within India" ?
flag++ :flag--;
}
if(flag > 0){
this.ExportFlag = true;
}
}
inWords(e,flag){
switch(flag){
case 1 :
this.appxSalaryAmtInwords = this._pd.convertNumberToWords(e.target.value);
break;
}
}
} }

View File

@ -47,19 +47,25 @@
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id"> <mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}} {{comrelShip.name}}
</mat-option> </mat-option>
<mat-option value="1" > Not Applicable </mat-option> <!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number"> <input matInput placeholder="Client Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 15%"> <mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp; </mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -68,8 +74,17 @@
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%" *ngIf="items.get('manufacturing_payment_type').value == 3"> <!-- <mat-form-field style="width: 45%" *ngIf="items.get('manufacturing_payment_type').value == 3">
<input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="manufacturing_credit_days"> <input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="manufacturing_credit_days">
</mat-form-field> -->
</div>
<div fxLayout="row nowrap" *ngIf="items.get('manufacturing_payment_type').value == 3">
<mat-label>No. of Days of Credit Given for Payment Receipt</mat-label>
<mat-form-field style="width: 45%" >
<input matInput placeholder="Days From" formControlName="manufacturing_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 45%" >
<input matInput placeholder="Days To" formControlName="manufacturing_credit_days_to" type="number">
</mat-form-field> </mat-form-field>
</div> </div>
<div align="end"> <div align="end">
@ -134,19 +149,25 @@
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id"> <mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}} {{comrelShip.name}}
</mat-option> </mat-option>
<mat-option value="1" > Not Applicable </mat-option> <!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number" (keypress)="keyPress($event)"> <input matInput placeholder="Client Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number" (keypress)="keyPress($event)">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 15%"> <mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp; </mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -156,8 +177,17 @@
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%" *ngIf="items.get('trade_product_payment_type').value == 3"> <!-- <mat-form-field style="width: 45%" *ngIf="items.get('trade_product_payment_type').value == 3">
<input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="trade_product_credit_days"> <input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="trade_product_credit_days">
</mat-form-field> -->
</div>
<div fxLayout="row nowrap" *ngIf="items.get('trade_product_payment_type').value == 3">
<mat-label>No. of Days of Credit Given for Payment Receipt </mat-label>
<mat-form-field style="width: 45%" >
<input matInput placeholder="Days From" formControlName="trade_product_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 45%" >
<input matInput placeholder="Days To" formControlName="trade_product_credit_days_to" type="number">
</mat-form-field> </mat-form-field>
</div> </div>
<div align="end"> <div align="end">
@ -222,19 +252,25 @@
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id"> <mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}} {{comrelShip.name}}
</mat-option> </mat-option>
<mat-option value="1" > Not Applicable </mat-option> <!-- <mat-option value="1" > Not Applicable </mat-option> -->
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%" *ngIf="items.get('person_designation').value == 1">
<input matInput placeholder="Specify Person Designation" formControlName="other_person_designation">
</mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Mobile Number" formControlName="service_provider_product_contact_person_mobile_number"> <input matInput placeholder="Client Contact Person Mobile Number" formControlName="service_provider_product_contact_person_mobile_number">
<mat-error>Enter Valid Mobile Number.</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 15%"> <mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)">
<mat-error>Enter Valid STD Code Number.</mat-error>
</mat-form-field> &nbsp; - &nbsp; </mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)">
<mat-error>Enter Valid LandLine Number.</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -243,8 +279,17 @@
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%" *ngIf="items.get('service_provider_product_payment_type').value == 3"> <!-- <mat-form-field style="width: 45%" *ngIf="items.get('service_provider_product_payment_type').value == 3">
<input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="service_provider_product_credit_days"> <input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="service_provider_product_credit_days">
</mat-form-field> -->
</div>
<div fxLayout="row nowrap" *ngIf="items.get('service_provider_product_payment_type').value == 3">
<mat-label>No. of Days of Credit Given for Payment Receipt </mat-label>
<mat-form-field style="width: 45%" >
<input matInput placeholder="Days From" formControlName="service_provider_product_credit_days_from" type="number">
</mat-form-field>
<mat-form-field style="width: 45%" >
<input matInput placeholder="Days To" formControlName="service_provider_product_credit_days_to" type="number">
</mat-form-field> </mat-form-field>
</div> </div>
<div align="end"> <div align="end">

View File

@ -357,6 +357,7 @@ export class ClientInfoComponent implements OnInit {
person_designation:[''], person_designation:[''],
person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[''],
}) })
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
@ -370,6 +371,7 @@ export class ClientInfoComponent implements OnInit {
person_designation:[records.person_designation || null], person_designation:[records.person_designation || null],
person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[records.other_person_designation || null],
}) })
} }
} }
@ -394,11 +396,13 @@ export class ClientInfoComponent implements OnInit {
trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
trade_product_payment_type: [''], trade_product_payment_type: [''],
trade_product_frequency_of_purchase: [''], trade_product_frequency_of_purchase: [''],
trade_product_credit_days: [''], trade_product_credit_days_from: [''],
trade_product_credit_days_to: [''],
person_title_name:[''], person_title_name:[''],
person_designation:[''], person_designation:[''],
person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[''],
}) })
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
@ -408,11 +412,13 @@ export class ClientInfoComponent implements OnInit {
trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
trade_product_payment_type: [records.trade_product_payment_type], trade_product_payment_type: [records.trade_product_payment_type],
trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase], trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase],
trade_product_credit_days: [records.trade_product_credit_days], trade_product_credit_days_from: [records.trade_product_credit_days_from],
trade_product_credit_days_to: [records.trade_product_credit_days_to],
person_title_name:[records.person_title_name || null], person_title_name:[records.person_title_name || null],
person_designation:[records.person_designation || null], person_designation:[records.person_designation || null],
person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[records.other_person_designation || null],
}) })
} }
} }
@ -437,11 +443,13 @@ export class ClientInfoComponent implements OnInit {
service_provider_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], service_provider_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
service_provider_product_payment_type: [''], service_provider_product_payment_type: [''],
service_provider_product_frequency_of_purchase: [''], service_provider_product_frequency_of_purchase: [''],
service_provider_product_credit_days: [''], service_provider_product_credit_days_from: [''],
service_provider_product_credit_days_to: [''],
person_title_name:[''], person_title_name:[''],
person_designation:[''], person_designation:[''],
person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[''],
}) })
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
@ -451,11 +459,13 @@ export class ClientInfoComponent implements OnInit {
service_provider_product_contact_person_mobile_number: [records.service_provider_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], service_provider_product_contact_person_mobile_number: [records.service_provider_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
service_provider_product_payment_type: [records.service_provider_product_payment_type], service_provider_product_payment_type: [records.service_provider_product_payment_type],
service_provider_product_frequency_of_purchase: [records.service_provider_product_frequency_of_purchase], service_provider_product_frequency_of_purchase: [records.service_provider_product_frequency_of_purchase],
service_provider_product_credit_days: [records.service_provider_product_credit_days], service_provider_product_credit_days_from: [records.service_provider_product_credit_days_from],
service_provider_product_credit_days_to: [records.service_provider_product_credit_days_to],
person_title_name:[records.person_title_name || null], person_title_name:[records.person_title_name || null],
person_designation:[records.person_designation || null], person_designation:[records.person_designation || null],
person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
other_person_designation:[records.other_person_designation || null],
}) })
} }
} }
@ -529,8 +539,7 @@ export class ClientInfoComponent implements OnInit {
data => { data => {
if (data.dataStatus) { if (data.dataStatus) {
if(type==1){ if(type==1){
this.companyRelationShipList=data.records.filter(item => item.name != 'Others'); this.companyRelationShipList=data.records;// .filter(item => item.name != 'Others');
} }
if(type==2){ if(type==2){
this.titleList=data.records.filter(val=>val.isactive==1); this.titleList=data.records.filter(val=>val.isactive==1);

View File

@ -22,13 +22,16 @@
<input matInput placeholder="Name" formControlName="applicant_name" type="text" required> <input matInput placeholder="Name" formControlName="applicant_name" type="text" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> <mat-form-field style="width: 30%">
<input matInput placeholder="age" formControlName="age" minlength="1" maxlength="3" (keypress)="keyPress($event)" autocomplete="off"> <input matInput placeholder="Age" formControlName="age" minlength="1" maxlength="3" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 60%"> <mat-form-field style="width: 60%">
<mat-select placeholder="Qualification" formControlName="qualification" style="width: 75%;"> <mat-select placeholder="Qualification" formControlName="qualification" style="width: 75%;">
<mat-option *ngFor="let qual of qualificationList" [value]="qual.qualification_id">{{qual.qualification_name}}</mat-option> <mat-option *ngFor="let qual of qualificationList" [value]="qual.qualification_id">{{qual.qualification_name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 60%" [style.visibility]="applicant.get('qualification').value == '' ? 'hidden':'visible'">
<input matInput placeholder="Specify Qualification" formControlName="course_name" autocomplete="off">
</mat-form-field>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex.xs="100%" fxFlex.sm="100%" fxFlex="45%"> <div fxFlex.xs="100%" fxFlex.sm="100%" fxFlex="45%">
@ -50,7 +53,7 @@
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions align="end"> <mat-dialog-actions align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More" matTooltipPosition="above" (click)="addMoreApplicant()"><mat-icon>add</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More" matTooltipPosition="above" (click)="addMoreApplicant()" *ngIf="!EditFlag" ><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="saveApplicant(_OtherForm.value)"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Save" matTooltipPosition="above" (click)="saveApplicant(_OtherForm.value)"><mat-icon>save</mat-icon></button>
</mat-dialog-actions> </mat-dialog-actions>

View File

@ -2,6 +2,7 @@ import { Component, OnInit, Input, Output, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material';
import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service';
import { bool } from 'aws-sdk/clients/signer';
@Component({ @Component({
selector: 'app-other-applicant-details', selector: 'app-other-applicant-details',
@ -11,14 +12,33 @@ import { PdTrigerService } from './../../../../../../pd-service/pd-triger.servic
export class OtherApplicantDetailsComponent implements OnInit { export class OtherApplicantDetailsComponent implements OnInit {
pageTitle: string ="Add Name of Person(s) Met and Individual Loan Applicant(s) "; pageTitle: string ="Add Name of Person(s) Met and Individual Loan Applicant(s) ";
public _OtherForm: FormGroup; public _OtherForm: FormGroup;
applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false, applicant_title_name:'',age:'', qualification:''}; applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false, applicant_title_name:'',age:'', qualification:'',course_name:''};
titleList: any=[]; titleList: any=[];
qualificationList: any=[]; qualificationList: any=[];
EditGeneralFormData: any=[];
EditFlag: boolean = false;
constructor(private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<OtherApplicantDetailsComponent>) { } constructor(private _fb: FormBuilder,
private _pd: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public generalFormData : any,
private dialogRef: MatDialogRef<OtherApplicantDetailsComponent>) {
if(generalFormData != ''){
this.EditGeneralFormData = generalFormData.value;
this.EditFlag = true;
}
console.log(this.EditGeneralFormData);
}
ngOnInit() { ngOnInit() {
this.initFormDetails();
if(!this.EditFlag){
console.log('init if',this.EditGeneralFormData);
this.initFormDetails(null);
}
else{
console.log('init else',this.EditGeneralFormData);
this.initFormDetails(this.EditGeneralFormData);
}
this.getMasterDetails('TITLES',1); this.getMasterDetails('TITLES',1);
this.getMasterDetails('EDUQUALIFICATION',2); this.getMasterDetails('EDUQUALIFICATION',2);
} }
@ -39,14 +59,25 @@ export class OtherApplicantDetailsComponent implements OnInit {
} }
// init form // init form
initFormDetails() { initFormDetails(data : any) {
console.log('data',data);
if(data == null){
console.log('if data',data);
this._OtherForm = this._fb.group({ this._OtherForm = this._fb.group({
applicant_list: this._fb.array([this.createApplicant(this.applicantInfo)]), applicant_list: this._fb.array([this.createApplicant(this.applicantInfo)]),
}); });
} }
else{
console.log('else data',data);
this._OtherForm = this._fb.group({
applicant_list: this._fb.array([this.updateApplicant(this.EditGeneralFormData)]),
});
}
}
// create applicant form array // create applicant form array
createApplicant(elementValue:any){ createApplicant(elementValue:any){
console.log("create applicants",elementValue);
return this._fb.group({ return this._fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id], pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_title_name: [elementValue.applicant_title_name, Validators.required], applicant_title_name: [elementValue.applicant_title_name, Validators.required],
@ -54,7 +85,22 @@ createApplicant(elementValue:any){
is_applicant:[false], is_applicant:[false],
is_person_met:[false], is_person_met:[false],
age:[''], age:[''],
qualification: [''] qualification: [''],
course_name:['']
});
}
updateApplicant(elementValue:any){
console.log("update applicants",elementValue);
return this._fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_title_name: [elementValue.applicant_title_name, Validators.required],
applicant_name:[elementValue.applicant_name,Validators.required],
is_applicant:[elementValue.is_applicant ? true : false],
is_person_met:[elementValue.is_person_met ? true : false],
age:[elementValue.age || ''],
qualification: [elementValue.qualification || ''],
course_name:[elementValue.course_name || '']
}); });
} }

View File

@ -73,7 +73,7 @@
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:60%"> <mat-form-field style="width:60%">
<input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" formControlName="financial_annualsales_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" formControlName="financial_annualsales_variation" (keypress)="keyPress($event)" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annualsales_variation').value != '' " > <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annualsales_variation').value != '' " >
<span *ngIf="details.get('financial_annualsales_variation').value == 0"> <span *ngIf="details.get('financial_annualsales_variation').value == 0">
No difference in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> No difference in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i>
@ -105,7 +105,7 @@
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_profit').value != ''">{{"&#8377;"}} {{FY_netProfitAmtInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_profit').value != ''">{{"&#8377;"}} {{FY_netProfitAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:28%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Profit to Sales in %" formControlName="financial_margin_of_profit" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Net Profit to Sales in %" formControlName="financial_margin_of_profit" (keypress)="keyPress($event)" readonly>
</mat-form-field> </mat-form-field>
</span> </span>
@ -115,14 +115,14 @@
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_loss').value != ''">{{"&#8377;"}} {{FY_netLossAmtInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_loss').value != ''">{{"&#8377;"}} {{FY_netLossAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:28%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Loss to Sales in %" formControlName="financial_margin_of_loss" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Net Loss to Sales in %" formControlName="financial_margin_of_loss" (keypress)="keyPress($event)" reaonly>
</mat-form-field> </mat-form-field>
</span> </span>
</div> </div>
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Profit Variation from Previous Year in %" formControlName="financial_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Profit Variation from Previous Year in %" formControlName="financial_variation" (keypress)="keyPress($event)" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" > <mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" >
<span *ngIf="details.get('financial_variation').value == 0"> <span *ngIf="details.get('financial_variation').value == 0">
No difference in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> No difference in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i>
@ -140,7 +140,7 @@
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" placeholder="Variation of Profit % over sales" formControlName="financial_profit_to_sale_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" placeholder="Variation of Profit % over sales" formControlName="financial_profit_to_sale_variation" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_profit_to_sale_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" > <mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_profit_to_sale_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" readonly>
<span *ngIf="details.get('financial_profit_to_sale_variation').value == 0"> <span *ngIf="details.get('financial_profit_to_sale_variation').value == 0">
No difference in Profit sales % in FY <i> {{details.get('financial_year').value}} </i> over Profit sales % in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> No difference in Profit sales % in FY <i> {{details.get('financial_year').value}} </i> over Profit sales % in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i>
</span> </span>
@ -206,7 +206,7 @@
</mat-form-field> </mat-form-field>
<!-- <span style="width:10%;padding-left:2%"><p>Average</p></span> --> <!-- <span style="width:10%;padding-left:2%"><p>Average</p></span> -->
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Sales Average" formControlName="estimate_sales_average"> <input matInput autocomplete="off" placeholder="Considered Sales Average" formControlName="estimate_sales_average" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_average').value != ''">{{"&#8377;"}} {{AV_SalesInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_average').value != ''">{{"&#8377;"}} {{AV_SalesInwords[i]}} Only</mat-hint>
<!-- //{{"&#8377;"}} {{AV_SalesInwords[i]}} Only --> <!-- //{{"&#8377;"}} {{AV_SalesInwords[i]}} Only -->
</mat-form-field> </mat-form-field>
@ -241,13 +241,13 @@
</mat-form-field> --> </mat-form-field> -->
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'yes' "> <div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'yes' ">
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Profit From" formControlName="estimate_profit_range_from" type="number" (change)="calculateMarginProfit( i, details);"> <input matInput autocomplete="off" placeholder="Net Profit From" formControlName="estimate_profit_range_from" type="number" (change)="calculateMarginProfit( i, details);" readonly>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Profit To" formControlName="estimate_profit_range_to" type="number" (change)="calculateMarginProfit( i, details);"> <input matInput autocomplete="off" placeholder="Net Profit To" formControlName="estimate_profit_range_to" type="number" (change)="calculateMarginProfit( i, details);" readonly>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Margin Profit %" formControlName="estimate_profit_margin_percent" type="number"> <input matInput autocomplete="off" placeholder="Considered Margin Profit %" formControlName="estimate_profit_margin_percent" type="number" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_profit_margin').value != ''"> {{"&#8377;"}} {{AV_marginProfitAmtInwords[i]}} Only ( {{"&#8377;"}} {{details.get('estimate_profit_margin').value}} ) </mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_profit_margin').value != ''"> {{"&#8377;"}} {{AV_marginProfitAmtInwords[i]}} Only ( {{"&#8377;"}} {{details.get('estimate_profit_margin').value}} ) </mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -261,7 +261,7 @@
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_to').value != ''">{{"&#8377;"}} {{AV_netProfitAmtToInwords[i]}} Only </mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_to').value != ''">{{"&#8377;"}} {{AV_netProfitAmtToInwords[i]}} Only </mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Profit Amount" formControlName="estimate_net_profit" type="number"> <input matInput autocomplete="off" placeholder="Considered Profit Amount" formControlName="estimate_net_profit" type="number" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit').value != ''">{{"&#8377;"}} {{AV_netProfitAmtInwords[i]}} Only ( {{details.get('estimate_net_profit_percent').value }} % )</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit').value != ''">{{"&#8377;"}} {{AV_netProfitAmtInwords[i]}} Only ( {{details.get('estimate_net_profit_percent').value }} % )</mat-hint>
<!-- // --> <!-- // -->
</mat-form-field> </mat-form-field>
@ -278,7 +278,7 @@
<input matInput autocomplete="off" placeholder="Net Loss To" formControlName="estimate_loss_range_to" type="number" (change)="calculateMarginLoss( i, details);"> <input matInput autocomplete="off" placeholder="Net Loss To" formControlName="estimate_loss_range_to" type="number" (change)="calculateMarginLoss( i, details);">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Margin Loss %" formControlName="estimate_loss_margin_percent" type="number"> <input matInput autocomplete="off" placeholder="Considered Margin Loss %" formControlName="estimate_loss_margin_percent" type="number" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_loss_margin').value != ''">{{"&#8377;"}} {{AV_marginLossAmtInwords[i]}} Only ( {{"&#8377;"}} {{details.get('estimate_loss_margin').value}} ) </mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_loss_margin').value != ''">{{"&#8377;"}} {{AV_marginLossAmtInwords[i]}} Only ( {{"&#8377;"}} {{details.get('estimate_loss_margin').value}} ) </mat-hint>
<!-- // --> <!-- // -->
</mat-form-field> </mat-form-field>
@ -293,7 +293,7 @@
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss_to').value != ''">{{"&#8377;"}} {{AV_netLossAmtToInwords[i]}} Only </mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss_to').value != ''">{{"&#8377;"}} {{AV_netLossAmtToInwords[i]}} Only </mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Loss Amount" formControlName="estimate_net_loss" type="number"> <input matInput autocomplete="off" placeholder="Considered Loss Amount" formControlName="estimate_net_loss" type="number" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss').value != ''">{{"&#8377;"}} {{AV_netLossAmtInwords[i]}} Only ( {{details.get('estimate_net_loss_percent').value }} % )</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss').value != ''">{{"&#8377;"}} {{AV_netLossAmtInwords[i]}} Only ( {{details.get('estimate_net_loss_percent').value }} % )</mat-hint>
<!-- // --> <!-- // -->
</mat-form-field> </mat-form-field>

View File

@ -205,6 +205,9 @@ export class FinancialInfoComponent implements OnInit {
// } // }
/** CREATING financial Statement ( financial_year AutoGenerate ) */ /** CREATING financial Statement ( financial_year AutoGenerate ) */
createDate(date) { createDate(date) {
return this.fb.group({ return this.fb.group({
@ -436,9 +439,15 @@ export class FinancialInfoComponent implements OnInit {
let profit = detail.value.financial_net_profit; let profit = detail.value.financial_net_profit;
let loss = detail.value.financial_net_loss; let loss = detail.value.financial_net_loss;
let salary = detail.value.financial_annual_sale;
console.log('current profit',profit); console.log('current profit',profit);
console.log('current loss',loss); console.log('current loss',loss);
if ( (profit != '' || loss != '') && index != 0) { if ( (profit != '' || loss != '') && index != 0) {
if(+profit > +salary){
detail.controls.financial_margin_of_profit.setValue('');
}
else{
let array = <FormArray>this.financialForm.controls['date_per_financial']; let array = <FormArray>this.financialForm.controls['date_per_financial'];
@ -456,7 +465,7 @@ export class FinancialInfoComponent implements OnInit {
let variation = (((profit != '' ? profit : loss ) - (prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100; let variation = (((profit != '' ? profit : loss ) - (prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100;
detail.controls.financial_variation.setValue(variation.toFixed(2)); detail.controls.financial_variation.setValue(variation.toFixed(2));
}
} }
} }
@ -477,7 +486,7 @@ export class FinancialInfoComponent implements OnInit {
* And calculating Variation over sales * And calculating Variation over sales
*/ */
calMargin(index, detail) { calMargin(index, detail) {
// In financial details section please add the following validation: Net profit/loss can not be > sales.
let salary = detail.value.financial_annual_sale; let salary = detail.value.financial_annual_sale;
let profit_margin; let profit_margin;
let loss_margin; let loss_margin;
@ -490,13 +499,17 @@ export class FinancialInfoComponent implements OnInit {
let profit = detail.value.financial_net_profit; let profit = detail.value.financial_net_profit;
if (salary != '' && profit != '') { if (salary != '' && profit != '') {
// if(salary < profit){ if(+profit>+salary){
// detail.controls.financial_margin_of_profit.setValue(''); alert("profit is greater than salary");
// } detail.controls.financial_net_profit.setValue('');
// else{ detail.controls.financial_margin_of_profit.setValue('');
detail.controls.financial_profit_to_sale_variation.setValue('');
detail.controls.financial_variation.setValue('');
}
else{
profit_margin = (profit / salary) * 100; profit_margin = (profit / salary) * 100;
detail.controls.financial_margin_of_profit.setValue(profit_margin.toFixed(2)); detail.controls.financial_margin_of_profit.setValue(profit_margin.toFixed(2));
// } }
} }
} }
@ -506,16 +519,23 @@ export class FinancialInfoComponent implements OnInit {
let loss = detail.value.financial_net_loss; let loss = detail.value.financial_net_loss;
if (salary != '' && loss != '') { if (salary != '' && loss != '') {
if(+loss>+salary){
alert("Loss is greater than salary");
detail.controls.financial_net_loss.setValue('');
detail.controls.financial_margin_of_loss.setValue('');
detail.controls.financial_profit_to_sale_variation.setValue('');
detail.controls.financial_variation.setValue('');
}
else{
loss_margin = (loss / salary) * 100 * (-1); loss_margin = (loss / salary) * 100 * (-1);
detail.controls.financial_margin_of_loss.setValue(loss_margin.toFixed(2)); detail.controls.financial_margin_of_loss.setValue(loss_margin.toFixed(2));
// detail.controls.financial_margin.disable() // detail.controls.financial_margin.disable()
}
} }
} }
if ((profit_margin != '' || loss_margin != '') && index != 0) { if (((profit_margin != '' || profit_margin !== undefined) || (loss_margin != '' || loss_margin !== undefined) ) && index != 0) {
console.log('Current profit_margin',profit_margin); console.log('Current profit_margin',profit_margin);

View File

@ -52,10 +52,23 @@
</mat-select> </mat-select>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="qualification_reason"> <ng-container matColumnDef="course_name">
<mat-header-cell *matHeaderCellDef> </mat-header-cell> <mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.individuals.value[i].qualification == '' ? 'hidden':'visible'"> <mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.individuals.value[i].qualification == '' ? 'hidden':'visible'">
<input matInput [placeholder]="_generalForm.controls.individuals.value[i].qualification == 1 ? 'Specify Qualification ': 'Qualification Reason'" formControlName="qualification_reason" autocomplete="off"> <input matInput placeholder="Specify Qualification" formControlName="course_name" autocomplete="off">
</mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let details;let i =index;">
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="editIndividuals(details)"
matTooltip="Edit " matTooltipPosition="below">
<mat-icon>edit</mat-icon>
</button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeIndividuals(i)"
matTooltip="Remove Individuals" matTooltipPosition="below">
<mat-icon>delete</mat-icon>
</button>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>

View File

@ -24,7 +24,7 @@ export class GeneralInfoComponent implements OnInit {
count : number = 1; count : number = 1;
private notifier: NotifierService; private notifier: NotifierService;
public _generalForm: FormGroup; public _generalForm: FormGroup;
displayedColumns = ['applicant_name','is_person_met','is_applicant','age','qualification','qualification_reason']; displayedColumns = ['applicant_name','is_person_met','is_applicant','age','qualification','course_name','actions'];
public individualsSource= new MatTableDataSource(); public individualsSource= new MatTableDataSource();
public relationSource= new MatTableDataSource(); public relationSource= new MatTableDataSource();
public CompanySource = new MatTableDataSource(); public CompanySource = new MatTableDataSource();
@ -231,7 +231,7 @@ export class GeneralInfoComponent implements OnInit {
element.individuals_order_id = key+1; element.individuals_order_id = key+1;
element.age = '', element.age = '',
element.qualification = '', element.qualification = '',
element.qualification_reason = '', element.course_name = '',
individualsControl.push(this.createIndividulas(element)); individualsControl.push(this.createIndividulas(element));
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element)); personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element));
//let relationControl = <FormArray>this._generalForm.controls['applicant_relation']; //let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
@ -270,7 +270,7 @@ export class GeneralInfoComponent implements OnInit {
individuals_order_id: [elementValue.individuals_order_id], individuals_order_id: [elementValue.individuals_order_id],
age: [elementValue.age], age: [elementValue.age],
qualification: [elementValue.qualification], qualification: [elementValue.qualification],
qualification_reason:[elementValue.qualification_reason] course_name:[elementValue.course_name]
}); });
} }
createPersonsWithRelationships(elementValue:any){ createPersonsWithRelationships(elementValue:any){
@ -349,7 +349,6 @@ export class GeneralInfoComponent implements OnInit {
// remove companies // remove companies
removeCompanies(indexValues) { removeCompanies(indexValues) {
this.count = this.count-1; this.count = this.count-1;
// console.log('removed Count',this.count);
let control: any = this._generalForm.get('companies') as FormArray; let control: any = this._generalForm.get('companies') as FormArray;
control.controls[indexValues].controls.is_active.setValue(false); control.controls[indexValues].controls.is_active.setValue(false);
control.controls[indexValues].controls.company_name.clearValidators(); control.controls[indexValues].controls.company_name.clearValidators();
@ -449,13 +448,6 @@ export class GeneralInfoComponent implements OnInit {
let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'relationship':'','relation_to':'','individuals_order_id':element.individuals_order_id}; let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'relationship':'','relation_to':'','individuals_order_id':element.individuals_order_id};
relationControl.push(this.createPersonsWithRelationships(applicant_details)); relationControl.push(this.createPersonsWithRelationships(applicant_details));
// let relationControl2 = <FormArray>this._generalForm.controls['applicant_relation'];
// let applicant_details2: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','other_relation':'','company_name':'','company_relation':'','company_other_relation':'','individuals_order_id':element.individuals_order_id};
// relationControl2.push(this.createApplicantRelation(applicant_details2));
// let mulRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
// mulRelationControl.push(this.createMultipleRelation(applicant_details))
// let mulCmyRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
// mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
}); });
} }
@ -463,8 +455,24 @@ export class GeneralInfoComponent implements OnInit {
} }
/** Popup for EDIT Individuals */
editIndividuals(arr) {
console.log(arr);
const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, {
data: arr,
width:'40%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
});
}
// remove individuals // remove individuals
removeIndividuals(findex,order_id){ removeIndividuals(findex){
let control = <FormArray>this._generalForm.controls['individuals']; let control = <FormArray>this._generalForm.controls['individuals'];
control.removeAt(findex); control.removeAt(findex);
} }

View File

@ -67,9 +67,22 @@
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 28%">
<input matInput placeholder="End Use of Top Up" formControlName="end_use_topup" autocomplete="off"> <mat-form-field style="width:64%" *ngIf="loanDetailsForm.controls['topup_amount'].value > 0 " >
</mat-form-field> --> <mat-select placeholder="What is the End Use of the Top Up?"
formControlName="end_use_topup" >
<mat-option value=2>Business Use.</mat-option>
<mat-option value=3>Childs Marriage.</mat-option>
<mat-option value=4>Furniture & Finishing of House Property.</mat-option>
<mat-option value=5>Medical Expenses.</mat-option>
<mat-option value=6>Paying Off Existing Loans.</mat-option>
<mat-option value=1>Others.</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['end_use_topup'].value == 1" style="width: 28%">
<input matInput placeholder="Specify End Use of Top Up" formControlName="other_end_use_topup" autocomplete="off">
</mat-form-field>
</span> </span>
<span *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' "> <span *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' ">

View File

@ -138,13 +138,16 @@ export class LoanDetailsComponent implements OnInit {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
}); });
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:[{id:0,name:'Not Yet Finalised',group_id:2}]})
} }
let modifyApplicantList: any=[]; let modifyApplicantList: any=[];
if(this.applicants.length > 0){ if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => { modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2}; return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
}); });
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList}) this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
// this.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1); // this.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1);
} }
}) })
@ -204,9 +207,14 @@ export class LoanDetailsComponent implements OnInit {
if (value.records.topup_amount) { if (value.records.topup_amount) {
this.loanDetailsForm.controls['topup_amount'].setValue(value.records.topup_amount); this.loanDetailsForm.controls['topup_amount'].setValue(value.records.topup_amount);
this.topUpAmtInWords = this._pd.convertNumberToWords(value.records.topup_amount); this.topUpAmtInWords = this._pd.convertNumberToWords(value.records.topup_amount);
if(value.records.topup_amount > 0){
this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup);
if (value.records.end_use_topup == 1) {
this.loanDetailsForm.controls['other_end_use_topup'].setValue(value.records.other_end_use_topup);
}
}
} }
// this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup);
if (value.records.lender) { if (value.records.lender) {
this.loanDetailsForm.controls['lender'].setValue(value.records.lender); this.loanDetailsForm.controls['lender'].setValue(value.records.lender);
@ -359,7 +367,8 @@ getM_sourceofamount() {
} }
} }
}); });
this.m_mortageTypeProperty
// mortage_property_id">{{ typeprop.property_name
console.log(this.m_mortageTypeProperty); console.log(this.m_mortageTypeProperty);
} }
}, },
@ -429,7 +438,8 @@ getM_sourceofamount() {
//is_topup: [''], //is_topup: [''],
balance_transfer_amount: [''], balance_transfer_amount: [''],
topup_amount: [''], topup_amount: [''],
// end_use_topup:[''], end_use_topup:[''],
other_end_use_topup:[''],
lender: [''], lender: [''],
other_bt_lender : [''], other_bt_lender : [''],
own_contribution: [''], own_contribution: [''],
@ -565,7 +575,15 @@ getM_sourceofamount() {
// if (this.loanDetailsForm.controls['is_topup'].value == 'yes') { // if (this.loanDetailsForm.controls['is_topup'].value == 'yes') {
records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value; records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value;
// } // }
// records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value;
if(records.topup_amount > 0){
records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value;
if(records.end_use_topup == 1){
records.other_end_use_topup = this.loanDetailsForm.controls['other_end_use_topup'].value;
}
}
if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { //this.loanDetailsForm.controls['is_topup'].value == 'yes' || if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { //this.loanDetailsForm.controls['is_topup'].value == 'yes' ||
records.lender = this.loanDetailsForm.controls['lender'].value; records.lender = this.loanDetailsForm.controls['lender'].value;