This commit is contained in:
venbatechnologies@gmail.com 2019-01-24 16:48:50 +05:30
commit 4d75e9b6f0
19 changed files with 1278 additions and 318 deletions

View File

@ -28,23 +28,23 @@
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-select (selectionChange)="selectedAssetsType($event,i,1)" placeholder="Assets Type" formControlName="assets_mode" requried> <mat-select (selectionChange)="selectedAssetsType($event,i,1)" placeholder="Assets Type" formControlName="assets_mode" requried>
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name | titlecase }}</mat-option> <mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<!--Desction Dynamic details: START--> <!--Desction Dynamic details: START-->
<div formArrayName="details" class="example-full-width"> <div formArrayName="details" class="example-full-width">
<!--Property--> <!--Property-->
<div *ngIf="sup.get('assets_mode').value == 1 "> <div *ngIf="sup.get('assets_mode').value == 2 ">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index"> <div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s"> <div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%"> <mat-form-field style="width:40%">
<mat-select placeholder="Property Type" formControlName="property_type" > <mat-select placeholder="Property Type" formControlName="property_type" >
<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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="detail.get('property_type').value == 5" style="width:40%"> <mat-form-field *ngIf="detail.get('property_type').value == 1" style="width:40%">
<input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off"> <input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
@ -52,7 +52,7 @@
</div> </div>
</div> </div>
<!--Four Wheeler--> <!--Four Wheeler-->
<div *ngIf="sup.get('assets_mode').value == 2"> <div *ngIf="sup.get('assets_mode').value == 3">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index"> <div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s"> <div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -67,7 +67,7 @@
</div> </div>
<!-- Eqipment Manufacturing --> <!-- Eqipment Manufacturing -->
<div *ngIf="sup.get('assets_mode').value == 3"> <div *ngIf="sup.get('assets_mode').value == 4">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index"> <div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s"> <div [formGroupName]="s">
@ -85,7 +85,7 @@
</div> </div>
</div> </div>
<!--jwell details --> <!--jwell details -->
<!--<div *ngIf="sup.get('assets_mode').value == 4"> <!--<div *ngIf="sup.get('assets_mode').value == 5">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index"> <div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s"> <div [formGroupName]="s">
@ -99,7 +99,7 @@
</div> </div>
</div>--> </div>-->
<!--Consumer Durable--> <!--Consumer Durable-->
<div *ngIf="sup.get('assets_mode').value == 5"> <!-- <div *ngIf="sup.get('assets_mode').value == 6">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index"> <div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s"> <div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -109,7 +109,7 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div> -->
<!--Insurance--> <!--Insurance-->
<div *ngIf="sup.get('assets_mode').value == 6"> <div *ngIf="sup.get('assets_mode').value == 6">
@ -122,10 +122,10 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:40%"> <mat-form-field style="width:40%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" > <mat-select placeholder="Frequency" formControlName="frequency_mode" >
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name | titlecase }}</mat-option> <mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('frequency_mode').value == 8 "> <mat-form-field style="width:40%" *ngIf="detail.get('frequency_mode').value == 1 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off"> <input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
@ -154,16 +154,16 @@
<mat-form-field style="width:40%"> <mat-form-field style="width:40%">
<mat-select placeholder="Type" formControlName="investments_type" > <mat-select placeholder="Type" formControlName="investments_type" >
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name | titlecase }}</mat-option> <mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('investments_type').value == 6"> <mat-form-field style="width:40%" *ngIf="detail.get('investments_type').value == 1">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off"> <input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:40%"> <mat-form-field style="width:40%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,10)"> <input matInput placeholder="Current Market Value" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,10)">
<!--<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>--> <!--<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>-->
@ -182,7 +182,7 @@
</div> </div>
<!--other assets--> <!--other assets-->
<div *ngIf="sup.get('assets_mode').value == 8"> <div *ngIf="sup.get('assets_mode').value == 1">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index"> <div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s"> <div [formGroupName]="s">
@ -193,26 +193,6 @@
</div> </div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%">
<!-- <mat-select placeholder="Name of the Owner"
formControlName="name_of_the_owner" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option>
</mat-select> -->
<mat-select placeholder="Name of the Owner"
formControlName="name_of_the_owner" [compareWith]="compareObjects" required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(sup.get('name_of_the_owner').value)===true" style="width:45%">
<input matInput placeholder="Specify Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
<!-- <mat-form-field style="width:40%"> <!-- <mat-form-field style="width:40%">
<mat-select placeholder="Relation" formControlName="relation" > <mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}" <mat-option value="{{relations.relationship_id}}"
@ -232,7 +212,7 @@
<mat-form-field style="width:40%"> <mat-form-field style="width:40%">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan"> <mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan">
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue | titlecase}}</mat-option> <mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
@ -242,12 +222,12 @@
</div> </div>
<!--Desction Dynamic details : END --> <!--Desction Dynamic details : END -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 4" style="width:40%"> <mat-form-field *ngIf="sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 5" style="width:40%">
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,2)"> <input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,2)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}} {{OtherAppxMarketAmtInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}} {{OtherAppxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:45%"> <mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5 || sup.get('assets_mode').value == 6" style="width:45%">
<!-- <mat-select placeholder="Name of the Owner" formControlName="name_of_the_owner" > <!-- <mat-select placeholder="Name of the Owner" formControlName="name_of_the_owner" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option> <mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option>
</mat-select> --> </mat-select> -->
@ -276,7 +256,7 @@
</mat-form-field> --> </mat-form-field> -->
</div> </div>
<span *ngIf="sup.get('assets_mode').value != ''"> <span *ngIf="sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 1">
<mat-form-field style="width:40%"> <mat-form-field style="width:40%">
@ -296,7 +276,7 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:95%"> <mat-form-field *ngIf="sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5 || sup.get('assets_mode').value == 6 || sup.get('assets_mode').value == 7" style="width:95%">
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="emi"> <mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="emi">
<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>
@ -317,7 +297,7 @@
<mat-card-actions> <mat-card-actions>
<div align="center"> <div align="center">
<button type="button" mat-flat-button (click)="addAssetDetails($event,1); false" <button type="button" mat-flat-button (click)="addAssetDetails($event,1); false"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last"> matTooltip="Add More" matTooltipPosition="above" color="primary" *ngIf="last">
<strong>Add More Other Asset </strong> <strong>Add More Other Asset </strong>
</button> </button>
</div> </div>

View File

@ -77,6 +77,7 @@ export class AssetsInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { @Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.applicants = this.pd_all_details.pdapplicants_detials; this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(val=>val.applicant_type==0 || val.applicant_type==1)
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.notifier = notifier; this.notifier = notifier;
} }
@ -106,27 +107,29 @@ export class AssetsInfoComponent implements OnInit {
// this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => { // this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
// this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ; // this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
// }); // });
this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ // this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){ // if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true); // this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true);
} // }
let modifyCompanyList : any=[]; // let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){ // if(this.existCompanyList.length>0){
modifyCompanyList = this.existCompanyList.map(element => { // modifyCompanyList = this.existCompanyList.map(element => {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; // return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
}); // });
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) // this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
} // }
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
} // })
}) // get applicant list
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
}
this.getPdSupplierFormDetails(); this.getPdSupplierFormDetails();
this.getM_Assets_Type(); this.getM_Assets_Type();
@ -143,7 +146,7 @@ export class AssetsInfoComponent implements OnInit {
getM_Assets_Type() { getM_Assets_Type() {
this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe( this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe(
data => { data => {
this.m_assets_type = data.records.filter(data => data.isactive == 1); this.m_assets_type = data.records.filter(data => data.isactive == 1 && data.id != 4);
}, },
error => { error => {
this.notifier.notify('warning', 'No Category Records Found.!'); this.notifier.notify('warning', 'No Category Records Found.!');
@ -298,35 +301,35 @@ export class AssetsInfoComponent implements OnInit {
switch (e.value) { switch (e.value) {
case '1': { case '1': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray ;
control.push(this.otherAssetsDescription());
break;
}
case '2': {
let val = i; let val = i;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadProperty()); control.push(this.loadProperty());
break; break;
} }
case '2': { case '3': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.load_Four_Weeler()); control.push(this.load_Four_Weeler());
break; break;
} }
case '3': { case '4': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadEquipmentManufacturingDescription()); control.push(this.loadEquipmentManufacturingDescription());
break; break;
} }
case '4': { case '5': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
//control.push(this.loadJwellDescription()); //control.push(this.loadJwellDescription());
break; break;
} }
case '5': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadConsumerDurableDescription());
break;
}
case '6': { case '6': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
@ -339,11 +342,7 @@ export class AssetsInfoComponent implements OnInit {
control.push(this.loadInvestDescription()); control.push(this.loadInvestDescription());
break; break;
} }
case '8': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray ;
control.push(this.otherAssetsDescription());
break;
}
default: { default: {
break; break;
} }
@ -379,8 +378,8 @@ export class AssetsInfoComponent implements OnInit {
otherAssetsDescription() { otherAssetsDescription() {
return this._formBuilder.group({ return this._formBuilder.group({
any_other_assets: [''], any_other_assets: [''],
name_of_the_owner:[''], //name_of_the_owner:[''],
other_owner:[''], //other_owner:[''],
//relation:[''], //relation:[''],
any_other_asset_value : [''], any_other_asset_value : [''],
any_other_asset_loan : [''], any_other_asset_loan : [''],
@ -411,7 +410,7 @@ export class AssetsInfoComponent implements OnInit {
return this._formBuilder.group({ return this._formBuilder.group({
investments_type: [''], investments_type: [''],
other_investments_type:[''], other_investments_type:[''],
amount_of_invest: [], amount_of_invest: [''],
bank_name: [''] bank_name: ['']
}); });
} }
@ -456,8 +455,8 @@ export class AssetsInfoComponent implements OnInit {
otherAssetsDescriptionWithData(data) { otherAssetsDescriptionWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
any_other_assets: [data.any_other_assets], any_other_assets: [data.any_other_assets],
name_of_the_owner:[data.name_of_the_owner], // name_of_the_owner:[data.name_of_the_owner],
other_owner:[data.other_owner], // other_owner:[data.other_owner],
// relation:[data.relation], // relation:[data.relation],
any_other_asset_value : [data.any_other_asset_value], any_other_asset_value : [data.any_other_asset_value],
any_other_asset_loan : [data.any_other_asset_loan], any_other_asset_loan : [data.any_other_asset_loan],
@ -584,6 +583,22 @@ export class AssetsInfoComponent implements OnInit {
switch (assets_details_mode) { switch (assets_details_mode) {
case '1': { case '1': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'any_other_assets': datas.any_other_assets,
'name_of_the_owner':datas.name_of_the_owner,
'other_owner':datas.other_owner,
//'relation':datas.relation,
'any_other_asset_value' : datas.any_other_asset_value,
'any_other_asset_loan' : datas.any_other_asset_loan,
};
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value);
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.otherAssetsDescriptionWithData(array_data));
break;
}
case '2': {
let array_data : any; let array_data : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type };
@ -592,7 +607,7 @@ export class AssetsInfoComponent implements OnInit {
control.push(this.loadPropertyWithData(array_data)); control.push(this.loadPropertyWithData(array_data));
break; break;
} }
case '2': { case '3': {
let array_data : any; let array_data : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
array_data = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle }; array_data = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle };
@ -601,7 +616,7 @@ export class AssetsInfoComponent implements OnInit {
control.push(this.load_Four_WeelerWithData(array_data)); control.push(this.load_Four_WeelerWithData(array_data));
break; break;
} }
case '3': { case '4': {
let array_data : any; let array_data : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
array_data = { 'equipment_manufacturing_description': datas.equipment_manufacturing_description }; array_data = { 'equipment_manufacturing_description': datas.equipment_manufacturing_description };
@ -610,20 +625,12 @@ export class AssetsInfoComponent implements OnInit {
control.push(this.loadEquipmentManufacturingDescriptionWithData(array_data)); control.push(this.loadEquipmentManufacturingDescriptionWithData(array_data));
break; break;
} }
case '4': { case '5': {
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
//control.push(this.loadJwellDescriptionWithData(data)); //control.push(this.loadJwellDescriptionWithData(data));
break; break;
} }
case '5': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'consumer_durable_description': datas.consumer_durable_description };
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadConsumerDurableDescriptionWithData(array_data));
break;
}
case '6': { case '6': {
let array_data : any; let array_data : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
@ -654,22 +661,7 @@ export class AssetsInfoComponent implements OnInit {
control.push(this.loadInvestDescriptionWithData(array_data)); control.push(this.loadInvestDescriptionWithData(array_data));
break; break;
} }
case '8': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'any_other_assets': datas.any_other_assets,
'name_of_the_owner':datas.name_of_the_owner,
'other_owner':datas.other_owner,
//'relation':datas.relation,
'any_other_asset_value' : datas.any_other_asset_value,
'any_other_asset_loan' : datas.any_other_asset_loan,
};
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value);
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.otherAssetsDescriptionWithData(array_data));
break;
}
default: { default: {
break; break;
} }

View File

@ -160,9 +160,9 @@
</div> </div>
</div> </div>
<mat-action-row> <mat-action-row>
<div align="center"> <div fxFlex="100" align="center">
<button type="button" mat-button (click)="addBankdetails(i, $event)" color="accent" <button type="button" mat-flat-button color="primary" (click)="addBankdetails(i, $event)"
matTooltip="Add More" matTooltipPosition="left" *ngIf="last"> matTooltip="Add More" matTooltipPosition="above" *ngIf="last">
<strong>Add More Banking Details</strong> <strong>Add More Banking Details</strong>
</button> </button>
</div> </div>

View File

@ -55,6 +55,8 @@ export class BankingDetailsComponent implements OnInit {
this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase(); this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.pd_cus_segment = this.pd_cus_segment.substring(0,3); this.pd_cus_segment = this.pd_cus_segment.substring(0,3);
this.applicants = this.pd_all_details.pdapplicants_detials; this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants = this.applicants.filter(val=>val.applicant_type==0 || val.applicant_type==1)
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.notifier = notifier; this.notifier = notifier;
@ -83,29 +85,14 @@ export class BankingDetailsComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.step = 0; this.step = 0;
this.initBankingForm(); this.initBankingForm();
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ let modifyApplicantList: any=[];
if(data.dataStatus){ if(this.applicants.length > 0){
this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true); modifyApplicantList = this.applicants.map(element => {
} return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
let modifyCompanyList : any=[]; }
if(this.existCompanyList.length>0){
modifyCompanyList = this.existCompanyList.map(element => {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
});
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
}
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
}
})
this.getM_AccountType(); this.getM_AccountType();
this.getM_BTLenderList(); this.getM_BTLenderList();

View File

@ -205,7 +205,7 @@
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{appxMarketAmtInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{appxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5" style="width:45%"> <mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4" style="width:45%">
<mat-select placeholder="Asset Owned by" <mat-select placeholder="Asset Owned by"
formControlName="business_name_of_the_owner" [compareWith]="compareObjects" required> formControlName="business_name_of_the_owner" [compareWith]="compareObjects" required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName"> <mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
@ -218,22 +218,20 @@
<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%">
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner" autocomplete="off"> <input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner" autocomplete="off">
</mat-form-field> --> </mat-form-field>
<!-- {{applicants | json}} --> <!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4" style="width:45%">
<!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5 || sup.get('business_assets_mode').value == 6" style="width:45%"> -->
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4" style="width:45%">
<mat-select placeholder="Asset Owned by" formControlName="business_name_of_the_owner" required> <mat-select placeholder="Asset Owned by" formControlName="business_name_of_the_owner" required>
<mat-option *ngFor="let status of applicants" [value]="status.pd_co_applicant_id">{{ status.applicant_name }}</mat-option> <mat-option *ngFor="let status of applicants" [value]="status.pd_co_applicant_id">{{ status.applicant_name }}</mat-option>
</mat-select> </mat-select>
</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%">
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner" autocomplete="off"> <input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner" autocomplete="off">
</mat-form-field> </mat-form-field> -->
</div> </div>
<span *ngIf="sup.get('business_assets_mode').value != ''"> <span *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3">
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<mat-label>Vintage</mat-label> <mat-label>Vintage</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage" minlength="1" maxlength="3" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,1)"> <input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage" minlength="1" maxlength="3" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,1)">

View File

@ -85,7 +85,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
// }); // });
this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){ if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true); this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true && val.company_order_id==this.company_id);
} }
let modifyCompanyList : any=[]; let modifyCompanyList : any=[];
@ -95,14 +95,14 @@ export class BusinessAssetsInfoComponent implements OnInit {
}); });
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
} }
let modifyApplicantList: any=[]; // let modifyApplicantList: any=[];
if(this.applicants.length > 0){ // if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => { // modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2}; // return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
}); // });
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList}) // this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
} // }
}) })
this.getPdSupplierFormDetails(); this.getPdSupplierFormDetails();
@ -165,7 +165,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
//Get Data Based on PDID and FORMID //Get Data Based on PDID and FORMID
apiLoadFinish: boolean = false; apiLoadFinish: boolean = false;
getPdSupplierFormDetails() { getPdSupplierFormDetails() {
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '22').subscribe( this.pdTrigerService.getPDFormDetailsWithCompanyID(this.pdid, '22',this.company_id).subscribe(
data => { data => {
if (data) { if (data) {
if (data.dataStatus) { if (data.dataStatus) {
@ -589,11 +589,11 @@ export class BusinessAssetsInfoComponent implements OnInit {
this.freqPurchaseTextBox = e.value; this.freqPurchaseTextBox = e.value;
} }
// // 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)
// return true; return true;
// else return false else return false
// } }
// // check others // // check others
checkOthers(values){ checkOthers(values){

View File

@ -0,0 +1,240 @@
<form [formGroup]="bankingForm" class="bankForm">
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Questions">
<mat-card>
<mat-card-content>
<div formArrayName="itemRows" autocomplete="off">
<mat-accordion
*ngFor="let itemrow of bankingForm.controls.itemRows['controls']; let i=index;let last=last"
[formGroupName]="i">
<mat-expansion-panel class="banlFields" [expanded]="step == i">
<mat-expansion-panel-header>
<mat-panel-title>
<p>Banking Details #{{i+1}}
</p>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name" [compareWith]="compareObjects">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true" style="width:45%">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant" autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name" >
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('bank_name').value == 3">
<input matInput placeholder="Specify Bank Name"
formControlName="other_bank" autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)" placeholder="Account Type" formControlName="account_type" >
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<mat-select placeholder="Is this the main business account"
formControlName="is_main" >
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<div fxLayout="row" fxLayoutAlign="start none">
<mat-form-field style="width: 35%;" *ngIf="salaryField">
<mat-select placeholder="Salary Credited in this account"
formControlName="salary" >
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
<mat-option value="NA">NA</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]"> <!-- *ngIf="itemrow.get('account_type').value != 2"> -->
<input matInput autocomplete="off" placeholder="Limit in case of OD / CC account"
formControlName="limit" (keypress)="keyPress($event)" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
<div>
<label>Number of Years / Months since account was started</label>
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="vintage_year" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="vintage_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(itemrow,$event.target.value)">
</mat-form-field>
</div>
</div>
<mat-action-row>
<div fxFlex="100" align="center">
<button type="button" mat-flat-button color="primary" (click)="addBankdetails(i, $event)"
matTooltip="Add More" matTooltipPosition="above" *ngIf="last">
<strong>Add More Banking Details</strong>
</button>
</div>
<!-- <button type="button" mat-button (click)="deleteBankdetails(i)" color="warn"
matTooltip="Delete"matTooltipPosition="left" *ngIf="!last">
<strong>Delete Banking Details</strong>
</button> -->
<!-- <button mat-button color="warn" (click)="prevStep()">Previous</button>
<button mat-button color="primary" (click)="nextStep()">End</button> -->
<!-- ngIf="i > 0" -->
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Banking Details" matTooltipPosition="above" (click)="deleteBankdetails(i)" *ngIf="!last">
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-action-row>
</mat-expansion-panel>
<!-- <div style="text-align: right;" class="pt-1" *ngIf="bankingForm.controls.itemRows['controls'].length == (i+1)">
<button class="mr-1 mb-1 hover-icon" color="primary" mat-raised-button mat-icon-button matTooltip="Add More Banking Details" matTooltipPosition="above" >
<mat-icon >add</mat-icon>
</button></div> -->
</mat-accordion>
</div>
</mat-card-content>
</mat-card>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="banking_form_remark" ></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button class="mr-1 mb-1 hover-icon" type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="bankSubmit()"><mat-icon>save</mat-icon>
</button>
</div>
</mat-dialog-actions>
</form>
<notifier-container></notifier-container>

View File

@ -0,0 +1,102 @@
.banlFields mat-form-field {
width: 27%;
margin: 0 2%;
}
.bankForm .button {
float: right;
width: 10px;
background: #62B013;
color: white;
}
.mat-form-field-appearance-legacy .mat-hint{
color:rgba(0, 0, 0, 0.8) !important;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
.mat-card-content {
background-color: white;
}
.mat-card-actions {
background-color: white;
}
mat-form-field {
margin: 0 2%;
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
$product-bg-color-hover: rgba(103, 58, 183, 0.7);
.p-list-main {
background: white;
margin: auto;
position: relative;
overflow: hidden !important;
border-radius: 10px 10px 10px 10px;
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
&:hover {
transform: scale(1);
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
}
.p-list {
position: relative;
.top {
height: 100%;
width: 100%;
// background: url(https://s-media-cache-ak0.pinimg.com/736x/49/80/6f/49806f3f1c7483093855ebca1b8ae2c4.jpg) no-repeat center center;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
}
.bottom {
width: 200%;
height: 15%;
transition: transform 0.5s;
h1 {
margin: 0;
padding: 0;
}
p {
margin: 0;
padding: 0;
}
.left {
height: 100%;
width: 50%;
background: #f4f4f4;
position: relative;
float: left;
.details {
padding: 5px;
float: left;
// width: calc(70% - 40px);
}
}
.right {
width: 50%;
background: #A6CDDE;
color: white;
float: right;
height: 200%;
overflow: hidden;
.details {
padding: 20px;
float: right;
width: calc(70% - 40px);
}
}
}
}
}

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BusinessBankingDetailsComponent } from './business-banking-details.component';
describe('BusinessBankingDetailsComponent', () => {
let component: BusinessBankingDetailsComponent;
let fixture: ComponentFixture<BusinessBankingDetailsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BusinessBankingDetailsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BusinessBankingDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,327 @@
import {
Component,
OnInit,
Inject,
Input
} from '@angular/core';
import {
FormBuilder,
FormGroup,
Validators,
FormArray, FormControl, AbstractControl,
} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import {
MatDialog,
MatDialogRef,
MAT_DIALOG_DATA
} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from "@angular/router";
@Component({
selector: 'app-business-banking-details',
templateUrl: './business-banking-details.component.html',
styleUrls: ['./business-banking-details.component.scss']
})
export class BusinessBankingDetailsComponent implements OnInit {
pdid: number;
pageTitle: string ="Banking Information";
public bankingForm: FormGroup;
step: number;
private notifier: NotifierService;
public pd_cus_segment:string;
public applicants: any;
m_accountType= [];
m_btLenderList = [];
salaryField : boolean;
OtherFlag : any = [];
limitCaseFlag : any = [];
amtInwords : any = [];
emiAmtInwords : any = [];
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
company_id: String;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
private _pd: PdTrigerService,
private dialogRef: MatDialogRef<BusinessBankingDetailsComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.pd_cus_segment = this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
this.pd_cus_segment = this.pd_cus_segment.substring(0,3);
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.notifier = notifier;
this.company_id = this.pd_all_details.company_id;
}
public viewerOptions: any = {
navbar: false,
toolbar: {
zoomIn: 4,
zoomOut: 4,
oneToOne: 4,
reset: 4,
prev: 4,
play: {
show: 4,
size: 'large',
},
next: 4,
rotateLeft: 4,
rotateRight: 4,
flipHorizontal: 4,
flipVertical: 4,
}
};
ngOnInit() {
this.step = 0;
this.initBankingForm();
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true && val.company_order_id==this.company_id);
}
let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){
modifyCompanyList = this.existCompanyList.map(element => {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
});
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
}
})
this.getM_AccountType();
this.getM_BTLenderList();
this.salaryField = this.pd_cus_segment.substring(0,2) == 'SE' ? false : true ;
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '21';
params.company_id = this.company_id;
this._pd.retriveForm(params).subscribe(data => {
// console.log('data', data);
const control = <FormArray>this.bankingForm.controls['itemRows'];
if (data.status == 200) {
this.bankingForm.controls.banking_form_remark.setValue(data.records.banking_form_remark);
var result = Object.keys(data.records.banking_details).map(function (key) {
return data.records.banking_details[key];
});
if (result.length == 0) {
control.push(this.createBankarray());
} else {
result.forEach((datas,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit);
// this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(+datas.account_type,index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
control.push(this.createBankarray());
});
this.bankingForm.controls.itemRows.setValue(result);
}
} else {
control.push(this.createBankarray());
}
});
}
// ======================
getM_AccountType() {
this._pd.getAllMasterDatas('ACCOUNTTYPE').subscribe(
data => {
this.m_accountType = data.records.filter(data => data.isactive == 1);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
getM_BTLenderList(){
this._pd.getAllMasterDatas('BTLENDERLIST').subscribe(
data => {
this.m_btLenderList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1);
})
}
public initBankingForm(): void {
this.bankingForm = this.fb.group({
banking_form_remark: [''],
itemRows: this.fb.array([])
});
}
createBankarray() {
return this.fb.group({
applicant_name: [''],
other_applicant : [''],
bank_name: [''],
other_bank: [''],
account_type: [''],
//salary: [''],
salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : [''],
limit: [''],
//is_main: [''],
//is_main: [this.pd_cus_segment == 'SAL' ? '' : ''],
//is_main:[''],
is_main: this.pd_cus_segment == 'SAL' ? [''] : [''],
vintage_year: [''],
vintage_month: [''],
});
}
addBankdetails(index, event) {
event.stopPropagation();
const control = <FormArray>this.bankingForm.controls['itemRows'];
let length = control.length;
this.step = length;
control.push(this.createBankarray());
// if(this.pd_cus_segment != 'SAL') {
// this.bankingForm.controls.is_main.setValidators([Validators.required]);
// this.bankingForm.controls.is_main.updateValueAndValidity();
// }
}
deleteBankdetails(index: number) {
// console.log('index value -', index);
const control = <FormArray>this.bankingForm.controls['itemRows'];
control.removeAt(index);
}
setStep(index: number) {
this.step = index;
}
bankSubmit() {
let records: any = {};
records.pdid = this.pdid;
records.formid = '21';
records.company_id = this.company_id; records.banking_form_remark = this.bankingForm.controls.banking_form_remark.value;
// records.fk_createdby = '252';
records.banking_details = this.bankingForm.controls['itemRows'].value;
// console.log('data', records);
this._pd.saveForm(records).subscribe(data => {
if(data.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
// this.dialogRef.close();
setTimeout(() =>{
this.dialogRef.close();
},3000);
}
else{
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
if (control instanceof FormControl) {
control.markAsTouched({onlySelf: true});
} else if (control instanceof FormGroup) {
this.validateAllFormFields(control);
}
});
}
// selectedBorrower(e,i){
// if(e == 0){
// this.OtherFlag[i] = true;
// }
// else{
// this.OtherFlag[i] = false;
// }
// }
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
// check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
}
else {
return false;
}
}
selectedAccTypeChanges(event: any,i){
if(event == 2 || event == 1) {
this.limitCaseFlag[i] = false;
// const control = <FormArray>this.bankingForm.controls['itemRows'];
// control.controls[0].get('limit').clearValidators();
// control.controls[0].get('limit').updateValueAndValidity();
}
else{
this.limitCaseFlag[i] = true;
}
}
/** To Convert Month into Year */
ConvertMonthintoYear(itemrow,e){
//console.log(itemrow);
let year = itemrow.controls.vintage_year.value;
let converted_month : number = e%12;
let converted_year : number = e/12;
itemrow.controls.vintage_year.setValue(+year + +Math.floor(converted_year));
itemrow.controls.vintage_month.setValue(Math.floor(converted_month));
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
/** On Key Press Event For Numbers */
keyPress(event: any) {
const pattern = /[0-9]/;
let inputChar = String.fromCharCode(event.charCode);
if (event.keyCode != 8 && !pattern.test(inputChar)) {
event.preventDefault();
}
}
}

View File

@ -10,7 +10,7 @@ import {StockComponent} from './../../forms/stock/stock.component';
import {FinancialInfoComponent} from './../../forms/financial-info/financial-info.component'; import {FinancialInfoComponent} from './../../forms/financial-info/financial-info.component';
import {BusinessInfoComponent} from './../../forms/business-info/business-info.component'; import {BusinessInfoComponent} from './../../forms/business-info/business-info.component';
import { BusinessAssetsInfoComponent } from './../../forms/business-assets-info/business-assets-info.component'; import { BusinessAssetsInfoComponent } from './../../forms/business-assets-info/business-assets-info.component';
import { BusinessBankingDetailsComponent } from './../../forms/business-banking-details/business-banking-details.component';
@Component({ @Component({
selector: 'app-business-info-group', selector: 'app-business-info-group',
templateUrl: './business-info-group.component.html', templateUrl: './business-info-group.component.html',
@ -129,6 +129,19 @@ export class BusinessInfoGroupComponent implements OnInit {
this.getCompanyListForBusiness(); this.getCompanyListForBusiness();
}); });
} }
else if(details.form_id==21) {
const dialogRef = this.dialog.open(BusinessBankingDetailsComponent, {
data: this.pd_all_details,
position: { right: '0'},
width:'80%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.getCompanyListForBusiness();
});
}
} }

View File

@ -745,15 +745,19 @@
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required> <input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
</mat-form-field> </mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addWholesaleMoreState(w,'2')" *ngIf="c==0"
matTooltip="Add More Country" matTooltipPosition="right" color="primary">
<mat-icon>add</mat-icon>
</button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeWholesaleState(w,c,'2')" *ngIf="c>0" <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeWholesaleState(w,c,'2')" *ngIf="c>0"
matTooltip="Remove Country" matTooltipPosition="right"> matTooltip="Remove Country" matTooltipPosition="right">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
<div fxLayout="row" class="tab_class">
<div fxFlex="100" align="center">
<button type="button" mat-flat-button (click)="addWholesaleMoreState(w,'2')"
matTooltip="Add More Country" matTooltipPosition="right" color="primary">
<strong>Add More Country</strong>
</button>
</div>
</div>
</div> </div>
</ng-container> </ng-container>
<ng-container *ngIf="wholesale.value.countries_where_export_done !=undefined && wholesale.value.india_where_sale_done !=undefined"> <ng-container *ngIf="wholesale.value.countries_where_export_done !=undefined && wholesale.value.india_where_sale_done !=undefined">
@ -1130,6 +1134,27 @@
</mat-form-field> </mat-form-field>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
<mat-card *ngIf="businessForm.controls['applicant_use_mobile_wallets'] || businessForm.controls['applicant_use_pos_machines']">
<mat-card-header>
<mat-card-title>Digital Payments</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width:84%;" *ngIf="businessForm.controls['applicant_use_mobile_wallets']">
<mat-select placeholder="Does the Applicant Use Mobile Wallets / UPI Apps" formControlName="applicant_use_mobile_wallets">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="businessForm.controls['applicant_use_pos_machines']">
<mat-select placeholder="Does the Applicant Use POS Machines in His Business / Profession" formControlName="applicant_use_pos_machines">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</mat-card-content>
</mat-card>
<mat-card> <mat-card>
<mat-card-title>Seasonality</mat-card-title> <mat-card-title>Seasonality</mat-card-title>
@ -1291,16 +1316,24 @@
<input matInput placeholder="Specify Document Details" <input matInput placeholder="Specify Document Details"
formControlName="document"> formControlName="document">
</mat-form-field> </mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addDocuments()"
matTooltip="Add More Document Details" matTooltipPosition="above" color="primary" *ngIf="i==0">
<mat-icon>add</mat-icon>
</button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="deleteDocuments(i)" <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="deleteDocuments(i)"
matTooltip="Delete" matTooltipPosition="above" *ngIf="i>0"> matTooltip="Delete" matTooltipPosition="above" *ngIf="i>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</div> </div>
<div fxLayout="row">
<div fxFlex="100" align="center">
<button type="button" class="mr-1 mb-1 hover-icon" mat-flat-button (click)="addDocuments()"
matTooltip="Add More" matTooltipPosition="above">
<strong>Add More Document</strong>
</button>
</div>
</div>
</div> </div>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
<mat-card> <mat-card>

View File

@ -324,6 +324,8 @@ export class BusinessInfoComponent implements OnInit {
}); });
if(selectedRetail.length > 0) { if(selectedRetail.length > 0) {
selectedRetail.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert'); selectedRetail.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert');
selectedRetail.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets');
selectedRetail.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines');
selectedRetail.forEach((element,index)=>{ selectedRetail.forEach((element,index)=>{
retailControl.push(this.createActivity()); retailControl.push(this.createActivity());
if(element.area_of_sale=='Within India'){ if(element.area_of_sale=='Within India'){
@ -383,6 +385,8 @@ export class BusinessInfoComponent implements OnInit {
}); });
if(selectedWholesale.length > 0) { if(selectedWholesale.length > 0) {
selectedWholesale.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert'); selectedWholesale.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert');
selectedWholesale.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets');
selectedWholesale.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines');
selectedWholesale.forEach((element,index)=>{ selectedWholesale.forEach((element,index)=>{
wholesaleControl.push(this.createActivity()); wholesaleControl.push(this.createActivity());
if(element.area_of_sale=='Within India'){ if(element.area_of_sale=='Within India'){
@ -444,7 +448,8 @@ export class BusinessInfoComponent implements OnInit {
}); });
if(selectedService.length > 0) { if(selectedService.length > 0) {
selectedService.length > 0 ? this.businessForm.addControl('practice_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('practice_cert'); selectedService.length > 0 ? this.businessForm.addControl('practice_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('practice_cert');
selectedService.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets');
selectedService.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines');
selectedService.forEach((element,index)=>{ selectedService.forEach((element,index)=>{
serviceProviderControl.push(this.createServiceActivity()); serviceProviderControl.push(this.createServiceActivity());
if(element.area_of_sale=='Within India'){ if(element.area_of_sale=='Within India'){
@ -659,6 +664,12 @@ export class BusinessInfoComponent implements OnInit {
this.businessForm.value.manufacturing_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('export_import_cert', new FormControl(this.businessForm.value.export_import_cert, Validators.required)) : this.businessForm.removeControl('export_import_cert'); this.businessForm.value.manufacturing_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('export_import_cert', new FormControl(this.businessForm.value.export_import_cert, Validators.required)) : this.businessForm.removeControl('export_import_cert');
this.businessForm.value.manufacturing_activity_details.length > 0 ? this.businessForm.addControl('factory_cert', new FormControl(this.businessForm.value.factory_cert, Validators.required)) : this.businessForm.removeControl('factory_cert'); this.businessForm.value.manufacturing_activity_details.length > 0 ? this.businessForm.addControl('factory_cert', new FormControl(this.businessForm.value.factory_cert, Validators.required)) : this.businessForm.removeControl('factory_cert');
this.businessForm.value.service_provider_activity_details.length > 0 ? this.businessForm.addControl('practice_cert', new FormControl(this.businessForm.value.practice_cert, Validators.required)) : this.businessForm.removeControl('practice_cert'); this.businessForm.value.service_provider_activity_details.length > 0 ? this.businessForm.addControl('practice_cert', new FormControl(this.businessForm.value.practice_cert, Validators.required)) : this.businessForm.removeControl('practice_cert');
// check activity for extra question make dynamic
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');
} }
// change area of sale options in manufacturing // change area of sale options in manufacturing

View File

@ -16,35 +16,60 @@
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index" [formGroupName]="l"> <div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index" [formGroupName]="l">
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Product #{{l+1}}</h6> <h6 style="margin: 12px;padding:10px !important;">Product #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!--<pre>{{m_manufacturingProducts[0] | json}}</pre>--> <mat-form-field style="width:45%">
<mat-form-field style="width:30%">
<!--{{m_manufacturingProducts[0] | json}}-->
<mat-select placeholder="Manufacturing Product Name" formControlName="manufacturing_product_name"> <mat-select placeholder="Manufacturing Product Name" formControlName="manufacturing_product_name">
<mat-option *ngFor="let pm of m_manufacturingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_manufacturingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<!--<mat-form-field style="width: 100%"> <!--<mat-form-field style="width: 100%">
<input matInput placeholder="Raw Material Name" formControlName="manufacturing_raw_material_name"> <input matInput placeholder="Raw Material Name" formControlName="manufacturing_raw_material_name">
</mat-form-field>--> </mat-form-field>-->
<mat-form-field style="width: 30%"> <mat-form-field style="width: 45%">
<input matInput placeholder="Client Name" formControlName="manufacturing_client_name"> <input matInput placeholder="Client Name" formControlName="manufacturing_client_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> </div>
<input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name"> <div fxLayout="row nowrap">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<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-select placeholder="Contact Person Designation" formControlName="person_designation">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<mat-option value="1" > Not Applicable </mat-option>
</mat-select>
</mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 30%"> <mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number"> <input matInput placeholder="Client Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> <mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)">
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)">
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<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>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%" *ngIf="items.get('manufacturing_payment_type').value == 3"> <mat-form-field style="width: 45%" *ngIf="items.get('manufacturing_payment_type').value == 3">
<input matInput placeholder="Number of days of credit provided" formControlName="manufacturing_credit_days"> <input matInput placeholder="No. of Days of Credit Given for Payment Receipt" formControlName="manufacturing_credit_days">
</mat-form-field> </mat-form-field>
</div> </div>
<div align="end"> <div align="end">
@ -55,17 +80,20 @@
</mat-card> </mat-card>
</div> </div>
</div> </div>
<div> <div fxlayout="row">
<mat-form-field style="width: 100%"> <div fxFlex="100" align="center">
<input matInput placeholder="% of total manufacturing raw materials credit values" formControlName="main_raw_materials_total_payments_percent_on_credit" <button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above" type="button"
class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><strong>Add More Client</strong></button>
</div>
</div>
<div fxlayout="row">
<mat-form-field style="width: 80%">
<input matInput placeholder="% of Total Manufacturing Raw Materials Credit Values" formControlName="main_raw_materials_total_payments_percent_on_credit"
type="number"> type="number">
</mat-form-field> </mat-form-field>
<div fxFlex="100" align="end">
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Supplier Details" matTooltipPosition="above"
class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><mat-icon>add</mat-icon></button>
</div>
</div> </div>
</div>
</div>
</div> </div>
</mat-card> </mat-card>
<mat-card *ngIf="tradingForm"> <mat-card *ngIf="tradingForm">
@ -76,8 +104,8 @@
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index" [formGroupName]="l"> <div *ngFor="let items of item.controls.trading_products['controls']; let l=index" [formGroupName]="l">
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Trading Product #{{l+1}}</h6> <h6 style="margin: 12px;padding:10px !important;">Trading Product #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 30%"> <mat-form-field style="width: 45%">
<mat-select placeholder="Trading Product Name" formControlName="trade_product_name"> <mat-select placeholder="Trading Product Name" formControlName="trade_product_name">
<mat-option *ngFor="let pm of m_tradingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_tradingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
@ -85,24 +113,51 @@
<!--<mat-form-field style="width: 100%"> <!--<mat-form-field style="width: 100%">
<input matInput placeholder="Trade Product Name" formControlName="trade_product_name"> <input matInput placeholder="Trade Product Name" formControlName="trade_product_name">
</mat-form-field>--> </mat-form-field>-->
<mat-form-field style="width: 30%"> <mat-form-field style="width: 45%">
<input matInput placeholder="Client Name" formControlName="trade_client_name"> <input matInput placeholder="Client Name" formControlName="trade_client_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> </div>
<input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%">
<input matInput placeholder="Client Contact Person Name" formControlName="trade_product_contact_person_name">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<mat-option value="1" > Not Applicable </mat-option>
</mat-select>
</mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 30%"> <mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number" (keypress)="keyPress($event)"> <input matInput placeholder="Client Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> <mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)">
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<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>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%" *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="Number of days of credit provided" 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 align="end"> <div align="end">
@ -113,16 +168,18 @@
</mat-card> </mat-card>
</div> </div>
</div> </div>
<div> <div fxlayout="row">
<mat-form-field style="width: 100%"> <div fxFlex="100" align="center">
<input matInput placeholder="% of total trading product credit values" formControlName="trading_products_total_payments_percent_on_credit" <button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above" type="button"
type="number"> class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><strong>Add More Client</strong></button>
</mat-form-field> </div>
<div fxFlex="100" align="end"> </div>
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Supplier Details" matTooltipPosition="above" <div fxlayout="row">
class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><mat-icon>add</mat-icon></button> <mat-form-field style="width: 80%">
</div> <input matInput placeholder="% of Total Trading Product Credit Values" formControlName="trading_products_total_payments_percent_on_credit"
</div> type="number">
</mat-form-field>
</div>
</div> </div>
</div> </div>
</mat-card> </mat-card>
@ -136,32 +193,58 @@
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Service Provided #{{l+1}}</h6> <h6 style="margin: 12px;padding:10px !important;">Service Provided #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 45%">
<mat-select placeholder="Select the Service Provided" formControlName="service_provider_product_name"> <mat-select placeholder="Select the Service Provided" formControlName="service_provider_product_name">
<mat-option *ngFor="let pm of m_suplierProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_suplierProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%">
<input matInput placeholder="Client Name" formControlName="service_provider_client_name">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!--<mat-form-field style="width: 100%"> <!--<mat-form-field style="width: 100%">
<input matInput placeholder="Trade Product Name" formControlName="trade_product_name"> <input matInput placeholder="Trade Product Name" formControlName="trade_product_name">
</mat-form-field>--> </mat-form-field>-->
<mat-form-field style="width: 30%"> <mat-form-field style="width: 15%">
<input matInput placeholder="Client Name" formControlName="service_provider_client_name"> <mat-select placeholder="Title" formControlName="person_title_name">
</mat-form-field> <mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
<mat-form-field style="width: 30%"> {{tl.name}}
<input matInput placeholder="Contact Person Name" formControlName="service_provider_product_contact_person_name"> </mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<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-select placeholder="Contact Person Designation" formControlName="person_designation">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<mat-option value="1" > Not Applicable </mat-option>
</mat-select>
</mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 30%"> <mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="service_provider_product_contact_person_mobile_number"> <input matInput placeholder="Client Contact Person Mobile Number" formControlName="service_provider_product_contact_person_mobile_number">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> <mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)">
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Client Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<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>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%" *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="Number of days of credit provided" 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 align="end"> <div align="end">
@ -172,17 +255,20 @@
</mat-card> </mat-card>
</div> </div>
</div> </div>
<div> <div fxlayout="row">
<mat-form-field style="width: 100%"> <div fxFlex="100" align="center">
<input matInput placeholder="What % of total services provided are on credit?" formControlName="service_products_total_payments_percent_on_credit" <button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above" type="button"
type="number"> class="mr-1 mb-1 hover-icon" (click)="addMoreServiceProduct($event); false"><strong>Add More Client</strong></button>
</mat-form-field> </div>
<div fxFlex="100" align="end"> </div>
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Supplier Details" matTooltipPosition="above" <div fxlayout="row">
class="mr-1 mb-1 hover-icon" (click)="addMoreServiceProduct($event); false"><mat-icon>add</mat-icon></button> <mat-form-field style="width: 80%">
</div> <input matInput placeholder="What % of Total Services Provided Are on Credit?" formControlName="service_products_total_payments_percent_on_credit"
type="number">
</mat-form-field>
</div>
</div> </div>
</div>
</div> </div>
</mat-card> </mat-card>
<mat-card *ngIf="retaildTradingForm"> <mat-card *ngIf="retaildTradingForm">

View File

@ -41,7 +41,8 @@ export class ClientInfoComponent implements OnInit {
public m_paymentModeType = []; public m_paymentModeType = [];
private notifier: NotifierService; private notifier: NotifierService;
companyRelationShipList: any=[];
titleList: any=[];
public m_manufacturingProducts = [ public m_manufacturingProducts = [
{ {
@ -75,7 +76,7 @@ export class ClientInfoComponent implements OnInit {
notifier: NotifierService, notifier: NotifierService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private pdTrigerService: PdTrigerService, private pdTrigerService: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { @Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialogRef: MatDialogRef<ClientInfoComponent>) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 2; this.form_id = 2;
this.company_id = this.pd_all_details.company_id; this.company_id = this.pd_all_details.company_id;
@ -128,9 +129,9 @@ 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 == 1 ){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 == 3 ){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_suplierProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 4 ){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);
}else { }else {
@ -147,6 +148,8 @@ export class ClientInfoComponent implements OnInit {
// this.getM_FreqOfPurchase(); // this.getM_FreqOfPurchase();
this.getM_PaymentModeType(); this.getM_PaymentModeType();
// this.getPdSupplierFormDetails(); // this.getPdSupplierFormDetails();
this.getMasterDetails('COMPANYRELATIONSHIPS',1);
this.getMasterDetails('TITLES',2);
} }
retaildTradingForm: Boolean = false; retaildTradingForm: Boolean = false;
@ -171,7 +174,7 @@ export class ClientInfoComponent implements OnInit {
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
}); });
// Load form details for manufacturing // Load form details for manufacturing
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) { if (arr.length > 0) {
// let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) { // let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
// return dataForm.main_raw_materials[key]; // return dataForm.main_raw_materials[key];
@ -183,7 +186,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 == 3); let arr1 = record.filter(data => 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];
@ -195,7 +198,7 @@ export class ClientInfoComponent implements OnInit {
} }
// Load form details for the service provider prduct details // Load form details for the service provider prduct details
let arr2 = record.filter(data => data.type_of_activity_id == 4); let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) { if (arr2.length > 0) {
// let api_service_provider_products = Object.keys(dataForm.service_products).map(function (key) { // let api_service_provider_products = Object.keys(dataForm.service_products).map(function (key) {
// return dataForm.service_products[key]; // return dataForm.service_products[key];
@ -205,7 +208,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null); this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(dataForm.service_provider_details[0].service_products_total_payments_percent_on_credit || null);
} }
// 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 == 2); 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;
} }
@ -214,23 +217,24 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({ this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid], pdid: [this.pdid],
formid: ['2'], formid: ['2'],
company_id:[this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]), manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]), service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null] supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
}); });
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) { if (arr.length > 0) {
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 == 3); let arr1 = record.filter(data => 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);
} }
let arr2 = record.filter(data => data.type_of_activity_id == 4); let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) { if (arr2.length > 0) {
let api_service_provider_products = Object.keys(dataForm.service_products).map(function (key) { let api_service_provider_products = Object.keys(dataForm.service_products).map(function (key) {
return dataForm.service_products[key]; return dataForm.service_products[key];
@ -239,7 +243,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(null);
} }
// 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 == 2); 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;
} }
@ -256,23 +260,23 @@ export class ClientInfoComponent implements OnInit {
supplier_info_form_remark: [] supplier_info_form_remark: []
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
}); });
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) { if (arr.length > 0) {
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 == 3); let arr1 = record.filter(data => 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);
} }
let arr2 = record.filter(data => data.type_of_activity_id == 4); let arr2 = record.filter(data => data.type_of_activity_id == 5);
if (arr2.length > 0) { if (arr2.length > 0) {
this.initServiceProviderProductsDetails(null); this.initServiceProviderProductsDetails(null);
this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(null); this._supplierQuesFrom.controls['service_provider_details']['controls'][0].controls['service_products_total_payments_percent_on_credit'].setValue(null);
} }
// 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 == 2); 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;
} }
@ -287,7 +291,7 @@ export class ClientInfoComponent implements OnInit {
manufacturingForm: Boolean = false; manufacturingForm: Boolean = false;
manufacturingFormCreation(val) { manufacturingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id == 1); let arr = val.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) { if (arr.length > 0) {
this.manufacturingForm = true; this.manufacturingForm = true;
return this._formBuilder.group({ return this._formBuilder.group({
@ -302,7 +306,7 @@ 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 == 3); let arr = val.filter(data => 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({
@ -316,7 +320,7 @@ export class ClientInfoComponent implements OnInit {
serviceProviderForm: Boolean = false; serviceProviderForm: Boolean = false;
serviceProviderFormCreation(val) { serviceProviderFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id == 4); let arr = val.filter(data => data.type_of_activity_id == 5);
if (arr.length > 0) { if (arr.length > 0) {
this.serviceProviderForm = true; this.serviceProviderForm = true;
return this._formBuilder.group({ return this._formBuilder.group({
@ -345,18 +349,26 @@ export class ClientInfoComponent implements OnInit {
manufacturing_product_name: [''], manufacturing_product_name: [''],
manufacturing_client_name: [''], manufacturing_client_name: [''],
manufacturing_contact_person_name: [''], manufacturing_contact_person_name: [''],
manufacturing_contact_person_mobile_number: [''], manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_payment_type: [''], manufacturing_payment_type: [''],
manufacturing_credit_days: [''], manufacturing_credit_days: [''],
person_title_name:[''],
person_designation:[''],
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]*$')])],
}) })
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
manufacturing_product_name: [records.manufacturing_product_name || null], manufacturing_product_name: [records.manufacturing_product_name || null],
manufacturing_client_name: [records.manufacturing_client_name || null], manufacturing_client_name: [records.manufacturing_client_name || null],
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], 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_credit_days: [records.manufacturing_credit_days || null], manufacturing_credit_days: [records.manufacturing_credit_days || null],
person_title_name:[records.person_title_name || 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_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
}) })
} }
} }
@ -378,20 +390,28 @@ export class ClientInfoComponent implements OnInit {
trade_product_name: [''], trade_product_name: [''],
trade_client_name: [''], trade_client_name: [''],
trade_product_contact_person_name: [''], trade_product_contact_person_name: [''],
trade_product_contact_person_mobile_number: [''], trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
trade_product_payment_type: [''], trade_product_payment_type: [''],
trade_product_frequency_of_purchase: [''], trade_product_frequency_of_purchase: [''],
trade_product_credit_days: [''], trade_product_credit_days: [''],
person_title_name:[''],
person_designation:[''],
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]*$')])],
}) })
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
trade_product_name: [records.trade_product_name], trade_product_name: [records.trade_product_name],
trade_client_name: [records.trade_client_name], trade_client_name: [records.trade_client_name],
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], trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
trade_product_payment_type: [records.trade_product_payment_type], trade_product_payment_type: [records.trade_product_payment_type],
trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase], trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase],
trade_product_credit_days: [records.trade_product_credit_days], trade_product_credit_days: [records.trade_product_credit_days],
person_title_name:[records.person_title_name || 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_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
}) })
} }
} }
@ -413,20 +433,28 @@ export class ClientInfoComponent implements OnInit {
service_provider_product_name: [''], service_provider_product_name: [''],
service_provider_client_name: [''], service_provider_client_name: [''],
service_provider_product_contact_person_name: [''], service_provider_product_contact_person_name: [''],
service_provider_product_contact_person_mobile_number: [''], service_provider_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
service_provider_product_payment_type: [''], service_provider_product_payment_type: [''],
service_provider_product_frequency_of_purchase: [''], service_provider_product_frequency_of_purchase: [''],
service_provider_product_credit_days: [''], service_provider_product_credit_days: [''],
person_title_name:[''],
person_designation:[''],
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]*$')])],
}) })
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
service_provider_product_name: [records.service_provider_product_name], service_provider_product_name: [records.service_provider_product_name],
service_provider_client_name: [records.service_provider_client_name], service_provider_client_name: [records.service_provider_client_name],
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], service_provider_product_contact_person_mobile_number: [records.service_provider_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
service_provider_product_payment_type: [records.service_provider_product_payment_type], service_provider_product_payment_type: [records.service_provider_product_payment_type],
service_provider_product_frequency_of_purchase: [records.service_provider_product_frequency_of_purchase], service_provider_product_frequency_of_purchase: [records.service_provider_product_frequency_of_purchase],
service_provider_product_credit_days: [records.service_provider_product_credit_days], service_provider_product_credit_days: [records.service_provider_product_credit_days],
person_title_name:[records.person_title_name || 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_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])],
}) })
} }
} }
@ -494,6 +522,25 @@ export class ClientInfoComponent implements OnInit {
) )
} }
// get all master details
getMasterDetails(table:string,type:number){
this.pdTrigerService.getAllMasterDatas(table).subscribe(
data => {
if (data.dataStatus) {
if(type==1){
this.companyRelationShipList=data.records.filter(item => item.name != 'Others');
}
if(type==2){
this.titleList=data.records.filter(val=>val.isactive==1);
}
}
}, error => this.errorMessage = <any> error);
}
// ================== // ==================
@ -502,6 +549,7 @@ export class ClientInfoComponent implements OnInit {
this.submitted = true; this.submitted = true;
// stop here if form is invalid // stop here if form is invalid
if (this._supplierQuesFrom.invalid) { if (this._supplierQuesFrom.invalid) {
this.notifier.notify('warning', 'Please Check All Mandatory Fields.!');
return; return;
} else { } else {
var answerFormValues = this._supplierQuesFrom.value; var answerFormValues = this._supplierQuesFrom.value;
@ -522,7 +570,10 @@ export class ClientInfoComponent implements OnInit {
dataresult => { dataresult => {
if (dataresult.status == 200) { if (dataresult.status == 200) {
// console.log(dataresult); // console.log(dataresult);
this.notifier.notify('success', 'Record Saved Successfully.!'); this.notifier.notify('success', 'Saved Successfully.!');
setTimeout(() =>{
this.dialogRef.close();
},3000);
// this.dialogRef.close(); // this.dialogRef.close();
// alert("sample alert for Saving"); // alert("sample alert for Saving");
} }

View File

@ -16,30 +16,59 @@
<div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index" [formGroupName]="l"> <div *ngFor="let items of item.controls.main_raw_materials['controls']; let l=index" [formGroupName]="l">
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Raw Material #{{l+1}}</h6> <h6 style="margin: 12px;padding:10px !important;">Raw Material #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 30%"> <mat-form-field style="width: 45%">
<input matInput placeholder="Raw Material Name" formControlName="manufacturing_raw_material_name"> <input matInput placeholder="Raw Material Name" formControlName="manufacturing_raw_material_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> <mat-form-field style="width: 45%">
<input matInput placeholder="Supplier Name" formControlName="manufacturing_supplier_name"> <input matInput placeholder="Supplier Name" formControlName="manufacturing_supplier_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap">
<mat-form-field style="width: 30%"> <mat-form-field style="width: 15%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number"> <mat-select placeholder="Title" formControlName="person_title_name">
</mat-form-field> <mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
<mat-form-field style="width: 30%"> {{tl.name}}
<mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="manufacturing_payment_type"> </mat-option>
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> </mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field>
<mat-form-field style="width: 35%">
<mat-select placeholder="Contact Person Designation" formControlName="person_designation">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<mat-option value="1" > Not Applicable </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%" *ngIf="items.get('manufacturing_payment_type').value == 3"> </div>
<input matInput placeholder="Number of days of credit provided" formControlName="manufacturing_credit_days"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
</mat-form-field> <mat-form-field style="width: 35%">
</div> <input matInput placeholder="Contact Person Mobile Number" autocomplete="off" formControlName="manufacturing_contact_person_mobile_number" (keypress)="keyPress($event)" maxlength="10">
</mat-form-field>
<mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)">
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)">
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 45%">
<mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="manufacturing_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%" *ngIf="items.get('manufacturing_payment_type').value == 3">
<input matInput placeholder="No.of days of Credit Provided by Supplier" formControlName="manufacturing_credit_days">
</mat-form-field>
</div>
<div align="end"> <div align="end">
<span *ngIf="item.controls.main_raw_materials.controls.length > 1" (click)="removeRawMaterials(l)"> <span *ngIf="item.controls.main_raw_materials.controls.length > 1" (click)="removeRawMaterials(l)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button> <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" color="primary" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
@ -48,16 +77,19 @@
</mat-card> </mat-card>
</div> </div>
</div> </div>
<div> <div fxLayout="row">
<mat-form-field style="width: 100%"> <div fxFlex="100" align="center">
<input matInput placeholder="What % of total purchase is done on Credit?" formControlName="main_raw_materials_total_payments_percent_on_credit" <button color="primary" mat-flat-button matTooltip="Add More" matTooltipPosition="above" type="button"
type="text" (keypress)="keyPress($event)" maxlength="3"> class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><strong>Add More Supplier</strong></button>
</mat-form-field> </div>
<div fxFlex="100" align="end">
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Supplier Details" matTooltipPosition="above"
class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><mat-icon>add</mat-icon></button>
</div> </div>
<div fxLayout="row">
<mat-form-field style="width: 100%">
<input matInput placeholder="What % of Total Purchase is Done on Credit?" formControlName="main_raw_materials_total_payments_percent_on_credit"
type="number" autocomplete="off" (keypress)="keyPress($event)" maxlength="3">
</mat-form-field>
</div> </div>
</div> </div>
</div> </div>
</mat-card> </mat-card>
@ -69,28 +101,55 @@
<div *ngFor="let items of item.controls.trading_products['controls']; let l=index" [formGroupName]="l"> <div *ngFor="let items of item.controls.trading_products['controls']; let l=index" [formGroupName]="l">
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;padding:10px !important;">Trading Product #{{l+1}}</h6> <h6 style="margin: 12px;padding:10px !important;">Trading Product #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 30%"> <mat-form-field style="width: 45%">
<input matInput placeholder="Trade Product Name" formControlName="trade_product_name"> <input matInput placeholder="Trade Product Name" formControlName="trade_product_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> <mat-form-field style="width: 45%">
<input matInput placeholder="Supplier Name" formControlName="trade_supplier_name"> <input matInput placeholder="Supplier Name" formControlName="trade_supplier_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> </div>
<div fxLayout="row nowrap">
<mat-form-field style="width: 15%">
<mat-select placeholder="Title" formControlName="person_title_name">
<mat-option *ngFor="let tl of titleList" [value]="tl.title_id">
{{tl.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 35%">
<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-select placeholder="Contact Person Designation" formControlName="person_designation">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
{{comrelShip.name}}
</mat-option>
<mat-option value="1" > Not Applicable </mat-option>
</mat-select>
</mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 30%"> <mat-form-field style="width: 35%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number" (keypress)="keyPress($event)"> <input matInput placeholder="Contact Person Mobile Number" autocomplete="off" formControlName="trade_product_contact_person_mobile_number" (keypress)="keyPress($event)" maxlength="10">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> <mat-form-field style="width: 15%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="person_stdcode" type="text" (keypress)="keyPress($event)">
</mat-form-field> &nbsp; - &nbsp;
<mat-form-field style="width: 35%">
<input matInput autocomplete="off" placeholder="Contact Person Landline Number" formControlName="person_landline" type="text" (keypress)="keyPress($event)">
</mat-form-field>
</div>
<div fxLayout="row nowrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<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>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%" *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="Number of days of credit provided" formControlName="trade_product_credit_days"> <input matInput placeholder="No.of Days of Credit Provided by Supplier" autocomplete="off" formControlName="trade_product_credit_days" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
</div> </div>
<div align="end"> <div align="end">
@ -101,16 +160,19 @@
</mat-card> </mat-card>
</div> </div>
</div> </div>
<div> <div fxlayout="row">
<mat-form-field style="width: 100%"> <div fxFlex="100" align="center">
<input matInput placeholder="% of total trading product credit values" formControlName="trading_products_total_payments_percent_on_credit" <button mat-flat-button color="primary" matTooltip="Add More" matTooltipPosition="above" type="button"
type="number"> class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><strong>Add More Supplier</strong></button>
</mat-form-field> </div>
<div fxFlex="100" align="end">
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Supplier Details" matTooltipPosition="above"
class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><mat-icon>add</mat-icon></button>
</div> </div>
<div fxlayout="row">
<mat-form-field style="width: 90%">
<input matInput placeholder="% of Total Trading Product Credit Values" formControlName="trading_products_total_payments_percent_on_credit"
type="number" autocomplete="off">
</mat-form-field>
</div> </div>
</div> </div>
</div> </div>
</mat-card> </mat-card>

View File

@ -43,16 +43,18 @@ export class SupplierInfoComponent implements OnInit {
public m_paymentModeType = []; public m_paymentModeType = [];
private notifier: NotifierService; private notifier: NotifierService;
titleList: any=[];
companyRelationShipList: any=[];
constructor( constructor(
notifier: NotifierService, notifier: NotifierService,
private _formBuilder: FormBuilder, private _formBuilder: FormBuilder,
private pdTrigerService: PdTrigerService, private pdTrigerService: PdTrigerService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { @Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialogRef: MatDialogRef<SupplierInfoComponent>) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 1; this.form_id = 1;
this.company_id = this.pd_all_details.company_id this.company_id = this.pd_all_details.company_id
this.notifier = notifier; this.notifier = notifier;
} }
public viewerOptions: any = { public viewerOptions: any = {
navbar: false, navbar: false,
@ -112,6 +114,8 @@ export class SupplierInfoComponent implements OnInit {
// this.getM_FreqOfPurchase(); // this.getM_FreqOfPurchase();
this.getM_PaymentModeType(); this.getM_PaymentModeType();
// this.getPdSupplierFormDetails(); // this.getPdSupplierFormDetails();
this.getMasterDetails('COMPANYRELATIONSHIPS',1);
this.getMasterDetails('TITLES',2);
} }
@ -136,7 +140,7 @@ export class SupplierInfoComponent implements OnInit {
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null] supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
}); });
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 2);
if(arr.length > 0) { if(arr.length > 0) {
// let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) { // let api_main_raw_materials = Object.keys(dataForm.main_raw_materials).map(function (key) {
// return dataForm.main_raw_materials[key]; // return dataForm.main_raw_materials[key];
@ -146,7 +150,7 @@ export class SupplierInfoComponent implements OnInit {
this.initManufacturingProductsDetails(api_main_raw_materials); this.initManufacturingProductsDetails(api_main_raw_materials);
this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(dataForm.manufacturing_details[0].main_raw_materials_total_payments_percent_on_credit || null);
} }
let arr1 = record.filter(data => data.type_of_activity_id == 2 || 3); 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];
@ -166,19 +170,19 @@ export class SupplierInfoComponent implements OnInit {
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null] supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
}); });
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 2);
if(arr.length > 0) { if(arr.length > 0) {
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 == 2 || 3); 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(dataForm.trading_products_total_payments_percent_on_credit || null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(dataForm.trading_products_total_payments_percent_on_credit || null);
} }
this.noRecordsFound = true; this.noRecordsFound = true;
} }
let arr2 = record.filter(data => data.type_of_activity_id == 4); let arr2 = record.filter(data => data.type_of_activity_id == 5);
if(arr2.length > 0) { if(arr2.length > 0) {
this.serviceProviderForm = true; this.serviceProviderForm = true;
} }
@ -186,22 +190,23 @@ export class SupplierInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({ this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid], pdid: [this.pdid],
formid: ['1'], formid: ['1'],
company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]), manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [] supplier_info_form_remark: []
// wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), // wholesale_trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
}); });
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 2);
if(arr.length > 0) { if(arr.length > 0) {
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 == 2 || 3); 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);
} }
let arr2 = record.filter(data => data.type_of_activity_id == 4); let arr2 = record.filter(data => data.type_of_activity_id == 5);
if(arr2.length > 0) { if(arr2.length > 0) {
this.serviceProviderForm = true; this.serviceProviderForm = true;
} }
@ -216,7 +221,7 @@ export class SupplierInfoComponent implements OnInit {
manufacturingForm: Boolean = false; manufacturingForm: Boolean = false;
manufacturingFormCreation(val) { manufacturingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id == 1); let arr = val.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) { if (arr.length > 0) {
this.manufacturingForm = true; this.manufacturingForm = true;
return this._formBuilder.group({ return this._formBuilder.group({
@ -231,7 +236,7 @@ export class SupplierInfoComponent implements OnInit {
tradingForm: Boolean = false; tradingForm: Boolean = false;
tradingFormCreation(val) { tradingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id == 2 || 3); 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({
@ -259,21 +264,30 @@ export class SupplierInfoComponent implements OnInit {
return this._formBuilder.group({ return this._formBuilder.group({
manufacturing_raw_material_name: [''], manufacturing_raw_material_name: [''],
manufacturing_supplier_name: [''], manufacturing_supplier_name: [''],
person_title_name:[''],
person_designation:[''],
manufacturing_contact_person_name: [''], manufacturing_contact_person_name: [''],
manufacturing_contact_person_mobile_number: [''], manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
manufacturing_payment_type: [''], manufacturing_payment_type: [''],
manufacturing_credit_days: [''], manufacturing_credit_days: [''],
manufacturing_frequency_of_purchase: [''], manufacturing_frequency_of_purchase: [''],
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]*$')])],
}) })
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null], manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null],
manufacturing_supplier_name: [records.manufacturing_supplier_name || null], manufacturing_supplier_name: [records.manufacturing_supplier_name || null],
person_title_name:[records.person_title_name || null],
person_designation:[records.person_title_name || null],
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], 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_credit_days: [records.manufacturing_credit_days || null], manufacturing_credit_days: [records.manufacturing_credit_days || null],
manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null], manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null],
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]*$')])],
}) })
} }
} }
@ -294,8 +308,12 @@ export class SupplierInfoComponent implements OnInit {
return this._formBuilder.group({ return this._formBuilder.group({
trade_product_name: [''], trade_product_name: [''],
trade_supplier_name: [''], trade_supplier_name: [''],
person_title_name:[''],
person_designation:[],
trade_product_contact_person_name: [''], trade_product_contact_person_name: [''],
trade_product_contact_person_mobile_number: [''], trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
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]*$')])],
trade_product_payment_type: [''], trade_product_payment_type: [''],
trade_product_frequency_of_purchase: [''], trade_product_frequency_of_purchase: [''],
trade_product_credit_days: [''], trade_product_credit_days: [''],
@ -303,9 +321,13 @@ export class SupplierInfoComponent implements OnInit {
} else { } else {
return this._formBuilder.group({ return this._formBuilder.group({
trade_product_name: [records.trade_product_name], trade_product_name: [records.trade_product_name],
person_title_name:[records.person_title_name],
person_designation:[records.person_designation],
trade_supplier_name: [records.trade_supplier_name], trade_supplier_name: [records.trade_supplier_name],
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], trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number, Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
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]*$')])],
trade_product_payment_type: [records.trade_product_payment_type], trade_product_payment_type: [records.trade_product_payment_type],
trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase], trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase],
trade_product_credit_days: [records.trade_product_credit_days], trade_product_credit_days: [records.trade_product_credit_days],
@ -337,6 +359,25 @@ export class SupplierInfoComponent implements OnInit {
control.removeAt(inx); control.removeAt(inx);
} }
// get all master details
getMasterDetails(table:string,type:number){
this.pdTrigerService.getAllMasterDatas(table).subscribe(
data => {
if (data.dataStatus) {
if(type==1){
this.companyRelationShipList=data.records.filter(item => item.name != 'Others');
}
if(type==2){
this.titleList=data.records.filter(val=>val.isactive==1);
}
}
}, error => this.errorMessage = <any> error);
}
// ================== // ==================
//getM_FreqOfPurchase() { //getM_FreqOfPurchase() {
@ -371,21 +412,25 @@ export class SupplierInfoComponent implements OnInit {
this.submitted = true; this.submitted = true;
// stop here if form is invalid // stop here if form is invalid
if (this._supplierQuesFrom.invalid) { if (this._supplierQuesFrom.invalid) {
this.notifier.notify('warning', 'Please Check All Mandatory Fields.!');
return; return;
} else { } else {
var answerFormValues = this._supplierQuesFrom.value; var answerFormValues = this._supplierQuesFrom.value;
//To Remove The "Null" With Key also //To Remove The "Null" With Key also
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
console.log(JSON.stringify(answerFormValues));
//Add BRANCH data with help Service File //Add BRANCH data with help Service File
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => { dataresult => {
if (dataresult.status == 200) { if (dataresult.status == 200) {
// console.log(dataresult); // console.log(dataresult);
this.notifier.notify('success', 'Record Saved Successfully.!'); this.notifier.notify('success', 'Saved Successfully.!');
// this.dialogRef.close(); // this.dialogRef.close();
// alert("sample alert for Saving"); // alert("sample alert for Saving");
setTimeout(() =>{
this.dialogRef.close();
},3000);
} }
else { else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');

View File

@ -92,6 +92,7 @@ import { SharedModule } from "app/shared/shared.module";
import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component'; import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component';
import { SearchRelationPipe } from './../pd-pipes/search-relation.pipe'; import { SearchRelationPipe } from './../pd-pipes/search-relation.pipe';
import { BusinessAssetsInfoComponent } from './list-pd/start-pd/forms/business-assets-info/business-assets-info.component'; import { BusinessAssetsInfoComponent } from './list-pd/start-pd/forms/business-assets-info/business-assets-info.component';
import { BusinessBankingDetailsComponent } from './list-pd/start-pd/forms/business-banking-details/business-banking-details.component';
/** /**
* Custom angular notifier options * Custom angular notifier options
@ -269,7 +270,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule, // AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
// OwlNativeDateTimeModule, // OwlNativeDateTimeModule,
// ], // ],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, BusinessAssetsInfoComponent], declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent], // exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService], // providers: [PdTrigerService, GetGeometricLocationService],
@ -313,7 +314,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}], {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent, entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent,
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent], ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent],
}) })
export class ManagePdModule { export class ManagePdModule {

View File

@ -255,6 +255,13 @@ export class PdTrigerService {
catchError(this.handleError('operation', [])) catchError(this.handleError('operation', []))
) )
} }
// common Pd form details get for the Pd Process
getPDFormDetailsWithCompanyID(pdID, formID,companyID): Observable<any> {
return this._http.post<any>(this.apiUrl + "getPDFormDetails", { "pd_id": pdID, "pd_form_id": formID,"company_id": companyID})
.pipe(
catchError(this.handleError('operation', []))
)
}
// save Pd form details // save Pd form details
savePDFormDetailsWithID(saveData: any): Observable<any> { savePDFormDetailsWithID(saveData: any): Observable<any> {