add n editpd billing to added
This commit is contained in:
parent
2d511d33a1
commit
71e1026fed
@ -28,6 +28,15 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 28%">
|
||||||
|
<mat-select placeholder="Billing To" formControlName="sub_entity_id">
|
||||||
|
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
|
||||||
|
<mat-option> Select </mat-option>
|
||||||
|
<mat-option *ngFor="let LL of billingtolist" [value]="LL.entity_id" >
|
||||||
|
{{LL.short_name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 28%">
|
<mat-form-field style="width: 28%">
|
||||||
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">
|
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">
|
||||||
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
|
<!-- (selectionChange)="getBillingDetails(pdMain.fk_lender_id.value)" -->
|
||||||
|
|||||||
@ -68,6 +68,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
cityData: any=[];
|
cityData: any=[];
|
||||||
stateData: any=[];
|
stateData: any=[];
|
||||||
pincodeData: any=[];
|
pincodeData: any=[];
|
||||||
|
billingtolist: any;
|
||||||
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
|
constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute,
|
||||||
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
|
private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent,
|
||||||
private titleCase : TitleCasePipe,private userService:UserService) {
|
private titleCase : TitleCasePipe,private userService:UserService) {
|
||||||
@ -131,7 +132,9 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
// load form data
|
// load form data
|
||||||
loadFormData() {
|
loadFormData() {
|
||||||
this._PDtriggerForm = this._fb.group({
|
this._PDtriggerForm = this._fb.group({
|
||||||
fk_lender_id: [{value:this.userDetails.fk_entity_id,disabled: this.userDetails.short_name != 'CHFPL' && this.userDetails.short_name != 'CLIX' ? true : false} || ''],
|
fk_lender_id: [{value:this.userDetails.fk_entity_id,disabled: true} || ''],
|
||||||
|
// fk_lender_id: [{value:this.userDetails.fk_entity_id,disabled: this.userDetails.short_name != 'CHFPL' && this.userDetails.short_name != 'CLIX' ? true : false} || ''],
|
||||||
|
sub_entity_id: [{value:this.userDetails.fk_entity_id,disabled: this.userDetails.short_name != 'CHFPL' ? true : false} || ''],
|
||||||
pd_branch_id: [null],
|
pd_branch_id: [null],
|
||||||
lender_applicant_id: [null, Validators.compose([Validators.required])],
|
lender_applicant_id: [null, Validators.compose([Validators.required])],
|
||||||
lender_sales_person:[null],
|
lender_sales_person:[null],
|
||||||
@ -168,9 +171,10 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
data => {
|
data => {
|
||||||
if (data.status == 200) {
|
if (data.status == 200) {
|
||||||
this.lenderList = data.records
|
this.lenderList = data.records
|
||||||
if(this.userDetails.short_name == 'CHFPL' || this.userDetails.short_name == 'CLIX'){
|
this.billingtolist = this.lenderList
|
||||||
this.lenderList = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
|
if(this.userDetails.short_name == 'CHFPL'){
|
||||||
console.log('filter lender',this.lenderList);
|
this.billingtolist = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
|
||||||
|
console.log('filter lender',this.billingtolist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loadControl=true
|
this.loadControl=true
|
||||||
@ -706,6 +710,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
let pd_details: any = {
|
let pd_details: any = {
|
||||||
"fk_lender_id": this._PDtriggerForm.controls['fk_lender_id'].value,
|
"fk_lender_id": this._PDtriggerForm.controls['fk_lender_id'].value,
|
||||||
|
"sub_entity_id": formValue.sub_entity_id,
|
||||||
"lender_applicant_id": formValue.lender_applicant_id,
|
"lender_applicant_id": formValue.lender_applicant_id,
|
||||||
"pd_branch_id": formValue.pd_branch_id,
|
"pd_branch_id": formValue.pd_branch_id,
|
||||||
"lender_sales_person":formValue.lender_sales_person,
|
"lender_sales_person":formValue.lender_sales_person,
|
||||||
|
|||||||
@ -33,6 +33,20 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
|
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
|
||||||
|
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 29%">
|
||||||
|
<mat-select placeholder="Billing To" formControlName="sub_entity_id">
|
||||||
|
<mat-option>
|
||||||
|
Select
|
||||||
|
</mat-option>
|
||||||
|
<!-- <mat-option *ngFor="let LL of lenderList" [value]="LL.entity_id" > -->
|
||||||
|
<mat-option *ngFor="let LL of billingtolist"
|
||||||
|
[value]="LL.entity_id">
|
||||||
|
{{LL.short_name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<!-- <mat-error *ngIf="pdMain.fk_lender_id.hasError('required')" class="mat-text-warn">Lender Name Required.</mat-error> -->
|
||||||
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 28%">
|
<mat-form-field style="width: 28%">
|
||||||
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">
|
<mat-select placeholder="Branch" formControlName="pd_branch_id" (selectionChange)="getContactPerson()">
|
||||||
|
|||||||
@ -72,6 +72,7 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
stateData: any=[];
|
stateData: any=[];
|
||||||
cityData: any=[];
|
cityData: any=[];
|
||||||
pincodeData: any=[];
|
pincodeData: any=[];
|
||||||
|
billingtolist: any;
|
||||||
constructor(private _fb: FormBuilder,
|
constructor(private _fb: FormBuilder,
|
||||||
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>,
|
private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef<EditPdMasterComponent>,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe,private userService:UserService) {
|
@Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe,private userService:UserService) {
|
||||||
@ -153,10 +154,13 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
let x = this.lenderList.filter(item => item.entity_id == this.data.records.fk_lender_id)
|
let x = this.lenderList.filter(item => item.entity_id == this.data.records.fk_lender_id)
|
||||||
this.lenderBranchList = x[0]['branches'];
|
this.lenderBranchList = x[0]['branches'];
|
||||||
this.lenderShortName = x[0]['short_name'] ;
|
this.lenderShortName = x[0]['short_name'] ;
|
||||||
if(this.userDetails.short_name == 'CHFPL' || this.userDetails.short_name == 'CLIX'){
|
|
||||||
this.lenderList = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
|
this.billingtolist = this.lenderList
|
||||||
console.log('filter lender',this.lenderList);
|
if(this.userDetails.short_name == 'CHFPL'){
|
||||||
}
|
this.billingtolist = data.records.filter(item=> item.short_name == 'CHFPL' || item.short_name == 'CLIX');
|
||||||
|
console.log('filter lender',this.billingtolist);
|
||||||
|
}
|
||||||
|
|
||||||
this.filterProductAbbr(x[0]['short_name'],1);
|
this.filterProductAbbr(x[0]['short_name'],1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -331,11 +335,12 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
// : this.data.records.pincode
|
// : this.data.records.pincode
|
||||||
// : this.data.records.pincode;
|
// : this.data.records.pincode;
|
||||||
// console.log("this.userd",this.userDetails);
|
// console.log("this.userd",this.userDetails);
|
||||||
|
console.log(this.userDetails.short_name)
|
||||||
|
|
||||||
this._EditPDtriggerForm = this._fb.group({
|
this._EditPDtriggerForm = this._fb.group({
|
||||||
pd_id: [this.data.records.pd_id],
|
pd_id: [this.data.records.pd_id],
|
||||||
fk_lender_id: [{value:this.data.records.fk_lender_id,disabled: this.userDetails.short_name != 'CHFPL' && this.userDetails.short_name != 'CLIX' ? true : false}],
|
fk_lender_id: [{value:this.data.records.fk_lender_id,disabled: true}],
|
||||||
|
sub_entity_id: [{value:this.data.records.sub_entity_id,disabled: this.userDetails.short_name != 'CHFPL' ? true : false}],
|
||||||
lender_applicant_id: [this.data.records.lender_applicant_id, Validators.compose([Validators.required])],
|
lender_applicant_id: [this.data.records.lender_applicant_id, Validators.compose([Validators.required])],
|
||||||
pd_branch_id:[this.data.records.pd_branch_id, Validators.compose([Validators.required])],
|
pd_branch_id:[this.data.records.pd_branch_id, Validators.compose([Validators.required])],
|
||||||
// pd_contact_person:[this.data.records.pd_contact_person],
|
// pd_contact_person:[this.data.records.pd_contact_person],
|
||||||
@ -714,6 +719,7 @@ export class EditPdMasterComponent implements OnInit {
|
|||||||
let lenderMasterArray = {
|
let lenderMasterArray = {
|
||||||
"pd_id": my_array.pd_id,
|
"pd_id": my_array.pd_id,
|
||||||
"fk_lender_id": my_array.fk_lender_id,
|
"fk_lender_id": my_array.fk_lender_id,
|
||||||
|
"sub_entity_id": my_array.sub_entity_id,
|
||||||
"lender_applicant_id": my_array.lender_applicant_id,
|
"lender_applicant_id": my_array.lender_applicant_id,
|
||||||
"pd_branch_id":my_array.pd_branch_id,
|
"pd_branch_id":my_array.pd_branch_id,
|
||||||
// "pd_contact_person": my_array.pd_contact_person,
|
// "pd_contact_person": my_array.pd_contact_person,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user