changes:ps

This commit is contained in:
venbatechnologies@gmail.com 2019-02-12 14:07:24 +05:30
parent 4edf863ff0
commit 064c70de26
25 changed files with 704 additions and 237 deletions

Binary file not shown.

View File

@ -11,6 +11,9 @@
mat-form-field { mat-form-field {
margin: 0 2%; margin: 0 2%;
}
.mat-form-field-appearance-legacy .mat-hint{
color:rgba(0, 0, 0, 0.8) !important;
} }
::ng-deep .cdk-global-overlay-wrapper{ ::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important; justify-content: center !important;

View File

@ -444,7 +444,7 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="40" align="end"> <div fxFlex="40" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button> <!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div> </div>
</mat-dialog-actions> </mat-dialog-actions>

View File

@ -776,11 +776,11 @@ export class AssetsInfoComponent implements OnInit {
} }
/** To Reset Popup Data */ /** To Reset Popup Data */
onReset() { // onReset() {
const arr = <FormArray>this._assetsQuesFrom.controls.assets_details; // const arr = <FormArray>this._assetsQuesFrom.controls.assets_details;
arr.controls.splice(0); // arr.controls.splice(0);
this.getPdSupplierFormDetails(); // this.getPdSupplierFormDetails();
} // }
/** On Key Press Event For Number only Accepting */ /** On Key Press Event For Number only Accepting */
keyPress(event: any) { keyPress(event: any) {

View File

@ -39,12 +39,12 @@
<mat-form-field> <mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="business_years" (change)="checkWithExistBusinessYear($event.target.value)" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Year(s)" formControlName="business_years" (change)="checkWithExistBusinessYear($event.target.value)" (keypress)="keyPress($event)">
<mat-hint style="color: red;">{{yearErrorMessage}}</mat-hint> <mat-hint style="color: red;">{{yearErrorMessage}}</mat-hint>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_years'].value.valid">Year's Required</mat-error> --> <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_years'].value.valid">Year's Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear($event.target.value)"> <input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear($event.target.value)">
<mat-hint style="color: red;">{{monthErrorMessage}}</mat-hint> <mat-hint style="color: red;">{{monthErrorMessage}}</mat-hint>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_month'].value.valid">Month's Required</mat-error> --> <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_month'].value.valid">Month's Required</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
@ -55,13 +55,13 @@
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_is_pd_visited'].value.valid">Field Required</mat-error> --> <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_is_pd_visited'].value.valid">Field Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf=" _businessAssetsQuesFrom.controls['business_is_pd_visited'].value != ''" style="width: 95%;"> <mat-form-field *ngIf=" _businessAssetsQuesFrom.controls['business_is_pd_visited'].value != ''" style="width: 95%;">
<input matInput autocomplete="off" placeholder="Remarks" formControlName="business_pd_visited_remark"> <input matInput autocomplete="off" placeholder="Remarks" formControlName="business_pd_visited_remark">
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_pd_visited_remark'].value.valid">Field Required</mat-error> --> <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_pd_visited_remark'].value.valid">Field Required</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
@ -73,7 +73,7 @@
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_activity'].value.valid">Field Required</mat-error> --> <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_activity'].value.valid">Field Required</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
@ -88,12 +88,12 @@
<mat-form-field style="width: 42%"> <mat-form-field style="width: 42%">
<mat-select placeholder="Type of Premises" formControlName="premises_type" (selectionChange)="setRequiredValidation($event.value,item,2)"> <mat-select placeholder="Type of Premises" formControlName="premises_type" (selectionChange)="setRequiredValidation($event.value,item,2)">
<mat-option *ngFor="let m_addressType of m_addressType" [value]="m_addressType.address_type_id"> {{m_addressType.address_type}} </mat-option> <mat-option *ngFor="let m_address_type of m_address_type" [value]="m_address_type.address_type_id"> {{m_address_type.address_type}} </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="item.get('premises_type').value == 1" style="width: 42%"> <mat-form-field *ngIf="item.get('premises_type').value == 1" style="width: 42%">
<input matInput placeholder="Specify Premises Type *" formControlName="premises_type_others" autocomplete="off"> <input matInput placeholder="Specify Premises Type *" formControlName="premises_type_others" autocomplete="off">
<!-- <mat-error>Premises Type Required</mat-error> --> <mat-error>Premises Type Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 42%;"> <mat-form-field style="width: 42%;">
<input matInput placeholder="Number Of Additional Units" <input matInput placeholder="Number Of Additional Units"
@ -164,7 +164,7 @@
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<mat-select placeholder="Property Type" formControlName="property_type" > <mat-select placeholder="Property Type" formControlName="property_type" >
<mat-option *ngFor="let m_addressType of m_addressType" [value]="m_addressType.address_type_id"> {{m_addressType.address_type}} </mat-option> <mat-option *ngFor="let m_address_type of m_address_type" [value]="m_address_type.address_type_id"> {{m_address_type.address_type}} </mat-option>
<!-- <mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name | titlecase }}</mat-option> --> <!-- <mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name | titlecase }}</mat-option> -->
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -186,12 +186,7 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<mat-select placeholder="Type of Vehicle" formControlName="vehicle_type" > <mat-select placeholder="Type of Vehicle" formControlName="vehicle_type" >
<mat-option value="2">Car / Jeep</mat-option> <mat-option *ngFor="let asset of m_vehicle_type" [value]="vehicle.vehicle_type_id">{{ vehicle.vehicle_type_name }}</mat-option>
<mat-option value="3">Rickshaw / Tempo</mat-option>
<mat-option value="4">Truck / Bus</mat-option>
<mat-option value="5">Tractor</mat-option>
<mat-option value="6">Two Wheeler</mat-option>
<mat-option value="1">Others (Please Specify)</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%" *ngIf="detail.get('vehicle_type').value == 1"> <mat-form-field style="width:45%" *ngIf="detail.get('vehicle_type').value == 1">
@ -333,7 +328,7 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%" *ngIf="sup.get('business_assets_mode').value != ''"> <mat-form-field style="width:45%" *ngIf="sup.get('business_assets_mode').value != ''">
<mat-select placeholder="Ownership Type" formControlName="business_ownership_type" (selectionChange)="setRequiredValidation($event.value,'',3)"> <mat-select placeholder="Ownership Type" formControlName="business_ownership_type" (selectionChange)="setRequiredValidation($event.value,sup,3)">
<!-- (selectionChange)="selectedPropertyOwnedType($event.value,s,i)" --> <!-- (selectionChange)="selectedPropertyOwnedType($event.value,s,i)" -->
<mat-option value="owned">Owned</mat-option> <mat-option value="owned">Owned</mat-option>
<mat-option value="rented">Rented</mat-option> <mat-option value="rented">Rented</mat-option>
@ -342,8 +337,9 @@
<mat-form-field style="width:45%" *ngIf="(sup.get('business_assets_mode').value != '' && sup.get('business_ownership_type').value == 'rented')"> <mat-form-field style="width:45%" *ngIf="(sup.get('business_assets_mode').value != '' && sup.get('business_ownership_type').value == 'rented')">
<input matInput autocomplete="off" placeholder="Monthly Rent Amount" formControlName="business_monthly_rented_amt" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Monthly Rent Amount" formControlName="business_monthly_rented_amt" (keypress)="keyPress($event)" (keyup)="inWords($event,i,8)">
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_monthly_rented_amt'].valid">Monthly Rent Amount Required</mat-error> --> <mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{RentAmtInwords[i]}} Only</mat-hint>
<mat-error>Monthly Rent Amount Required</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
@ -363,7 +359,7 @@
</mat-option> </mat-option>
</mat-optgroup> </mat-optgroup>
</mat-select> </mat-select>
<!-- <mat-error *ngIf="!_businessAssetsQuesFrom.controls['business_name_of_the_owner'].valid">Asset Owned by Required</mat-error> --> <mat-error>Asset Owned by Required</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="checkOthers(sup.get('business_name_of_the_owner').value)===true" style="width:45%"> <mat-form-field *ngIf="checkOthers(sup.get('business_name_of_the_owner').value)===true" style="width:45%">
@ -534,7 +530,7 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="40" align="end"> <div fxFlex="40" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button> <!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button> -->
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div> </div>
</mat-dialog-actions> </mat-dialog-actions>

View File

@ -40,6 +40,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
// AmtInvestInwords: any = []; // AmtInvestInwords: any = [];
AssetValueInwords: any = []; AssetValueInwords: any = [];
// B_emiAmtInwords: any = []; // B_emiAmtInwords: any = [];
RentAmtInwords:any=[];
public m_propertyType = []; public m_propertyType = [];
PropertyOwnedType : any = []; PropertyOwnedType : any = [];
// public m_investmentType = []; // public m_investmentType = [];
@ -49,7 +50,8 @@ export class BusinessAssetsInfoComponent implements OnInit {
mergeCompanyApplicant: any=[]; mergeCompanyApplicant: any=[];
currentYear:any=new Date().getFullYear(); currentYear:any=new Date().getFullYear();
addressLabel : any; addressLabel : any;
public m_addressType = []; public m_address_type = [];
public m_vehicle_type = [];
CustSegAbbr: any; CustSegAbbr: any;
generalExistBusinessYear:Number; generalExistBusinessYear:Number;
generalExistBusinessMonth:Number; generalExistBusinessMonth:Number;
@ -133,6 +135,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
// this.getM_InvestmentType(); // this.getM_InvestmentType();
// this.getM_FreqOfPurchase(); // this.getM_FreqOfPurchase();
this.getM_Address_Type(); this.getM_Address_Type();
this.getM_Vehicle_Type();
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
@ -144,7 +147,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
this.addressLabel = ''; this.addressLabel = '';
let selectedAddressType = this.m_addressType.filter(element =>element.address_type_id == data.records.address_type)[0]; let selectedAddressType = this.m_address_type.filter(element =>element.address_type_id == data.records.address_type)[0];
let address = data.records.address; let address = data.records.address;
let addressType = data.records.address_type != 1 ? selectedAddressType.address_type : data.records.address_type_others; let addressType = data.records.address_type != 1 ? selectedAddressType.address_type : data.records.address_type_others;
@ -208,19 +211,26 @@ export class BusinessAssetsInfoComponent implements OnInit {
getM_Address_Type() { getM_Address_Type() {
this.pdTrigerService.getAllMasterDatas('ADDRESSTYPE').subscribe( this.pdTrigerService.getAllMasterDatas('ADDRESSTYPE').subscribe(
data => { data => {
this.m_addressType = data.records.filter(data => data.isactive == 1); this.m_address_type = data.records.filter(data => data.isactive == 1);
// console.log(this.m_addressType); // console.log(this.m_address_type);
// if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){ // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){
// // console.log('whole',FilteredAddressType); // // console.log('whole',FilteredAddressType);
// let index1 = this.m_addressType.map(data => data.address_type).indexOf("Residence"); // let index1 = this.m_address_type.map(data => data.address_type).indexOf("Residence");
// this.m_addressType.splice(index1, 1); // this.m_address_type.splice(index1, 1);
// // console.log('FirstOne',FilteredAddressType); // // console.log('FirstOne',FilteredAddressType);
// let index2 = this.m_addressType.map(data => data.address_type).indexOf("Residence cum Office"); // let index2 = this.m_address_type.map(data => data.address_type).indexOf("Residence cum Office");
// this.m_addressType.splice(index2, 1); // this.m_address_type.splice(index2, 1);
// // console.log('SecondOne',FilteredAddressType); // // console.log('SecondOne',FilteredAddressType);
// } // }
// console.log(this.m_addressType); // console.log(this.m_address_type);
})
}
getM_Vehicle_Type(){
this.pdTrigerService.getAllMasterDatas('VEHICLETYPE').subscribe(
data => {
this.m_vehicle_type = data.records.filter(data => data.is_active == 1);
}) })
} }
@ -597,6 +607,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
if (result.length > 0) { if (result.length > 0) {
result.forEach((datas,index) => { result.forEach((datas,index) => {
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value); this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value);
this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt);
}); });
for (let val of result) { for (let val of result) {
@ -807,11 +818,11 @@ export class BusinessAssetsInfoComponent implements OnInit {
} }
/** To Reset Popup Data */ /** To Reset Popup Data */
onReset() { // onReset() {
const arr = <FormArray>this._businessAssetsQuesFrom.controls.business_assets_details; // const arr = <FormArray>this._businessAssetsQuesFrom.controls.business_assets_details;
arr.controls.splice(0); // arr.controls.splice(0);
this.getPdSupplierFormDetails(); // this.getPdSupplierFormDetails();
} // }
/** On Key Press Event For Number only Accepting */ /** On Key Press Event For Number only Accepting */
keyPress(event: any) { keyPress(event: any) {
@ -920,15 +931,15 @@ if(flag == 2){
} }
if(flag == 3){ if(flag == 3){
if(value == 'owned'){ if(value == 'owned'){
this._businessAssetsQuesFrom.controls.business_monthly_rented_amt.clearValidators(); item.controls.business_monthly_rented_amt.clearValidators();
this._businessAssetsQuesFrom.controls.business_name_of_the_owner.setValidators([Validators.required]); item.controls.business_name_of_the_owner.setValidators([Validators.required]);
} }
else{ else{
this._businessAssetsQuesFrom.controls.business_monthly_rented_amt.setValidators([Validators.required]); item.controls.business_monthly_rented_amt.setValidators([Validators.required]);
this._businessAssetsQuesFrom.controls.business_name_of_the_owner.clearValidators(); item.controls.business_name_of_the_owner.clearValidators();
} }
this._businessAssetsQuesFrom.controls.business_monthly_rented_amt.updateValueAndValidity(); item.controls.business_monthly_rented_amt.updateValueAndValidity();
this._businessAssetsQuesFrom.controls.business_name_of_the_owner.updateValueAndValidity(); item.controls.business_name_of_the_owner.updateValueAndValidity();
} }
} }
@ -971,6 +982,9 @@ if(flag == 3){
// case 7 : // case 7 :
// this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); // this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
// break; // break;
case 8:
this.RentAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
default: default:
break; break;
} }

View File

@ -220,7 +220,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);CheckExport($event.value,MActivity,m);" required> <mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeManufacturingAreaSale(manufacturing,m);CheckExport($event.value,'MActivity',m);" 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>
@ -457,7 +457,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);CheckExport($event.value,RActivity,r);" required> <mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeRetailAreaSale(retail,r);CheckExport($event.value,'RActivity',r);" 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>
@ -696,7 +696,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);CheckExport($event.value,WActivity,w);" required> <mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeWholesaleAreaSale(wholesale,w);CheckExport($event.value,'WActivity',w);" 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>
@ -933,7 +933,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);CheckExport($event.value,SPActivity,sp);" required> <mat-select formControlName="area_of_sale" placeholder="Area of Service" (selectionChange)="changeServiceArea(serviceprovider,sp);CheckExport($event.value,'SPActivity',sp);" 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>
@ -1265,10 +1265,6 @@
</mat-card-header> </mat-card-header>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<div fxLayout="row nowrap"> <div fxLayout="row nowrap">
<mat-form-field>
<input matInput placeholder="Total"
formControlName="employees_total" required>
</mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Permanent" (change)="checkTotalEmployee(businessForm)" type="number" <input matInput placeholder="Permanent" (change)="checkTotalEmployee(businessForm)" type="number"
formControlName="employees_permanent" required> formControlName="employees_permanent" required>
@ -1277,6 +1273,10 @@
<input matInput placeholder="Temporary" (change)="checkTotalEmployee(businessForm)" type="number" <input matInput placeholder="Temporary" (change)="checkTotalEmployee(businessForm)" type="number"
formControlName="employees_temporary" required> formControlName="employees_temporary" required>
</mat-form-field> </mat-form-field>
<mat-form-field>
<input matInput placeholder="Total" type="number"
formControlName="employees_total" readonly>
</mat-form-field>
</div> </div>
<mat-form-field style="width:62%"> <mat-form-field style="width:62%">
<input matInput placeholder="Approximate total monthly salary paid to employees" (keyup)="inWords($event,1)" <input matInput placeholder="Approximate total monthly salary paid to employees" (keyup)="inWords($event,1)"

View File

@ -72,6 +72,8 @@ export class BusinessInfoComponent implements OnInit {
generalExistEntityType_other:string; generalExistEntityType_other:string;
generalExistBusinessYear:Number; generalExistBusinessYear:Number;
generalExistBusinessMonth:Number; generalExistBusinessMonth:Number;
//Declaration FOr Validation
yearErrorMessage: any = []; yearErrorMessage: any = [];
monthErrorMessage: any = []; monthErrorMessage: any = [];
errorMessageForExistTotalWorkExperience:any = []; errorMessageForExistTotalWorkExperience:any = [];
@ -79,6 +81,10 @@ export class BusinessInfoComponent implements OnInit {
appxSalaryAmtInwords: any; appxSalaryAmtInwords: any;
isreadonlyyear:any = []; isreadonlyyear:any = [];
isreadonlymonth:any = []; isreadonlymonth:any = [];
ManufacturingChecked: boolean;
RetailedChecked: boolean;
WholeSalesChecked: boolean;
ServiceChecked: boolean;
constructor(notifier: NotifierService, constructor(notifier: NotifierService,
private fb: FormBuilder, private fb: FormBuilder,
@ -604,7 +610,7 @@ export class BusinessInfoComponent implements OnInit {
// peak_period_of_business : [''], // peak_period_of_business : [''],
//designation: this.fb.array([]), //designation: this.fb.array([]),
partners: this.fb.array([]), partners: this.fb.array([]),
employees_total: ['', Validators.compose([Validators.required])], employees_total: [''],
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])], employees_appx_salary:['', Validators.compose([Validators.required])],
@ -640,41 +646,59 @@ export class BusinessInfoComponent implements OnInit {
// businees activity type change event // businees activity type change event
changeBusinessActivity(event: any){ changeBusinessActivity(event: any){
console.log('changeBusinessActivity');
if(event.value.exist_status==true && event.value.type_of_activity_id==2){ if(event.value.exist_status==true && event.value.type_of_activity_id==2){
console.log('changeBusinessActivity 1');
this.ManufacturingChecked = event.value.exist_status;
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details']; let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
manufacturingControl.controls = []; manufacturingControl.controls = [];
manufacturingControl.setValue([]); manufacturingControl.setValue([]);
} }
else if(event.value.exist_status==false && event.value.type_of_activity_id==2){ else if(event.value.exist_status==false && event.value.type_of_activity_id==2){
console.log('changeBusinessActivity 2');
this.ManufacturingChecked = event.value.exist_status;
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details']; let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
manufacturingControl.push(this.createActivity()); manufacturingControl.push(this.createActivity());
} }
if(event.value.exist_status==true && event.value.type_of_activity_id==3){ if(event.value.exist_status==true && event.value.type_of_activity_id==3){
console.log('changeBusinessActivity 3');
this.RetailedChecked = event.value.exist_status;
let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details']; let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
retailControl.controls = []; retailControl.controls = [];
retailControl.setValue([]); retailControl.setValue([]);
} }
else if(event.value.exist_status==false && event.value.type_of_activity_id==3){ else if(event.value.exist_status==false && event.value.type_of_activity_id==3){
console.log('changeBusinessActivity 4');
this.RetailedChecked = event.value.exist_status;
let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details']; let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
retailControl.push(this.createActivity()); retailControl.push(this.createActivity());
} }
if(event.value.exist_status==true && event.value.type_of_activity_id==4){ if(event.value.exist_status==true && event.value.type_of_activity_id==4){
console.log('changeBusinessActivity 5');
this.WholeSalesChecked = event.value.exist_status;
let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details']; let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
wholesaleControl.controls = []; wholesaleControl.controls = [];
wholesaleControl.setValue([]); wholesaleControl.setValue([]);
} }
else if(event.value.exist_status==false && event.value.type_of_activity_id==4){ else if(event.value.exist_status==false && event.value.type_of_activity_id==4){
console.log('changeBusinessActivity 6');
this.WholeSalesChecked = event.value.exist_status;
let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details']; let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
wholesaleControl.push(this.createActivity()); wholesaleControl.push(this.createActivity());
} }
if(event.value.exist_status==true && event.value.type_of_activity_id==5){ if(event.value.exist_status==true && event.value.type_of_activity_id==5){
console.log('changeBusinessActivity 7');
this.ServiceChecked = event.value.exist_status;
let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details']; let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details'];
serviceControl.controls = []; serviceControl.controls = [];
serviceControl.setValue([]); serviceControl.setValue([]);
} }
else if(event.value.exist_status==false && event.value.type_of_activity_id==5){ else if(event.value.exist_status==false && event.value.type_of_activity_id==5){
console.log('changeBusinessActivity 8');
this.ServiceChecked = event.value.exist_status;
let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details']; let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details'];
serviceControl.push(this.createServiceActivity()); serviceControl.push(this.createServiceActivity());
} }
@ -697,8 +721,9 @@ export class BusinessInfoComponent implements OnInit {
this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl(this.businessForm.value.applicant_use_mobile_wallets)) : this.businessForm.removeControl('applicant_use_mobile_wallets'); this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl(this.businessForm.value.applicant_use_mobile_wallets)) : this.businessForm.removeControl('applicant_use_mobile_wallets');
this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl(this.businessForm.value.applicant_use_pos_machines)) : this.businessForm.removeControl('applicant_use_pos_machines'); this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl(this.businessForm.value.applicant_use_pos_machines)) : this.businessForm.removeControl('applicant_use_pos_machines');
if(this.ManufacturingChecked && this.RetailedChecked && this.WholeSalesChecked && this.ServiceChecked){
this.ExportFlag = false;
}
} }
// change area of sale options in manufacturing // change area of sale options in manufacturing
changeManufacturingAreaSale(getDetails: any, getIndex){ changeManufacturingAreaSale(getDetails: any, getIndex){
@ -1737,38 +1762,77 @@ WholeSaleCounterArray: any = [];
ServiceCounterArray: any = []; ServiceCounterArray: any = [];
CheckExport(value,stringFlag,index){ CheckExport(value,stringFlag,index){
const parentControl = <FormArray>this.businessForm.controls['select_business_activity_type'];
const childControl = <FormArray>parentControl.controls[0];
// console.log('parentControl',parentControl);
// console.log('parentControl.controls',parentControl.controls);
// console.log('childControl',childControl.value);
// console.log('childControl',childControl.value.exist_status);
// childControl.forEach((datas,index) => {
// console.log(datas);
// // exist_status==true && event.value.type_of_activity_id
// console.log(datas[index].);
// console.log(datas[index].controls.exist_status.value);
// });
console.log('CheckExport');
console.log(value,stringFlag,index);
console.log(this.ManufacturingChecked , this.RetailedChecked , this.WholeSalesChecked , this.ServiceChecked);
if(!this.ManufacturingChecked){
if(stringFlag == 'MActivity' && value != "Within India"){ if(stringFlag == 'MActivity' && value != "Within India"){
this.ManufacturingCounterArray[index] = 1; this.ManufacturingCounterArray[index] = 1;
} }
else{ else if(stringFlag == 'MActivity' && value != "Within India"){
this.ManufacturingCounterArray[index] = 0;
}
}else if (this.ManufacturingChecked && stringFlag == 'MActivity'){
this.ManufacturingCounterArray[index] = 0; this.ManufacturingCounterArray[index] = 0;
} }
if(!this.RetailedChecked){
if(stringFlag == 'RActivity' && value != "Within India"){ if(stringFlag == 'RActivity' && value != "Within India"){
this.RetailCounterArray[index] = 1; this.RetailCounterArray[index] = 1;
} }
else{ else if(stringFlag == 'RActivity' && value != "Within India"){
this.RetailCounterArray[index] = 0;
}
}
else if(stringFlag == 'RActivity' && this.RetailedChecked){
this.RetailCounterArray[index] = 0; this.RetailCounterArray[index] = 0;
} }
if(!this.WholeSalesChecked){
if(stringFlag == 'WActivity' && value != "Within India"){ if(stringFlag == 'WActivity' && value != "Within India"){
this.WholeSaleCounterArray[index] = 1; this.WholeSaleCounterArray[index] = 1;
} }
else{ else if(stringFlag == 'WActivity' && value != "Within India"){
this.WholeSaleCounterArray[index] = 0; this.WholeSaleCounterArray[index] = 0;
} }
}
else if(stringFlag == 'WActivity' && this.WholeSalesChecked){
this.WholeSaleCounterArray[index] = 0;
}
if(!this.ServiceChecked){
if(stringFlag == 'SPActivity' && value != "Within India") if(stringFlag == 'SPActivity' && value != "Within India")
{ {
this.ServiceCounterArray[index] = 1; this.ServiceCounterArray[index] = 1;
} }
else{ else if(stringFlag == 'SPActivity' && value != "Within India"){
this.ServiceCounterArray[index] = 0;
}
}else if(stringFlag == 'SPActivity'){
this.ServiceCounterArray[index] = 0; this.ServiceCounterArray[index] = 0;
} }
let SumOfManufacturingCounter = this.ManufacturingCounterArray.reduce((sum, val) => sum + +val, 0); let SumOfManufacturingCounter = this.ManufacturingCounterArray.reduce((sum, val) => sum + +val, 0);
// console.log(SumOfManufacturingCounter,this.ManufacturingCounterArray); console.log(SumOfManufacturingCounter,this.ManufacturingCounterArray);
let SumOfRetailCounter = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0); let SumOfRetailCounter = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0);
// console.log(SumOfRetailCounter , this.RetailCounterArray); // console.log(SumOfRetailCounter , this.RetailCounterArray);
let SumOfWholeSaleCounter = this.WholeSaleCounterArray.reduce((sum, val) => sum + +val, 0); let SumOfWholeSaleCounter = this.WholeSaleCounterArray.reduce((sum, val) => sum + +val, 0);
@ -1778,9 +1842,10 @@ CheckExport(value,stringFlag,index){
let overallCounter = SumOfManufacturingCounter + SumOfRetailCounter + SumOfWholeSaleCounter + SumOfServiceCounter ; let overallCounter = SumOfManufacturingCounter + SumOfRetailCounter + SumOfWholeSaleCounter + SumOfServiceCounter ;
this.ExportFlag = overallCounter > 0 ? true : false ; this.ExportFlag = overallCounter > 0 ? true : false ;
// console.log('overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter ' , overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter); console.log('overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter ' , overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter);
// console.log('Current Flag Status : ',this.ExportFlag ); console.log('Current Flag Status : ',this.ExportFlag );
} }
inWords(e,flag){ inWords(e,flag){

View File

@ -45,7 +45,7 @@
<input matInput placeholder="Client Contact Person Name" formControlName="manufacturing_contact_person_name"> <input matInput placeholder="Client Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"> <mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,1)" >
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<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}}
@ -73,16 +73,26 @@
</div> </div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%">
<mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type"> <!-- <mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type">
<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 placeholder="Payment Terms" formControlName="manufacturing_payment_type">
<mat-option *ngFor="let pm of m_paymentType" [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%">
<input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="manufacturing_credit_days"> <mat-select placeholder="Payment Mode" formControlName="manufacturing_payment_mode">
</mat-form-field> --> <mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
</mat-select>
</mat-form-field>
</div> </div>
<div fxLayout="row nowrap" *ngIf="items.get('manufacturing_payment_type').value == 3"> <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-label>No of days of Credit provided to Client for payment</mat-label>
<mat-form-field style="width: 45%" > <mat-form-field style="width: 45%" >
<input matInput placeholder="Days From" formControlName="manufacturing_credit_days_from" type="number"> <input matInput placeholder="Days From" formControlName="manufacturing_credit_days_from" type="number">
</mat-form-field> </mat-form-field>
@ -106,7 +116,7 @@
</div> </div>
<div fxlayout="row"> <div fxlayout="row">
<mat-form-field style="width: 80%"> <mat-form-field style="width: 80%">
<input matInput placeholder="What % of Total Manufacturing Raw Materials Credit Values" formControlName="main_raw_materials_total_payments_percent_on_credit" <input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="main_raw_materials_total_payments_percent_on_credit"
type="number"> type="number">
</mat-form-field> </mat-form-field>
</div> </div>
@ -147,7 +157,7 @@
<input matInput placeholder="Client Contact Person Name" formControlName="trade_product_contact_person_name"> <input matInput placeholder="Client Contact Person Name" formControlName="trade_product_contact_person_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"> <mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,2)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<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}}
@ -176,16 +186,27 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%">
<mat-select placeholder="Payment Type" formControlName="trade_product_payment_type"> <!-- <mat-select placeholder="Payment Type" formControlName="trade_product_payment_type">
<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 placeholder="Payment Terms" formControlName="trade_product_payment_type">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="trade_product_payment_mode">
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
</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> --> </mat-form-field> -->
</div> </div>
<div fxLayout="row nowrap" *ngIf="items.get('trade_product_payment_type').value == 3"> <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-label>No of days of Credit provided to Client for payment</mat-label>
<mat-form-field style="width: 45%" > <mat-form-field style="width: 45%" >
<input matInput placeholder="Days From" formControlName="trade_product_credit_days_from" type="number"> <input matInput placeholder="Days From" formControlName="trade_product_credit_days_from" type="number">
</mat-form-field> </mat-form-field>
@ -209,7 +230,7 @@
</div> </div>
<div fxlayout="row"> <div fxlayout="row">
<mat-form-field style="width: 80%"> <mat-form-field style="width: 80%">
<input matInput placeholder="What % of Total Trade is done on Credit?" formControlName="trading_products_total_payments_percent_on_credit" <input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="trading_products_total_payments_percent_on_credit"
type="number"> type="number">
</mat-form-field> </mat-form-field>
</div> </div>
@ -250,7 +271,7 @@
<input matInput placeholder="Client Contact Person Name" formControlName="service_provider_product_contact_person_name"> <input matInput placeholder="Client Contact Person Name" formControlName="service_provider_product_contact_person_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"> <mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,3)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<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}}
@ -278,16 +299,27 @@
</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: 45%"> <mat-form-field style="width: 45%">
<mat-select placeholder="Payment Type" formControlName="service_provider_product_payment_type"> <!-- <mat-select placeholder="Payment Type" formControlName="service_provider_product_payment_type">
<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 placeholder="Payment Terms" formControlName="service_provider_product_payment_type">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="service_provider_product_payment_mode">
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
</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> --> </mat-form-field> -->
</div> </div>
<div fxLayout="row nowrap" *ngIf="items.get('service_provider_product_payment_type').value == 3"> <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-label>No of days of Credit provided to Client for payment</mat-label>
<mat-form-field style="width: 45%" > <mat-form-field style="width: 45%" >
<input matInput placeholder="Days From" formControlName="service_provider_product_credit_days_from" type="number"> <input matInput placeholder="Days From" formControlName="service_provider_product_credit_days_from" type="number">
</mat-form-field> </mat-form-field>
@ -311,7 +343,7 @@
</div> </div>
<div fxlayout="row"> <div fxlayout="row">
<mat-form-field style="width: 80%"> <mat-form-field style="width: 80%">
<input matInput placeholder="What % of Total Services Provided is done on Credit?" formControlName="service_products_total_payments_percent_on_credit" <input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="service_products_total_payments_percent_on_credit"
type="number"> type="number">
</mat-form-field> </mat-form-field>
</div> </div>
@ -319,10 +351,10 @@
</div> </div>
</div> </div>
</mat-card> </mat-card>
<mat-card *ngIf="retaildTradingForm"> <!-- <mat-card *ngIf="retaildTradingForm">
<h5 style="margin: 12px;padding:10px !important;">Retail Trading Product Details</h5> <h5 style="margin: 12px;padding:10px !important;">Retail Trading Product Details</h5>
<div style="text-align: center; margin: 12px;">Retail Trading Details Not applicable here !!</div> <div style="text-align: center; margin: 12px;">Retail Trading Details Not applicable here !!</div>
</mat-card> </mat-card> -->
</mat-dialog-content> </mat-dialog-content>
<mat-dialog-actions> <mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left"> <div fxFlex="60" class="pb-0 text-sm-left" align="left">

View File

@ -43,7 +43,7 @@ export class ClientInfoComponent implements OnInit {
public _supplierQuesFrom: FormGroup; public _supplierQuesFrom: FormGroup;
public submitted = false; public submitted = false;
public m_paymentModeType = []; public m_paymentType = [];
private notifier: NotifierService; private notifier: NotifierService;
companyRelationShipList: any=[]; companyRelationShipList: any=[];
titleList: any=[]; titleList: any=[];
@ -139,7 +139,7 @@ export class ClientInfoComponent implements OnInit {
// }; // };
let datas = data.records; let datas = data.records;
this.m_manufacturingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 2 ){return data}}).map(data=> [...data.prodcuts]); this.m_manufacturingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 2 ){return data}}).map(data=> [...data.prodcuts]);
this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 4){return data}}).map(data=> [...data.prodcuts]); this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 4 || data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]);
this.m_suplierProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 5 ){return data}}).map(data=> [...data.prodcuts]); this.m_suplierProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 5 ){return data}}).map(data=> [...data.prodcuts]);
// alert(JSON.stringify(this.m_manufacturingProducts[0])); // alert(JSON.stringify(this.m_manufacturingProducts[0]));
this.initFormLoadDetails(datas.type_of_activity); this.initFormLoadDetails(datas.type_of_activity);
@ -161,7 +161,7 @@ export class ClientInfoComponent implements OnInit {
this.getMasterDetails('TITLES',2); this.getMasterDetails('TITLES',2);
} }
retaildTradingForm: Boolean = false; // retaildTradingForm: Boolean = false;
initFormLoadDetails(record) { initFormLoadDetails(record) {
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
@ -195,7 +195,7 @@ export class ClientInfoComponent implements OnInit {
} }
// Load form details for the wholeshale trading details // Load form details for the wholeshale trading details
let arr1 = record.filter(data => data.type_of_activity_id == 4); let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4);
if (arr1.length > 0) { if (arr1.length > 0) {
// let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) { // let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) {
// return dataForm.trading_products[key]; // return dataForm.trading_products[key];
@ -218,9 +218,9 @@ export class ClientInfoComponent implements OnInit {
} }
// Load form details for the retail trading details // Load form details for the retail trading details
let arr3 = record.filter(data => data.type_of_activity_id == 3); let arr3 = record.filter(data => data.type_of_activity_id == 3);
if (arr3.length > 0) { // if (arr3.length > 0) {
this.retaildTradingForm = true; // this.retaildTradingForm = true;
} // }
this.noRecordsFound = true; this.noRecordsFound = true;
} else { } else {
this._supplierQuesFrom = this._formBuilder.group({ this._supplierQuesFrom = this._formBuilder.group({
@ -238,7 +238,7 @@ export class ClientInfoComponent implements OnInit {
this.initManufacturingProductsDetails(null); this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
} }
let arr1 = record.filter(data => data.type_of_activity_id == 4); let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4);
if (arr1.length > 0) { if (arr1.length > 0) {
this.initTradingProductsDetails(null); this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
@ -253,9 +253,9 @@ export class ClientInfoComponent implements OnInit {
} }
// Load form details for the retail trading details // Load form details for the retail trading details
let arr3 = record.filter(data => data.type_of_activity_id == 3); let arr3 = record.filter(data => data.type_of_activity_id == 3);
if (arr3.length > 0) { // if (arr3.length > 0) {
this.retaildTradingForm = true; // this.retaildTradingForm = true;
} // }
this.noRecordsFound = true; this.noRecordsFound = true;
} }
} else { } else {
@ -274,7 +274,7 @@ export class ClientInfoComponent implements OnInit {
this.initManufacturingProductsDetails(null); this.initManufacturingProductsDetails(null);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null);
} }
let arr1 = record.filter(data => data.type_of_activity_id == 4); let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4);
if (arr1.length > 0) { if (arr1.length > 0) {
this.initTradingProductsDetails(null); this.initTradingProductsDetails(null);
this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null);
@ -286,9 +286,9 @@ export class ClientInfoComponent implements OnInit {
} }
// Load form details for the retail trading details // Load form details for the retail trading details
let arr3 = record.filter(data => data.type_of_activity_id == 3); let arr3 = record.filter(data => data.type_of_activity_id == 3);
if (arr3.length > 0) { // if (arr3.length > 0) {
this.retaildTradingForm = true; // this.retaildTradingForm = true;
} // }
this.noRecordsFound = true; this.noRecordsFound = true;
} }
}, err => { }, err => {
@ -315,7 +315,8 @@ export class ClientInfoComponent implements OnInit {
tradingForm: Boolean = false; tradingForm: Boolean = false;
tradingFormCreation(val) { tradingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id == 4); // let arr = val.filter(data => data.type_of_activity_id == 4);
let arr = val.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4);
if (arr.length > 0) { if (arr.length > 0) {
this.tradingForm = true; this.tradingForm = true;
return this._formBuilder.group({ return this._formBuilder.group({
@ -360,12 +361,15 @@ export class ClientInfoComponent implements OnInit {
manufacturing_contact_person_name: [''], manufacturing_contact_person_name: [''],
manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_payment_type: [''], manufacturing_payment_type: [''],
manufacturing_credit_days: [''], manufacturing_payment_mode:[''],
// manufacturing_credit_days: [''],
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:[''], other_person_designation:[''],
manufacturing_credit_days_from:[''],
manufacturing_credit_days_to:['']
}) })
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
@ -374,12 +378,15 @@ export class ClientInfoComponent implements OnInit {
manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null], manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null],
manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_payment_type: [records.manufacturing_payment_type || null], manufacturing_payment_type: [records.manufacturing_payment_type || null],
manufacturing_payment_mode:[records.manufacturing_payment_mode || null],
manufacturing_credit_days: [records.manufacturing_credit_days || null], manufacturing_credit_days: [records.manufacturing_credit_days || null],
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], other_person_designation:[records.other_person_designation || null],
manufacturing_credit_days_from:[records.manufacturing_credit_days_from || null],
manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null]
}) })
} }
} }
@ -403,6 +410,7 @@ export class ClientInfoComponent implements OnInit {
trade_product_contact_person_name: [''], trade_product_contact_person_name: [''],
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_payment_mode:[''],
trade_product_frequency_of_purchase: [''], trade_product_frequency_of_purchase: [''],
trade_product_credit_days_from: [''], trade_product_credit_days_from: [''],
trade_product_credit_days_to: [''], trade_product_credit_days_to: [''],
@ -419,6 +427,7 @@ export class ClientInfoComponent implements OnInit {
trade_product_contact_person_name: [records.trade_product_contact_person_name], trade_product_contact_person_name: [records.trade_product_contact_person_name],
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_payment_mode:[records.trade_product_payment_mode],
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_from: [records.trade_product_credit_days_from], trade_product_credit_days_from: [records.trade_product_credit_days_from],
trade_product_credit_days_to: [records.trade_product_credit_days_to], trade_product_credit_days_to: [records.trade_product_credit_days_to],
@ -450,6 +459,7 @@ export class ClientInfoComponent implements OnInit {
service_provider_product_contact_person_name: [''], service_provider_product_contact_person_name: [''],
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_payment_mode:[''],
service_provider_product_frequency_of_purchase: [''], service_provider_product_frequency_of_purchase: [''],
service_provider_product_credit_days_from: [''], service_provider_product_credit_days_from: [''],
service_provider_product_credit_days_to: [''], service_provider_product_credit_days_to: [''],
@ -466,6 +476,7 @@ export class ClientInfoComponent implements OnInit {
service_provider_product_contact_person_name: [records.service_provider_product_contact_person_name], service_provider_product_contact_person_name: [records.service_provider_product_contact_person_name],
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_payment_mode: [records.service_provider_product_payment_mode],
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_from: [records.service_provider_product_credit_days_from], 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], service_provider_product_credit_days_to: [records.service_provider_product_credit_days_to],
@ -532,7 +543,7 @@ export class ClientInfoComponent implements OnInit {
getM_PaymentModeType() { getM_PaymentModeType() {
this.pdTrigerService.getAllMasterDatas('PAYMENTMODE').subscribe( this.pdTrigerService.getAllMasterDatas('PAYMENTMODE').subscribe(
data => { data => {
this.m_paymentModeType = data.records.filter(data => data.isactive == 1); this.m_paymentType = data.records.filter(data => data.isactive == 1);
}, },
error => { error => {
// this.notifier.notify('warning', 'No Category Records Found.!'); // this.notifier.notify('warning', 'No Category Records Found.!');
@ -624,6 +635,24 @@ export class ClientInfoComponent implements OnInit {
} }
} }
selectedPersonDesignation(items,e,flag){
if(flag == 1){
e==1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
else if(flag == 2){
e==1 ?items.controls['other_person_designation'].setValidators([Validators.required])
:items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
else if(flag == 3){
e==1 ?items.controls['other_person_designation'].setValidators([Validators.required])
:items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
}
// { // {
// 'main_raw_materials': 'sdkjfal', // 'main_raw_materials': 'sdkjfal',
// 'supplier_details' ; [ // 'supplier_details' ; [

View File

@ -406,7 +406,7 @@
<input matInput placeholder="Name of the Employer/Business" formControlName="earning_name_of_the_employer_or_business" required> <input matInput placeholder="Name of the Employer/Business" formControlName="earning_name_of_the_employer_or_business" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<input matInput placeholder="No. of years in Employer/Business" formControlName="earning_number_of_years_in_employment_or_business" <input matInput placeholder="No. of years in Employment/Business" formControlName="earning_number_of_years_in_employment_or_business"
required> required>
</mat-form-field> </mat-form-field>
</div> </div>
@ -449,6 +449,14 @@
</div> </div>
</mat-card-content> </mat-card-content>
<mat-card-actions>
<span align="right">
<button type="button" mat-raised-button mat-icon-button (click)="removeOtherFamilyMembers(ix)"
matTooltip="Delete Family Details of Other Applicant" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="familyForm.controls.family_details.controls.length>1">
<mat-icon>delete</mat-icon>
</button>
</span>
</mat-card-actions>
</mat-card> </mat-card>
</div> </div>
</div> </div>
@ -579,15 +587,11 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="20" align="end"> <div fxFlex="40" align="end">
<!-- <button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="" matTooltipPosition="above"
class="mr-1 mb-1 hover-icon" ><mat-icon>add</mat-icon></button> -->
<button type="button" mat-flat-button (click)="addMoreApplicantFamilyDetails($event); false" <button type="button" mat-flat-button (click)="addMoreApplicantFamilyDetails($event); false"
matTooltip="Add More" matTooltipPosition="left" color="primary"> matTooltip="Add More" matTooltipPosition="left" color="primary">
<strong>Add Family Details of Other Applicant </strong> <strong>Add Family Details of Other Applicant </strong>
</button> </button> &nbsp;&nbsp;
</div>
<div fxFlex="20" align="end">
<button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="submitFamily()"><mat-icon>save</mat-icon></button> <button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="submitFamily()"><mat-icon>save</mat-icon></button>
</div> </div>
</mat-dialog-actions> </mat-dialog-actions>

View File

@ -637,6 +637,12 @@ export class FamilyDetailsComponent implements OnInit {
e.stopPropagation(); e.stopPropagation();
this.initFamilyForm(null); this.initFamilyForm(null);
} }
removeOtherFamilyMembers(i): void {
let control = this.familyForm.get('family_details') as FormArray;
control.removeAt(i);
}
selectedPerson(e,inx){ selectedPerson(e,inx){
// console.log('e,inx',e,inx); // console.log('e,inx',e,inx);

View File

@ -39,12 +39,14 @@
</mat-card> </mat-card>
<mat-card> <mat-card>
<mat-card-content> <mat-card-content>
<mat-form-field style="width:40%;"> <mat-form-field style="width:40%;">{{m_recommendationList || json}}
<mat-select placeholder="PD Officers Recommendation:" formControlName="pd_officers_recommendation" required> <mat-select placeholder="PD Officers Recommendation:" formControlName="pd_officers_recommendation" required (selectionChange)="RecommendationChange($event.value)">
<mat-option value=2>Positive</mat-option> <mat-option *ngFor="let list of m_recommendationList" [value]="list.pdofficer_recommendation_id">{{ list.pdofficer_recommendation }}</mat-option>
<!-- pdofficer_recommendation_id: "2", pdofficer_recommendation: "Positive" -->
<!-- <mat-option value=2>Positive</mat-option>
<mat-option value=3>Negative</mat-option> <mat-option value=3>Negative</mat-option>
<mat-option value=4>Refer to Credit</mat-option> <mat-option value=4>Refer to Credit</mat-option>
<mat-option value=1>Others</mat-option> <mat-option value=1>Others</mat-option> -->
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 3"> <mat-form-field style="width:30%;" *ngIf="_finalRemarkForm.controls['pd_officers_recommendation'].value == 3">

View File

@ -45,6 +45,7 @@ export class FinalRemarksComponent implements OnInit {
public submitted = false; public submitted = false;
public m_remarkTypeCustomerBehaviour = []; public m_remarkTypeCustomerBehaviour = [];
public m_recommendationList = [];
private notifier: NotifierService; private notifier: NotifierService;
constructor( constructor(
@ -73,6 +74,7 @@ export class FinalRemarksComponent implements OnInit {
final_form_remarks: ['',Validators.required] final_form_remarks: ['',Validators.required]
}); });
this.getM_Type(); this.getM_Type();
this.getM_Recommendation();
} }
public viewerOptions: any = { public viewerOptions: any = {
navbar: false, navbar: false,
@ -98,6 +100,8 @@ export class FinalRemarksComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '20').subscribe(data=>{ this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '20').subscribe(data=>{
if(data.dataStatus){ if(data.dataStatus){
this.RecommendationChange(data.records.pd_officers_recommendation);
this._finalRemarkForm.controls.final_custormer_remark_type.setValue(data.records.final_custormer_remark_type); this._finalRemarkForm.controls.final_custormer_remark_type.setValue(data.records.final_custormer_remark_type);
this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour); this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour);
this._finalRemarkForm.controls.pd_officers_recommendation.setValue(data.records.pd_officers_recommendation); this._finalRemarkForm.controls.pd_officers_recommendation.setValue(data.records.pd_officers_recommendation);
@ -106,6 +110,7 @@ export class FinalRemarksComponent implements OnInit {
this._finalRemarkForm.controls.enter_reason_for_refer_to_credit.setValue(data.records.enter_reason_for_refer_to_credit); this._finalRemarkForm.controls.enter_reason_for_refer_to_credit.setValue(data.records.enter_reason_for_refer_to_credit);
this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided); this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided);
this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks); this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks);
this.noRecordsFound = true; this.noRecordsFound = true;
} else { } else {
this.noRecordsFound = true; this.noRecordsFound = true;
@ -115,10 +120,23 @@ export class FinalRemarksComponent implements OnInit {
}) })
} }
getM_Recommendation() {
this.pdTrigerService.getAllMasterDatas('PDOFFICERRECOMMENDATIONS').subscribe(
data => {
this.m_recommendationList = data.records;
},
error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
getM_Type() { getM_Type() {
this.pdTrigerService.getAllMasterDatas('CUSTOMERBEHAVIOUR').subscribe( this.pdTrigerService.getAllMasterDatas('CUSTOMERBEHAVIOUR').subscribe(
data => { data => {
this.m_remarkTypeCustomerBehaviour = data.records.filter(data => data.isactive == 1); this.m_remarkTypeCustomerBehaviour = data.records.filter(data => data.isactive == 1);
console.log(this.m_remarkTypeCustomerBehaviour);
}, },
error => { error => {
// this.notifier.notify('warning', 'No Category Records Found.!'); // this.notifier.notify('warning', 'No Category Records Found.!');
@ -136,18 +154,6 @@ export class FinalRemarksComponent implements OnInit {
if (this._finalRemarkForm.controls.final_custormer_remark_type.value == 1) { if (this._finalRemarkForm.controls.final_custormer_remark_type.value == 1) {
this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]); this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]);
this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity(); this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity();
}
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]);
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
}
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){
this._finalRemarkForm.controls['enter_reason_for_negative'].setValidators([Validators.required]);
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
}
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValidators([Validators.required]);
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
} }
// stop here if form is invalid // stop here if form is invalid
if (this._finalRemarkForm.invalid) { if (this._finalRemarkForm.invalid) {
@ -196,4 +202,74 @@ export class FinalRemarksComponent implements OnInit {
} }
} }
RecommendationChange(e){
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){
}
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){
}
if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){
}
if(e==1){
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]);
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_negative'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue('');
}
if(e==2){
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_negative'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue('');
}
if(e==3){
this._finalRemarkForm.controls['enter_reason_for_negative'].setValidators([Validators.required]);
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
}
if(e==4){
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValidators([Validators.required]);
this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue('');
this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators();
this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity();
this._finalRemarkForm.controls['enter_reason_for_negative'].setValue('');
this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators();
this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity();
}
}
} }

View File

@ -249,7 +249,11 @@
</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" readonly> <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 style="width:25%">
<input matInput placeholder="Considered Margin Profit Amount" formControlName="estimate_profit_margin" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_profit_margin').value != ''"> {{"&#8377;"}} {{AV_marginProfitAmtInwords[i]}} Only </mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'no' "> <div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'no' ">
@ -261,9 +265,12 @@
<input matInput autocomplete="off" placeholder="Net Profit Amount To" formControlName="estimate_net_profit_to" type="number" (change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,8)"> <input matInput autocomplete="off" placeholder="Net Profit Amount To" formControlName="estimate_net_profit_to" type="number" (change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,8)">
<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%">
<input matInput autocomplete="off" placeholder="Considered Profit in %" formControlName="estimate_net_profit_percent" readonly>
</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" readonly> <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 </mat-hint>
<!-- // --> <!-- // -->
</mat-form-field> </mat-form-field>
</div> </div>
@ -280,9 +287,13 @@
</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" readonly> <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>
<mat-form-field style="width:25%">
<input matInput placeholder="Considered Margin Loss Amount" formControlName="estimate_loss_margin" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_loss_margin').value != ''">{{"&#8377;"}} {{AV_marginLossAmtInwords[i]}} Only </mat-hint>
</mat-form-field>
</div> </div>
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'no' "> <div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'no' ">
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
@ -293,9 +304,12 @@
<input matInput autocomplete="off" placeholder="Net Loss Amount To" formControlName="estimate_net_loss_to" type="number" (change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,10)"> <input matInput autocomplete="off" placeholder="Net Loss Amount To" formControlName="estimate_net_loss_to" type="number" (change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,10)">
<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%">
<input matInput autocomplete="off" placeholder="Considered Loss in %" formControlName="estimate_net_loss_percent" readonly>
</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" readonly> <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</mat-hint>
<!-- // --> <!-- // -->
</mat-form-field> </mat-form-field>

View File

@ -17,7 +17,9 @@
// background: #62B013; // background: #62B013;
// color: white; // color: white;
// } // }
.mat-form-field-appearance-legacy .mat-hint{
color:rgba(0, 0, 0, 0.8) !important;
}
.underline input { .underline input {
border: none; border: none;
} }

View File

@ -72,12 +72,13 @@
<mat-form-field style="width:64%" *ngIf="loanDetailsForm.controls['topup_amount'].value > 0 " > <mat-form-field style="width:64%" *ngIf="loanDetailsForm.controls['topup_amount'].value > 0 " >
<mat-select placeholder="What is the End Use of the Top Up?" <mat-select placeholder="What is the End Use of the Top Up?"
formControlName="end_use_topup" > formControlName="end_use_topup" >
<mat-option value=2>Business Use.</mat-option> <mat-option *ngFor="let list of m_endUseOFTopUpList" [value]="list.end_use_of_topup_id">{{ list.end_use_of_topup }}</mat-option>
<!-- <mat-option value=2>Business Use.</mat-option>
<mat-option value=3>Childs Marriage.</mat-option> <mat-option value=3>Childs Marriage.</mat-option>
<mat-option value=4>Furniture & Finishing of House Property.</mat-option> <mat-option value=4>Furniture & Finishing of House Property.</mat-option>
<mat-option value=5>Medical Expenses.</mat-option> <mat-option value=5>Medical Expenses.</mat-option>
<mat-option value=6>Paying Off Existing Loans.</mat-option> <mat-option value=6>Paying Off Existing Loans.</mat-option>
<mat-option value=1>Others.</mat-option> <mat-option value=1>Others.</mat-option> -->
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -131,7 +132,7 @@
<mat-form-field style="width:50%;"> <mat-form-field style="width:50%;">
<mat-select multiple placeholder="Name of the Owner" <mat-select multiple placeholder="Name of the Owner"
formControlName="owner_name" [compareWith]="compareObjects" required> formControlName="owner_name" [compareWith]="compareObjects" >
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName"> <mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val"> <mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}} {{val.name}}

View File

@ -60,6 +60,7 @@ export class LoanDetailsComponent implements OnInit {
m_mortageTypeProperty = []; m_mortageTypeProperty = [];
m_statusofCunstruction = []; m_statusofCunstruction = [];
m_btLenderList = []; m_btLenderList = [];
m_endUseOFTopUpList = [];
// existCompanyList: any =[]; // existCompanyList: any =[];
CompanyApplicantGroupList: any=[]; CompanyApplicantGroupList: any=[];
CompanyApplicantGroupList2: any=[]; CompanyApplicantGroupList2: any=[];
@ -135,6 +136,7 @@ export class LoanDetailsComponent implements OnInit {
this.getM_MortageTypeProperty(); this.getM_MortageTypeProperty();
this.getM_StatusofCunstruction(); this.getM_StatusofCunstruction();
this.getM_BTLenderList(); this.getM_BTLenderList();
this.getM_EndUseofTopUpList();
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){ if(data.dataStatus){
@ -304,8 +306,14 @@ export class LoanDetailsComponent implements OnInit {
if(this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LL'){ if(this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LL'){
this.mortageCardAccess = false; this.mortageCardAccess = false;
this.loanDetailsForm.controls['owner_name'].clearValidators();
this.loanDetailsForm.controls['owner_name'].updateValueAndValidity();
}else{ }else{
this.mortageCardAccess = true; this.mortageCardAccess = true;
this.loanDetailsForm.controls['owner_name'].setValidators([Validators.required]);
this.loanDetailsForm.controls['owner_name'].updateValueAndValidity();
} }
} }
@ -415,6 +423,17 @@ getM_sourceofamount() {
}) })
} }
getM_EndUseofTopUpList(){
this._pd.getAllMasterDatas('ENDUSEOFTOPUP').subscribe(
data => {
this.m_endUseOFTopUpList = data.records.filter(data => data.is_active == 1);
})
}
// compare objects for merge two master table details // compare objects for merge two master table details
compareObjects(o1: any, o2: any) { compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id) if(o1.id == o2.id && o1.group_id == o2.group_id)
@ -491,11 +510,14 @@ getM_sourceofamount() {
if(OthersAvaliable == 'others') { if(OthersAvaliable == 'others') {
this.isOtherPurpose = true; this.isOtherPurpose = true;
this.loanDetailsForm.controls['end_use_other'].setValidators([Validators.required]);
}else }else
{ {
this.loanDetailsForm.controls['end_use_other'].clearValidators();
this.isOtherPurpose = false; this.isOtherPurpose = false;
} }
this.loanDetailsForm.controls['end_use_other'].updateValueAndValidity();
//this.isOtherPurpose = event.some(e => e == 'others') // this return true or false Only; //this.isOtherPurpose = event.some(e => e == 'others') // this return true or false Only;
} }
@ -508,7 +530,13 @@ getM_sourceofamount() {
this.isOtherSource = evt.some(e => e == 1) // this return true or false Only; this.isOtherSource = evt.some(e => e == 1) // this return true or false Only;
// this.isPLSource = evt.some(e => e == 3) // this return true or false Only; // this.isPLSource = evt.some(e => e == 3) // this return true or false Only;
if(this.isOtherSource){
this.loanDetailsForm.controls['other_source'].setValidators([Validators.required]);
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
}else{
this.loanDetailsForm.controls['other_source'].clearValidators();
this.loanDetailsForm.controls['other_source'].updateValueAndValidity();
}
this.sourceList = []; this.sourceList = [];
evt.forEach(option => { evt.forEach(option => {
@ -534,10 +562,30 @@ getM_sourceofamount() {
// }); // });
} }
submitLoanDetails() { submitLoanDetails() {
// if (!this.loanDetailsForm.valid) {
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); if(this.loanDetailsForm.controls['lender'].value == 1){
// return; this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]);
// } this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
}
else{
this.loanDetailsForm.controls['other_bt_lender'].clearValidators();
this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity();
}
if(this.loanDetailsForm.controls['end_use_topup'].value == 1){
this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]);
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
}
else{
this.loanDetailsForm.controls['other_end_use_topup'].clearValidators();
this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity();
}
if (!this.loanDetailsForm.valid) {
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
}
let records: any = {}; let records: any = {};
records.pdid = this.pdid; records.pdid = this.pdid;
records.formid = this.form_id; records.formid = this.form_id;
@ -550,6 +598,7 @@ getM_sourceofamount() {
this.loanDetailsForm.controls['end_use'].value.forEach(element => { this.loanDetailsForm.controls['end_use'].value.forEach(element => {
dataEnd_user_data.push({end_use: element}) dataEnd_user_data.push({end_use: element})
}); });
records.end_use_group = dataEnd_user_data; records.end_use_group = dataEnd_user_data;
if (this.isOtherPurpose) { if (this.isOtherPurpose) {
@ -600,43 +649,32 @@ getM_sourceofamount() {
} }
} }
records.emi_level = this.loanDetailsForm.controls['emi_level'].value; records.emi_level = this.loanDetailsForm.controls['emi_level'].value;
if(this.mortageCardAccess == true){ if(this.mortageCardAccess == true){
records.property_type = this.loanDetailsForm.controls['property_type'].value; records.property_type = this.loanDetailsForm.controls['property_type'].value;
records.property_type_others = this.loanDetailsForm.controls['property_type_others'].value; records.property_type_others = this.loanDetailsForm.controls['property_type_others'].value;
// records.owner_name_group = this.ownerNames;
// console.log(this.loanDetailsForm.controls['owner_name'].value);
let dataOwner_name = []; let dataOwner_name = [];
this.loanDetailsForm.controls['owner_name'].value.forEach(element => { this.loanDetailsForm.controls['owner_name'].value.forEach(element => {
dataOwner_name.push({owner_name: element}) dataOwner_name.push({owner_name: element})
}); });
records.owner_name_group = dataOwner_name; records.owner_name_group = dataOwner_name;
// if(this.loanDetailsForm.controls['other_owners_name'].value != null){
// records.other_owners_name = this.loanDetailsForm.controls['other_owners_name'].value;
// }else{ records.other_owners_name = null; }
records.construction_status = this.loanDetailsForm.controls['construction_status'].value; records.construction_status = this.loanDetailsForm.controls['construction_status'].value;
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
}else{ }else{
records.property_type = null; records.property_type = null;
records.property_type_others = null; records.property_type_others = null;
records.owner_name_group = null; records.owner_name_group = null;
// records.other_owners_name = null;
records.construction_status = null; records.construction_status = null;
records.emv_per_customer = null; records.emv_per_customer = null;
} }
if(this.isOtherSource){ if(this.isOtherSource){
records.other_source = this.loanDetailsForm.controls['other_source'].value; records.other_source = this.loanDetailsForm.controls['other_source'].value;
}else{ records.other_source = ''; } }else{ records.other_source = ''; }
// if(this.isPLSource){
// records.personal_loan_source = this.loanDetailsForm.controls['personal_loan_source'].value;
// }else{ records.personal_loan_source = ''; }
//records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value;
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
//records.value_per_agreement = this.loanDetailsForm.controls['value_per_agreement'].value;
records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value; records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value;
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) { if(data.status == 200) {
@ -742,8 +780,12 @@ getM_sourceofamount() {
// console.log(mortagetypes); // console.log(mortagetypes);
if(mortagetypes.property_name=='Others (Please Specify)'){ if(mortagetypes.property_name=='Others (Please Specify)'){
this.mortageAccess = true; this.mortageAccess = true;
this.loanDetailsForm.controls['property_type_others'].setValidators([Validators.required]);
this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity();
}else{ }else{
this.mortageAccess = false; this.mortageAccess = false;
this.loanDetailsForm.controls['property_type_others'].clearValidators();
this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity();
} }
} }

View File

@ -34,7 +34,8 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 40%"> <mat-form-field style="width: 40%">
<mat-select placeholder="Do You Know the Applicant" formControlName="do_know"> <!-- Do You Know the Applicant -->
<mat-select placeholder=" Do you know about the applicants or their business?" formControlName="do_know">
<mat-option value="Yes">Yes</mat-option> <mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option> <mat-option value="No">No</mat-option>
</mat-select> </mat-select>
@ -43,37 +44,88 @@
<!-- <mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value=='Yes'"> --> <!-- <mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value=='Yes'"> -->
<!-- <input matInput autocomplete="off" placeholder="How Long to Know the Applicant " formControlName="how_long_do_know" type="text" (keypress)="keyPress($event)"> --> <!-- <input matInput autocomplete="off" placeholder="How Long to Know the Applicant " formControlName="how_long_do_know" type="text" (keypress)="keyPress($event)"> -->
<!-- </mat-form-field> --> <!-- </mat-form-field> -->
<div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value=='Yes'">
<div fxFlex="100"> <div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value!=''">
<label>How Long to Know the Applicant</label> <div fxFlex="80">
<mat-form-field> <label>As per you how long has this business been in operation?</label>
<mat-form-field *ngIf="!this.isDisplay[n]">
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="how_long_do_know_in_year" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Year(s)" formControlName="how_long_do_know_in_year" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field *ngIf="!this.isDisplay[n]">
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="how_long_do_know_in_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(neighbourhood,$event.target.value,1)"> <input matInput autocomplete="off" placeholder="Month(s)" formControlName="how_long_do_know_in_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(neighbourhood,$event.target.value,1)">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="10" style="text-align: center;">
<label>Do not know</label>
<div>
<mat-checkbox color="primary" formControlName="did_not_know_the_business_operation" (change)="toggleVisibility($event.checked,n,1)"></mat-checkbox>
</div> </div>
<mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value=='Yes'"> </div>
</div>
<!-- <div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value==''">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Who is the owner of the organisation?" formControlName="how_long_do_know_in_year">
</mat-form-field>
</div> -->
<!-- <mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value!=''">
<mat-select placeholder="Is the Applicant Owner" formControlName="is_applicant_owner"> <mat-select placeholder="Is the Applicant Owner" formControlName="is_applicant_owner">
<mat-option value="Yes">Yes</mat-option> <mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option> <mat-option value="No">No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field> -->
<div fxLayout="row wrap" *ngIf="neighbourhood.controls.do_know.value!=''">
<div fxFlex="60" *ngIf="neighbourhood.controls.do_know.value!='' && !isDisplay2[n]">
<mat-form-field style="width: 95%">
<mat-select placeholder="Who is the owner of the organisation?" formControlName="organisation_owner" (selectionChange)="selectedApplicants(neighbourhood,$event.value,n)">
<mat-option *ngFor="let list of applicants" [value]="list.pd_co_applicant_id">{{list.applicant_name}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxFlex="20" *ngIf="isOtherApplicant && !isDisplay2[n]">
<mat-form-field style="width: 95%">
<input matInput autocomplete="off" placeholder="Specify Owner name" formControlName="other_organisation_owner" type="text">
</mat-form-field>
</div>
<div fxFlex="80" *ngIf="neighbourhood.controls.do_know.value!='' && isDisplay2[n]">
<label>Who is the owner of the organisation?</label>
</div>
<div fxFlex="10" style="text-align: center;">
<label>Do not know</label>
<div>
<mat-checkbox color="primary" formControlName="did_not_know_the_owner" (change)="toggleVisibility($event.checked,n,2)"></mat-checkbox>
</div>
</div>
</div>
</mat-card-content> </mat-card-content>
<mat-card-actions align="center"> <mat-card-actions align="center">
<!-- <button type="button" mat-raised-button mat-icon-button <!-- <button type="button" mat-raised-button mat-icon-button
matTooltip="Remove Neighbourhood" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="n!=0"> matTooltip="Remove Neighbourhood" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="n!=0">
<mat-icon>delete</mat-icon></button> --> <mat-icon>delete</mat-icon></button> -->
<button type="button" mat-flat-button (click)="removeNeighbourhood(n)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="n!=0"> <button type="button" mat-flat-button (click)="removeNeighbourhood(n)" *ngIf="_neighbourhoodForm.controls.neighbourhood_list.controls.length > 1"
matTooltip="Delete"matTooltipPosition="left" color="primary">
<strong>Delete Neighbourhood </strong> <strong>Delete Neighbourhood </strong>
</button> </button>
</mat-card-actions> </mat-card-actions>
</mat-card> </mat-card>
</mat-card-content> </mat-card-content>
<div *ngIf="_neighbourhoodForm.controls.check_type.value==0">
<mat-form-field style="width: 40%">
<mat-select placeholder="Status of the check as per PD officer?" formControlName="neighbourhood_status">
<mat-option value="Positive">Positive</mat-option>
<mat-option value="Negative">Negative</mat-option>
</mat-select>
</mat-form-field>
</div>
<mat-card-content formArrayName="referencecheck_list" *ngIf="_neighbourhoodForm.controls.check_type.value==1"> <mat-card-content formArrayName="referencecheck_list" *ngIf="_neighbourhoodForm.controls.check_type.value==1">
<mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;let last =last" [formGroupName]="r"> <mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;let last =last" [formGroupName]="r">
<mat-card-content> <mat-card-content>
@ -148,8 +200,8 @@
<mat-icon>delete</mat-icon></button> --> <mat-icon>delete</mat-icon></button> -->
</mat-card-content> </mat-card-content>
<mat-card-actions align="center"> <mat-card-actions align="center">
<button type="button" mat-flat-button (click)="removeReferencecheck(r)" <button type="button" mat-flat-button (click)="removeReferencecheck(r)" *ngIf="_neighbourhoodForm.controls.referencecheck_list.controls.length > 1"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="r!=0"> matTooltip="Delete"matTooltipPosition="left" color="primary">
<strong>Delete Reference Check </strong> <strong>Delete Reference Check </strong>
</button> </button>
</mat-card-actions> </mat-card-actions>

View File

@ -15,21 +15,26 @@ export class NeighbourHoodComponent implements OnInit {
lender_applicant_id: any; lender_applicant_id: any;
main_applicant: any; main_applicant: any;
pageTitle: string = "Neighbourhood Check / Reference Check"; pageTitle: string = "Neighbourhood Check / Reference Check";
isDisplay:any = [];
isDisplay2:any = [];
public _neighbourhoodForm: FormGroup; public _neighbourhoodForm: FormGroup;
pdid : string; pdid : string;
form_id:number; form_id:number;
private notifier: NotifierService; private notifier: NotifierService;
check_type:any=[{'id':0,'type_name':'Neighbourhood Check'},{'id':1,'type_name':'Reference Check'}] check_type:any=[{'id':0,'type_name':'Neighbourhood Check'},{'id':1,'type_name':'Reference Check'}]
default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''}; default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''};
default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':'','did_not_know_the_business_operation':'','organisation_owner':'','other_organisation_owner':'','did_not_know_the_owner':''};
busineesRelationshipList:any=[]; busineesRelationshipList:any=[];
volumeunitList:any=[]; volumeunitList:any=[];
applicants:any = [];
errorMessage:any; errorMessage:any;
finalRemarksList : any = [{'id': 1,'name': "Positive"}, finalRemarksList : any = [{'id': 1,'name': "Positive"},
{'id': 2,'name': "Negative"}, {'id': 2,'name': "Negative"},
{'id': 3,'name': "Insufficient information provided"}]; {'id': 3,'name': "Insufficient information provided"}];
amtInwords : any = []; amtInwords : any = [];
isOtherApplicant: boolean;
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<NeighbourHoodComponent>) { constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<NeighbourHoodComponent>) {
this.pdid = this.data.pdmaster_details.pd_id; this.pdid = this.data.pdmaster_details.pd_id;
this.notifier = notifier; this.notifier = notifier;
@ -38,6 +43,11 @@ export class NeighbourHoodComponent implements OnInit {
this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id; this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id;
this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr; this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr;
this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr; this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr;
this.applicants = this.data.pdapplicants_detials;
this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2);
this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"})
// console.log(this.applicants);
} }
ngOnInit() { ngOnInit() {
@ -73,6 +83,7 @@ export class NeighbourHoodComponent implements OnInit {
formid:this.form_id, formid:this.form_id,
check_type:0, check_type:0,
neighbourhood_list: this._fb.array([]), neighbourhood_list: this._fb.array([]),
neighbourhood_status:'',
referencecheck_list: this._fb.array([]), referencecheck_list: this._fb.array([]),
neighbour_reference_remark:'' neighbour_reference_remark:''
}); });
@ -97,19 +108,24 @@ export class NeighbourHoodComponent implements OnInit {
let exist_ref_details = data.records.referencecheck_list ? Object.keys(data.records.referencecheck_list).map((item)=>data.records.referencecheck_list[item]) : []; let exist_ref_details = data.records.referencecheck_list ? Object.keys(data.records.referencecheck_list).map((item)=>data.records.referencecheck_list[item]) : [];
let exist_neighbourhood_details = data.records.neighbourhood_list ? Object.keys(data.records.neighbourhood_list).map((item)=>data.records.neighbourhood_list[item]) : []; let exist_neighbourhood_details = data.records.neighbourhood_list ? Object.keys(data.records.neighbourhood_list).map((item)=>data.records.neighbourhood_list[item]) : [];
if(exist_neighbourhood_details.length>0 && data.records.check_type==0){ if(exist_neighbourhood_details.length>0 && data.records.check_type==0){
exist_neighbourhood_details.forEach(element => { exist_neighbourhood_details.forEach((element,index) => {
this.toggleVisibility(element.did_not_know_the_business_operation,index,1);
this.toggleVisibility(element.did_not_know_the_owner,index,2);
this.selectedApplicants(referencecheckControl,element.organisation_owner);
neighbourhoodControl.push(this.createNeighbourhood(element)); neighbourhoodControl.push(this.createNeighbourhood(element));
}); });
} }
else if(exist_ref_details.length>0 && data.records.check_type==1){ else if(exist_ref_details.length>0 && data.records.check_type==1){
exist_ref_details.forEach((element,index) => { exist_ref_details.forEach((element,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount); this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount);
referencecheckControl.push(this.createReerenceCheck(element)); referencecheckControl.push(this.createReerenceCheck(element));
}); });
} }
this._neighbourhoodForm.controls['neighbourhood_status'].setValue(data.records.check_type==0 ? data.records.neighbourhood_status : '');
this._neighbourhoodForm.controls['neighbour_reference_remark'].setValue(data.records.neighbour_reference_remark ? data.records.neighbour_reference_remark : ''); this._neighbourhoodForm.controls['neighbour_reference_remark'].setValue(data.records.neighbour_reference_remark ? data.records.neighbour_reference_remark : '');
this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : ''); this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : '');
} }
else { else {
@ -183,9 +199,13 @@ export class NeighbourHoodComponent implements OnInit {
return this._fb.group({ return this._fb.group({
neighbourhood_name: [elementValue.neighbourhood_name], neighbourhood_name: [elementValue.neighbourhood_name],
do_know: [elementValue.do_know], do_know: [elementValue.do_know],
did_not_know_the_business_operation: [elementValue.did_not_know_the_business_operation],
how_long_do_know_in_year: [elementValue.how_long_do_know_in_year], how_long_do_know_in_year: [elementValue.how_long_do_know_in_year],
how_long_do_know_in_month: [elementValue.how_long_do_know_in_month], how_long_do_know_in_month: [elementValue.how_long_do_know_in_month],
is_applicant_owner: [elementValue.is_applicant_owner], is_applicant_owner: [elementValue.is_applicant_owner],
organisation_owner: [elementValue.organisation_owner],
other_organisation_owner:[elementValue.other_organisation_owner],
did_not_know_the_owner:[elementValue.did_not_know_the_owner]
}); });
} }
@ -229,9 +249,13 @@ export class NeighbourHoodComponent implements OnInit {
neighbourhood_list.push({ neighbourhood_list.push({
"neighbourhood_name":element.neighbourhood_name, "neighbourhood_name":element.neighbourhood_name,
"do_know":element.do_know, "do_know":element.do_know,
"did_not_know_the_business_operation":element.did_not_know_the_business_operation,
"how_long_do_know_in_year":element.how_long_do_know_in_year, "how_long_do_know_in_year":element.how_long_do_know_in_year,
"how_long_do_know_month":element.how_long_do_know_month, "how_long_do_know_month":element.how_long_do_know_month,
"is_applicant_owner":element.is_applicant_owner, "is_applicant_owner":element.is_applicant_owner,
"organisation_owner":element.organisation_owner,
"other_organisation_owner":element.other_organisation_owner,
"did_not_know_the_owner":element.did_not_know_the_owner
}) })
}); });
saveRecords.neighbourhood_list=neighbourhood_list; saveRecords.neighbourhood_list=neighbourhood_list;
@ -266,6 +290,7 @@ export class NeighbourHoodComponent implements OnInit {
saveRecords.check_type=formData.check_type; saveRecords.check_type=formData.check_type;
saveRecords.pdid=formData.pdid; saveRecords.pdid=formData.pdid;
saveRecords.formid=formData.formid; saveRecords.formid=formData.formid;
saveRecords.neighbourhood_status = formData.check_type == 0 ? formData.neighbourhood_status : '';
saveRecords.neighbour_reference_remark=formData.neighbour_reference_remark; saveRecords.neighbour_reference_remark=formData.neighbour_reference_remark;
this._pd.savePDFormDetailsWithID(saveRecords).subscribe( this._pd.savePDFormDetailsWithID(saveRecords).subscribe(
dataresult => { dataresult => {
@ -320,6 +345,30 @@ validateAllFormFields(formGroup: any) {
} }
} }
toggleVisibility(e,index,flag){
// console.log(e,index);
if(flag == 1){
this.isDisplay[index] = e;
}
else if(flag==2){
this.isDisplay2[index] = e;
}
}
selectedApplicants(items,e){
if(e != 0){
this.isOtherApplicant = false;
items.controls['other_organisation_owner'].setValue('');
items.controls['other_organisation_owner'].clearValidators();
}else{
this.isOtherApplicant = true;
items.controls['other_organisation_owner'].setValidators([Validators.required]);
}
items.controls['other_organisation_owner'].updateValueAndValidity();
}
/** Amount InWords */ /** Amount InWords */
inWords(e,i){ inWords(e,i){
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);

View File

@ -483,7 +483,7 @@
</form> </form>
</div> </div>
<div *ngIf="!noRecordsFound" align="center"> <i> Fill Business Form First! / No Company Found at this ID {{company_id}}! .... </i> </div> <div *ngIf="!noRecordsFound"> <i> Loading... </i> </div>
<notifier-container></notifier-container> <notifier-container></notifier-container>
<!-- <mat-card style="padding: 12px;"> <!-- <mat-card style="padding: 12px;">
<p>Stock Details</p> <p>Stock Details</p>

View File

@ -59,7 +59,7 @@ export class StockComponent implements OnInit {
public submitted = false; public submitted = false;
noRecordsFound: Boolean = false; noRecordsFound: Boolean = false;
serviceProviderForm: Boolean = false; serviceProviderForm: Boolean = false;
// suppliers_raw_materials : any = []; suppliers_raw_materials : any = [];
suppliers_retail_trade_details : any = []; suppliers_retail_trade_details : any = [];
suppliers_wholesale_trade_details : any = []; suppliers_wholesale_trade_details : any = [];
suppliers_finished_goods : any =[]; suppliers_finished_goods : any =[];
@ -104,6 +104,7 @@ export class StockComponent implements OnInit {
this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => { this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => {
if(data.dataStatus == true){ if(data.dataStatus == true){
console.log(data.record);
this.initstockForms(data.record); this.initstockForms(data.record);
} }
else if(data.dataStatus == false) else if(data.dataStatus == false)
@ -126,11 +127,12 @@ export class StockComponent implements OnInit {
} }
public initstockForms(record){ public initstockForms(record){
console.log(record);
let api = Object.keys(record).map(function (key) { let api = Object.keys(record.from_business).map(function (key) {
return record[key]; return record.from_business[key];
}); });
let rm_api = record.from_supplier;
console.log('rm_api',rm_api.length);
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
@ -145,7 +147,7 @@ export class StockComponent implements OnInit {
formid: [this.form_id], formid: [this.form_id],
company_id: [this.company_id], company_id: [this.company_id],
stock_remarks: [''], stock_remarks: [''],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(api)]), manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
retail_details : this.fb.array([this.retailFormCreation(api)]), retail_details : this.fb.array([this.retailFormCreation(api)]),
trade_details: this.fb.array([this.tradingFormCreation(api)]), trade_details: this.fb.array([this.tradingFormCreation(api)]),
}); });
@ -154,6 +156,7 @@ export class StockComponent implements OnInit {
if(api.length > 0){ if(api.length > 0){
api.forEach(val => { api.forEach(val => {
if (val.type_of_activity_id == 2) { if (val.type_of_activity_id == 2) {
// if(){}
if(val.products){ if(val.products){
let manufacturing_temparr = []; let manufacturing_temparr = [];
manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials;
@ -194,8 +197,8 @@ export class StockComponent implements OnInit {
company_id: [this.company_id], company_id: [this.company_id],
stock_remarks: [''], stock_remarks: [''],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
retail_details : this.fb.array([this.retailFormCreation(record)]), retail_details : this.fb.array([this.retailFormCreation(record.from_business)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record.from_business)]),
}); });
if(api.length > 0){ if(api.length > 0){
@ -238,14 +241,15 @@ export class StockComponent implements OnInit {
company_id: [this.company_id], company_id: [this.company_id],
stock_remarks: [''], stock_remarks: [''],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
retail_details : this.fb.array([this.retailFormCreation(record)]), retail_details : this.fb.array([this.retailFormCreation(record.from_business)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record.from_business)]),
}); });
if(api.length > 0){ if(api.length > 0){
api.forEach(val => { api.forEach(val => {
if (val.type_of_activity_id == 2) { if (val.type_of_activity_id == 2) {
if(val.products){ if(val.products){
this.suppliers_finished_goods = val.products; this.suppliers_finished_goods = val.products;
this.suppliers_raw_materials = rm_api;
this.initManufacturingDetails(null); this.initManufacturingDetails(null);
} }
} }
@ -279,7 +283,13 @@ export class StockComponent implements OnInit {
manufacturingForm: Boolean = false; manufacturingForm: Boolean = false;
manufacturingFormCreation(record) { manufacturingFormCreation(record) {
let arr = record.filter(data => data.type_of_activity_id == 2); console.log('record',record);
let arr = record.from_business.filter(data => data.type_of_activity_id == 2);
let rm_arr = record.from_supplier;
console.log(rm_arr);
console.log(rm_arr.length);
if (arr.length > 0) { if (arr.length > 0) {
this.manufacturingForm = true; this.manufacturingForm = true;
return this.fb.group({ return this.fb.group({
@ -293,7 +303,7 @@ export class StockComponent implements OnInit {
retailForm: Boolean = false; retailForm: Boolean = false;
retailFormCreation(val) { retailFormCreation(val) {
console.log(val,'val');
let arr = val.filter(data => data.type_of_activity_id == 3); let arr = val.filter(data => data.type_of_activity_id == 3);
if (arr.length > 0) { if (arr.length > 0) {
this.retailForm = true; this.retailForm = true;
@ -333,21 +343,22 @@ tradingFormCreation(val) {
if(datas === null){ if(datas === null){
// if(this.suppliers_raw_materials.length > 0){ if(this.suppliers_raw_materials.length > 0){
// this.suppliers_raw_materials.forEach(val => { this.suppliers_raw_materials.forEach(val => {
// let Ref_RawMaterials : any = {'raw_name': val, let Ref_RawMaterials : any = {'raw_name': val,
// 'stock_observed':'', 'stock_observed':'',
// 'raw_quantity': '', 'raw_quantity': '',
// 'raw_uom': '', 'raw_uom': '',
// 'other_uom': '', 'other_uom': '',
// 'raw_value': '', 'raw_value': '',
// 'is_sufficiant_raw': '', 'is_sufficiant_raw': '',
// 'rawmaterial_remarks':''}; 'rawmaterial_remarks':''};
// rawMaterial.push(this.createRawmaterial(Ref_RawMaterials)); rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
// }); });
// } }
// else{ } else{
rawMaterial.push(this.createRawmaterial(null)); rawMaterial.push(this.createRawmaterial(null));
}
if(this.suppliers_finished_goods.length > 0){ if(this.suppliers_finished_goods.length > 0){
// for (let val of this.suppliers_finished_goods) { // for (let val of this.suppliers_finished_goods) {
@ -417,7 +428,7 @@ tradingFormCreation(val) {
} else { } else {
return this.fb.group({ return this.fb.group({
manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null], // manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null],
raw_name: [records.raw_name], raw_name: [records.raw_name],
stock_observed:[records.stock_observed], stock_observed:[records.stock_observed],
raw_quantity: [records.raw_quantity], raw_quantity: [records.raw_quantity],

View File

@ -40,7 +40,7 @@
<input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name"> <input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"> <mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,1)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<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}}
@ -69,9 +69,21 @@
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%">
<!-- //(selectionChange)="selectedPM($event)" --> <!-- //(selectionChange)="selectedPM($event)" -->
<mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type"> <!-- <mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type">
<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-select placeholder="Payment Terms" formControlName="manufacturing_payment_type" (selectionChange)="selectedPaymentTerms(items,$event.value,1)">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="manufacturing_payment_mode">
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
</mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
@ -137,7 +149,7 @@
<input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name" maxlength="10"> <input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name" maxlength="10">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%"> <mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation"> <mat-select placeholder="Contact Person Designation" formControlName="person_designation" (selectionChange)="selectedPersonDesignation(items,$event.value,2)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<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}}
@ -166,10 +178,20 @@
</div> </div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%"> <mat-form-field style="width: 45%">
<mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="trade_product_payment_type"> <!-- <mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="trade_product_payment_type">
<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 placeholder="Payment Terms" formControlName="trade_product_payment_type" (selectionChange)="selectedPaymentTerms(items,$event.value,2)">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Payment Mode" formControlName="trade_product_payment_mode">
<mat-option value="Payment received in Cash.">Payment received in Cash.</mat-option>
<mat-option value="Payment received through Banking channels.">Payment received through Banking channels.</mat-option>
</mat-select>
</mat-form-field>
</div> </div>
<!-- <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 Provided by Supplier" autocomplete="off" formControlName="trade_product_credit_days" (keypress)="keyPress($event)"> <input matInput placeholder="No.of Days of Credit Provided by Supplier" autocomplete="off" formControlName="trade_product_credit_days" (keypress)="keyPress($event)">

View File

@ -45,7 +45,7 @@ export class SupplierInfoComponent implements OnInit {
public _supplierQuesFrom: FormGroup; public _supplierQuesFrom: FormGroup;
public submitted = false; public submitted = false;
public m_paymentModeType = []; public m_paymentType = [];
private notifier: NotifierService; private notifier: NotifierService;
titleList: any=[]; titleList: any=[];
companyRelationShipList: any=[]; companyRelationShipList: any=[];
@ -279,6 +279,7 @@ export class SupplierInfoComponent implements OnInit {
manufacturing_contact_person_name: [''], manufacturing_contact_person_name: [''],
manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_payment_type: [''], manufacturing_payment_type: [''],
manufacturing_payment_mode:[''],
manufacturing_credit_days_from: [''], manufacturing_credit_days_from: [''],
manufacturing_credit_days_to:[''], manufacturing_credit_days_to:[''],
manufacturing_frequency_of_purchase: [''], manufacturing_frequency_of_purchase: [''],
@ -296,6 +297,7 @@ export class SupplierInfoComponent implements OnInit {
manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null], manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null],
manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_payment_type: [records.manufacturing_payment_type || null], manufacturing_payment_type: [records.manufacturing_payment_type || null],
manufacturing_payment_mode:[records.manufacturing_payment_mode],
manufacturing_credit_days_from: [records.manufacturing_credit_days_from || null], manufacturing_credit_days_from: [records.manufacturing_credit_days_from || null],
manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null], manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null],
manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null], manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null],
@ -329,6 +331,7 @@ export class SupplierInfoComponent implements OnInit {
person_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], person_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
trade_product_payment_type: [''], trade_product_payment_type: [''],
trade_product_payment_mode: [''],
trade_product_frequency_of_purchase: [''], trade_product_frequency_of_purchase: [''],
trade_product_credit_days_from: [''], trade_product_credit_days_from: [''],
trade_product_credit_days_to: [''], trade_product_credit_days_to: [''],
@ -345,6 +348,7 @@ export class SupplierInfoComponent implements OnInit {
person_stdcode:[records.person_stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_stdcode:[records.person_stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])],
person_landline:[records.person_landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
trade_product_payment_type: [records.trade_product_payment_type], trade_product_payment_type: [records.trade_product_payment_type],
trade_product_payment_mode: [records.trade_product_payment_mode],
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_from: [records.trade_product_credit_days_from], trade_product_credit_days_from: [records.trade_product_credit_days_from],
trade_product_credit_days_to: [records.trade_product_credit_days_to], trade_product_credit_days_to: [records.trade_product_credit_days_to],
@ -413,7 +417,7 @@ export class SupplierInfoComponent implements OnInit {
getM_PaymentModeType() { getM_PaymentModeType() {
this.pdTrigerService.getAllMasterDatas('PAYMENTMODE').subscribe( this.pdTrigerService.getAllMasterDatas('PAYMENTMODE').subscribe(
data => { data => {
this.m_paymentModeType = data.records.filter(data => data.isactive == 1); this.m_paymentType = data.records.filter(data => data.isactive == 1);
}, },
error => { error => {
// this.notifier.notify('warning', 'No Category Records Found.!'); // this.notifier.notify('warning', 'No Category Records Found.!');
@ -422,7 +426,6 @@ export class SupplierInfoComponent implements OnInit {
) )
} }
// ================== // ==================
/** To Save/Edited Popup Data */ /** To Save/Edited Popup Data */
@ -479,6 +482,50 @@ export class SupplierInfoComponent implements OnInit {
} }
} }
selectedPersonDesignation(items,e,flag){
if(flag == 1){
e==1 ? items.controls['other_person_designation'].setValidators([Validators.required])
: items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
else if(flag == 2){
e==1 ?items.controls['other_person_designation'].setValidators([Validators.required])
:items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue('');
items.controls['other_person_designation'].updateValueAndValidity();
}
}
selectedPaymentTerms(items,e,flag){
if(flag == 2){
if(e==3){ items.controls['trade_product_credit_days_from'].setValidators([Validators.required]);
items.controls['trade_product_credit_days_to'].setValidators([Validators.required]);
}
else{
items.controls['trade_product_credit_days_from'].clearValidators();
items.controls['trade_product_credit_days_from'].setValue('');
items.controls['trade_product_credit_days_to'].clearValidators();
items.controls['trade_product_credit_days_to'].setValue('');
}
items.controls['trade_product_credit_days_from'].updateValueAndValidity();
items.controls['trade_product_credit_days_to'].updateValueAndValidity();
}
else if(flag == 1){
if(e==3){ items.controls['manufacturing_credit_days_from'].setValidators([Validators.required]);
items.controls['manufacturing_credit_days_to'].setValidators([Validators.required]);
}
else{
items.controls['manufacturing_credit_days_from'].clearValidators();
items.controls['manufacturing_credit_days_from'].setValue('');
items.controls['manufacturing_credit_days_to'].clearValidators();
items.controls['manufacturing_credit_days_to'].setValue('');
}
items.controls['manufacturing_credit_days_from'].updateValueAndValidity();
items.controls['manufacturing_credit_days_to'].updateValueAndValidity();
}
}
// { // {
// 'main_raw_materials': 'sdkjfal', // 'main_raw_materials': 'sdkjfal',
// 'supplier_details' ; [ // 'supplier_details' ; [