segment issues fixed : ps
This commit is contained in:
parent
6987831e17
commit
b7617d9aa0
@ -165,11 +165,12 @@ export class AddPdComponent implements OnInit, OnDestroy {
|
||||
|
||||
//get sub product list based on prokduct id
|
||||
getSubproductList(productID: string) {
|
||||
console.log('productID',productID);
|
||||
this.subProductList = this.productList.filter(item => item.product_id == productID);
|
||||
this.subProductList = this.subProductList[0].subproducts;
|
||||
this.subProductList = this.subProductList.filter(item => item.is_others == 0);
|
||||
this.customerSegmentList = (productID != '4') ? (this.customerSegmentAllList, this._PDtriggerForm.controls['fk_subproduct_id'].setValue(''))
|
||||
: (this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')), this._PDtriggerForm.controls['fk_subproduct_id'].setValue(''));
|
||||
this.customerSegmentList = (productID != '4')?this.customerSegmentAllList:this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
|
||||
if(productID != '4'){this._PDtriggerForm.controls['fk_subproduct_id'].setValue('')}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -230,6 +230,7 @@ export class EditPdMasterComponent implements OnInit {
|
||||
this.subProductList= this.productList.filter(item => item.product_id == productID);
|
||||
this.subProductList=this.subProductList[0].subproducts;
|
||||
this.customerSegmentList=(productID != '4')?this.customerSegmentAllList:this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self'));
|
||||
|
||||
// this.customerSegmentList = (productID != '4')?this.customerSegmentAllList:(this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')),this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue(''));
|
||||
|
||||
}
|
||||
@ -442,7 +443,7 @@ export class EditPdMasterComponent implements OnInit {
|
||||
"pd_contact_mobileno": my_array.pd_contact_mobileno,
|
||||
"pd_contact_landline": concat_landline,
|
||||
"fk_product_id": my_array.fk_product_id,
|
||||
"fk_subproduct_id": my_array.fk_subproduct_id,
|
||||
"fk_subproduct_id": my_array.fk_product_id != '4' ? my_array.fk_subproduct_id : '',
|
||||
"fk_pd_type": my_array.fk_pd_type,
|
||||
"fk_customer_segment": my_array.fk_customer_segment,
|
||||
"loan_amount": my_array.loan_amount,
|
||||
|
||||
@ -18,17 +18,21 @@
|
||||
<mat-card>
|
||||
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Name of Employer" formControlName="employer_name" required>
|
||||
<!-- <input matInput> -->
|
||||
<mat-select placeholder="Name of Employer" formControlName="employer_name" required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let cl of company_list" [value]="cl.company_order_id+'-'+cl.company_name">{{ cl.company_name }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<div>
|
||||
<label>Since how long working with this employer?</label>
|
||||
<br>
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field>
|
||||
<input matInput type="number" autocomplete="off" placeholder="Year" formControlName="how_long_year" required min='0'>
|
||||
<input matInput OnlyNumber type="text" autocomplete="off" placeholder="Year" formControlName="how_long_year" required min='0'>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" autocomplete="off" placeholder="Month" formControlName="how_long_month" required min='0' (change)="ConvertMonthintoYear($event.target.value)">
|
||||
<input matInput OnlyNumber type="text" autocomplete="off" placeholder="Month" formControlName="how_long_month" required min='0' (change)="ConvertMonthintoYear($event.target.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
@ -42,10 +46,23 @@
|
||||
</mat-form-field>
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="employmentForm.controls['was_met'].value == 'yes'">
|
||||
<mat-form-field fxFlex="50">
|
||||
<input matInput placeholder="Name of Person Met" formControlName="name_person_met" required>
|
||||
<!-- <input matInput placeholder="Name of Person Met" formControlName="name_person_met" required> -->
|
||||
<mat-select placeholder="Name of Person Met" formControlName="name_person_met" required (selectionChange)="filtercompanyrelationship(employmentForm.controls['employer_name'].value,$event.value)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let person of person_met_list" [value]="person.pd_co_applicant_id">
|
||||
{{person.applicant_name | titlecase}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="50">
|
||||
<input matInput placeholder="Designation of Person Met" formControlName="designation_person_met" required>
|
||||
<!-- <mat-select placeholder="Designation of Person Met" formControlName="designation_person_met" required>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
|
||||
{{comrelShip.name | titlecase}}
|
||||
</mat-option>
|
||||
<mat-option value="0"> Not Applicable </mat-option>
|
||||
</mat-select> -->
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<mat-form-field *ngIf="pd_cus_segment!='SAL-CHQ'">
|
||||
@ -83,7 +100,7 @@
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 33%">
|
||||
<input matInput placeholder="Date of Salary" formControlName="which_date_the_salary_is_rcv" type="number" min='1' max='31'>
|
||||
<input matInput placeholder="Date of Salary" formControlName="which_date_the_salary_is_rcv" OnlyNumber type="text" min='1' max='31'>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 33%">
|
||||
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" (keypress)="keyPress($event)" required>
|
||||
|
||||
@ -43,6 +43,11 @@ export class EmploymentInfoComponent implements OnInit {
|
||||
private notifier: NotifierService;
|
||||
public pd_cus_segment:string;
|
||||
public frequency_data:any[];
|
||||
public company_list:any[];
|
||||
public person_met_list:any[];
|
||||
public company_related_applicants_list:any[];
|
||||
public company_relationship_list:any[];
|
||||
public filtered_company_relationship_list:any[];
|
||||
|
||||
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
@ -78,11 +83,26 @@ export class EmploymentInfoComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
ngOnInit() {
|
||||
console.log('clear');
|
||||
console.clear();
|
||||
this.pd_cus_segment=this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase();
|
||||
this.initemploymentForm();
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = this.form_id;
|
||||
console.log('abcd');
|
||||
let param: any = {};
|
||||
param.pd_id = this.pdid;
|
||||
param.pd_form_id = '18';
|
||||
this._pd.retriveForm(param).subscribe(data => {
|
||||
if(data.dataStatus) {
|
||||
console.log(data.records);
|
||||
this.company_list = data.records.companies.filter(com=>com.is_active == true );
|
||||
this.person_met_list = data.records.individuals.filter(app=>app.is_person_met == true && app.is_active == true);
|
||||
this.company_related_applicants_list = data.records.company_with_relationships;
|
||||
}
|
||||
});
|
||||
|
||||
this._pd.retriveForm(params).subscribe(value => {
|
||||
if (value.status == 200) {
|
||||
this.employmentForm.controls['employer_name'].setValue(value.records.employer_name);
|
||||
@ -120,7 +140,17 @@ export class EmploymentInfoComponent implements OnInit {
|
||||
this.frequency_data = this.frequency_data.filter(freq=>freq.isactive == 1 );
|
||||
}
|
||||
});
|
||||
|
||||
this._pd.getAllMasterDatas('COMPANYRELATIONSHIPS').subscribe(
|
||||
data => {
|
||||
if (data.status == 200) {
|
||||
this.company_relationship_list = data.records.filter(item => item.isactive == 1);
|
||||
this.company_relationship_list = data.records.filter(item => item.name != 'Others');
|
||||
this.company_relationship_list.push({'company_relationship_id':0,'name':'Not Applicable'});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public initemploymentForm(): void {
|
||||
this.employmentForm = this.fb.group({
|
||||
employer_name: ['', Validators.compose([Validators.required])],
|
||||
@ -141,10 +171,28 @@ export class EmploymentInfoComponent implements OnInit {
|
||||
bonus_type: [''],
|
||||
bonus_type_other: [''],
|
||||
any_delays: ['', Validators.compose([Validators.required])],
|
||||
// employment_details: this.fb.array([]),
|
||||
employment_remarks: ['', Validators.compose([Validators.required])],
|
||||
});
|
||||
}
|
||||
|
||||
filtercompanyrelationship(companyid,applicantid){
|
||||
var array = companyid.split("-");
|
||||
// console.log(array[0]);
|
||||
// console.log('companyid',companyid);
|
||||
// console.log('applicantid',applicantid);
|
||||
let data = this.company_related_applicants_list.filter(freq=>freq.relation_to_company == array[0] &&freq.applicant_name == applicantid);
|
||||
|
||||
if(data.length>0){
|
||||
|
||||
this.filtered_company_relationship_list = this.company_relationship_list.filter(freq=>freq.company_relationship_id == data[0].company_relationship );
|
||||
this.employmentForm.controls['designation_person_met'].setValue(this.filtered_company_relationship_list[0]['name'] +' '+array[1]);
|
||||
}
|
||||
else{
|
||||
this.employmentForm.controls['designation_person_met'].setValue('');
|
||||
}
|
||||
}
|
||||
|
||||
ConvertMonthintoYear(e){
|
||||
|
||||
let how_long_year = this.employmentForm.controls.how_long_year.value;
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
</div>
|
||||
<div style="width:100%">
|
||||
<mat-form-field style="width:30%">
|
||||
<!-- <input matInput autocomplete="off" placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" > -->
|
||||
<!-- <input matInput autocomplete="off" placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" OnlyNumber type="text" > -->
|
||||
<mat-select placeholder="Is there Net Profit or Net Loss?"
|
||||
formControlName="finanical_profit_or_loss" (selectionChange)="selectedProfitOrLossType($event,details)">
|
||||
<mat-option value="1">Net Profit</mat-option>
|
||||
@ -277,17 +277,17 @@
|
||||
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'yes' ">
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Profit % From"
|
||||
formControlName="estimate_profit_range_from" type="number"
|
||||
formControlName="estimate_profit_range_from" OnlyNumber type="text"
|
||||
min='0' max='100' (change)="calculateMarginProfit( i, details);">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Profit % To"
|
||||
formControlName="estimate_profit_range_to" type="number"
|
||||
formControlName="estimate_profit_range_to" OnlyNumber type="text"
|
||||
min='0' max='100' (change)="calculateMarginProfit( i, details);">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Profit % Considered"
|
||||
formControlName="estimate_profit_margin_percent" type="number"
|
||||
formControlName="estimate_profit_margin_percent" OnlyNumber type="text"
|
||||
readonly>
|
||||
<!-- <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_profit_margin').value != ''"> {{"₹"}} {{AV_marginProfitAmtInwords[i]}} Only ( {{"₹"}} {{details.get('estimate_profit_margin').value}} ) </mat-hint> -->
|
||||
</mat-form-field>
|
||||
@ -302,14 +302,14 @@
|
||||
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'no' ">
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Profit Amount From"
|
||||
formControlName="estimate_net_profit_from" type="number"
|
||||
formControlName="estimate_net_profit_from" OnlyNumber type="text"
|
||||
(change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,7)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_from').value != ''">{{"₹"}}
|
||||
{{AV_netProfitAmtFrmInwords[i]}} Only </mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Profit Amount To"
|
||||
formControlName="estimate_net_profit_to" type="number"
|
||||
formControlName="estimate_net_profit_to" OnlyNumber type="text"
|
||||
(change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,8)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_to').value != ''">{{"₹"}}
|
||||
{{AV_netProfitAmtToInwords[i]}} Only </mat-hint>
|
||||
@ -320,7 +320,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Considered Profit Amount"
|
||||
formControlName="estimate_net_profit" type="number"
|
||||
formControlName="estimate_net_profit" OnlyNumber type="text"
|
||||
readonly>
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit').value != ''">{{"₹"}}
|
||||
{{AV_netProfitAmtInwords[i]}} Only </mat-hint>
|
||||
@ -330,16 +330,16 @@
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Loss % From"
|
||||
formControlName="estimate_loss_range_from" min='0' max='100'
|
||||
type="number" (change)="calculateMarginLoss( i, details);">
|
||||
OnlyNumber type="text" (change)="calculateMarginLoss( i, details);">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Loss % To"
|
||||
formControlName="estimate_loss_range_to" min='0' max='100'
|
||||
type="number" (change)="calculateMarginLoss( i, details);">
|
||||
OnlyNumber type="text" (change)="calculateMarginLoss( i, details);">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Loss % Considered"
|
||||
formControlName="estimate_loss_margin_percent" type="number"
|
||||
formControlName="estimate_loss_margin_percent" OnlyNumber type="text"
|
||||
readonly>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
@ -352,14 +352,14 @@
|
||||
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'no' ">
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Loss Amount From"
|
||||
formControlName="estimate_net_loss_from" type="number"
|
||||
formControlName="estimate_net_loss_from" OnlyNumber type="text"
|
||||
(change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,9)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss_from').value != ''">{{"₹"}}
|
||||
{{AV_netLossAmtFrmInwords[i]}} Only </mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Net Loss Amount To"
|
||||
formControlName="estimate_net_loss_to" type="number"
|
||||
formControlName="estimate_net_loss_to" OnlyNumber type="text"
|
||||
(change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,10)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss_to').value != ''">{{"₹"}}
|
||||
{{AV_netLossAmtToInwords[i]}} Only </mat-hint>
|
||||
@ -370,7 +370,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:25%">
|
||||
<input matInput autocomplete="off" placeholder="Considered Loss Amount"
|
||||
formControlName="estimate_net_loss" type="number" readonly>
|
||||
formControlName="estimate_net_loss" OnlyNumber type="text" readonly>
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss').value != ''">{{"₹"}}
|
||||
{{AV_netLossAmtInwords[i]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
@ -400,15 +400,15 @@
|
||||
<!-- <mat-card-subtitle> Working Capital Details </mat-card-subtitle> -->
|
||||
<mat-form-field style="width:92%">
|
||||
<input matInput autocomplete="off" placeholder="In case of Credit Sales, what is the average no of days taken to receive the money?"
|
||||
formControlName="receive_the_money_in_days" type="number">
|
||||
formControlName="receive_the_money_in_days" OnlyNumber type="text">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:92%">
|
||||
<input matInput autocomplete="off" placeholder="In case of Credit Purchase, what is the average no of days taken to pay the money?"
|
||||
formControlName="pay_the_money_in_days" type="number">
|
||||
formControlName="pay_the_money_in_days" OnlyNumber type="text">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:92%">
|
||||
<input matInput autocomplete="off" placeholder="What is the average no of days for which stock lies unsold during the year?"
|
||||
formControlName="unsold_stock_lies_in_days" type="number">
|
||||
formControlName="unsold_stock_lies_in_days" OnlyNumber type="text">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:92%">
|
||||
<mat-select placeholder="Is there Working Capital Facilities?" formControlName="is_there_working_capital_available">
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
<mat-form-field style="width:45%" *ngIf="details.get('source').value == 5">
|
||||
<input matInput autocomplete="off" placeholder="Address"
|
||||
formControlName="address">
|
||||
<!-- <mat-hint align="end"><i (click)="Toview()">Click Here To view Rental Info Form</i></mat-hint> -->
|
||||
<mat-hint align="end"><i (click)="Toview()">Rental Info Details</i></mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:45%">
|
||||
|
||||
@ -243,7 +243,7 @@ public viewerOptions: any = {
|
||||
}
|
||||
|
||||
Toview(){
|
||||
alert('Rental Info ');
|
||||
// alert('Rental Info ');
|
||||
// const dialogRef = this.dialog.open(RentalInfoComponent, {
|
||||
// data: {}
|
||||
// });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user