Issues Fixes : ps
This commit is contained in:
parent
007cd49551
commit
95e56431a5
@ -34,7 +34,7 @@
|
|||||||
<div class="item-margin" fxLayout="row wrap" *ngFor="let childItem of purchase.get('child').controls; let c = index" [formGroupName]="c">
|
<div class="item-margin" fxLayout="row wrap" *ngFor="let childItem of purchase.get('child').controls; let c = index" [formGroupName]="c">
|
||||||
<div fxFlex="100" *ngIf="childItem.value.isactive===true">
|
<div fxFlex="100" *ngIf="childItem.value.isactive===true">
|
||||||
<mat-form-field style="width: 33%;">
|
<mat-form-field style="width: 33%;">
|
||||||
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="purchase_date" (dateChange)="purchaseCalculation(s,purchase.value)" placeholder="Purchase Date" required>
|
<input matInput [max]="todaydate" [matDatepicker]="picker" formControlName="purchase_date" (dateChange)="purchaseCalculation(s,purchase.value)" placeholder="Purchase Date" required>
|
||||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||||
<mat-datepicker touchUi #picker></mat-datepicker>
|
<mat-datepicker touchUi #picker></mat-datepicker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export class ManageDailyPurchaseComponent implements OnInit {
|
|||||||
marginAmtInwords: any[]=[];
|
marginAmtInwords: any[]=[];
|
||||||
productListData : any[]=[];
|
productListData : any[]=[];
|
||||||
private notifier: NotifierService;
|
private notifier: NotifierService;
|
||||||
|
todaydate:Date = new Date();
|
||||||
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManageDailyPurchaseComponent>) {
|
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManageDailyPurchaseComponent>) {
|
||||||
this.pageTitle = this.data.manage_status==1 ? 'Add Daily Purchase Item' : 'Update Daily Purchase Item';
|
this.pageTitle = this.data.manage_status==1 ? 'Add Daily Purchase Item' : 'Update Daily Purchase Item';
|
||||||
this.notifier = notifier;
|
this.notifier = notifier;
|
||||||
|
|||||||
@ -38,7 +38,8 @@
|
|||||||
<div class="item-margin" fxLayout="row wrap" *ngFor="let childItem of sales.get('child').controls; let c = index" [formGroupName]="c">
|
<div class="item-margin" fxLayout="row wrap" *ngFor="let childItem of sales.get('child').controls; let c = index" [formGroupName]="c">
|
||||||
<div fxFlex="100" *ngIf="childItem.value.isactive===true">
|
<div fxFlex="100" *ngIf="childItem.value.isactive===true">
|
||||||
<mat-form-field style="width: 33%;">
|
<mat-form-field style="width: 33%;">
|
||||||
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="sales_date" (dateChange)="salesCalculation(s,sales.value)" placeholder="Sales Date" required>
|
<!-- <mat-error *ngIf="childItem.controls['sales_date'].hasError('matDatepickerMax')">Date should be inferior</mat-error>[max]="todaydate" -->
|
||||||
|
<input matInput [max]="todaydate" [matDatepicker]="picker" formControlName="sales_date" (dateChange)="salesCalculation(s,sales.value)" placeholder="Sales Date" required>
|
||||||
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
||||||
<mat-datepicker touchUi #picker></mat-datepicker>
|
<mat-datepicker touchUi #picker></mat-datepicker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@ -20,6 +20,15 @@ export class ManageDailySalesComponent implements OnInit {
|
|||||||
frequencyData: any[]=[];
|
frequencyData: any[]=[];
|
||||||
marginAmtInwords: any[]=[];
|
marginAmtInwords: any[]=[];
|
||||||
productandservice : any[]=[];
|
productandservice : any[]=[];
|
||||||
|
name = 'Angular';
|
||||||
|
|
||||||
|
now = new Date();
|
||||||
|
year = this.now.getFullYear();
|
||||||
|
month = this.now.getMonth();
|
||||||
|
day = this.now.getDay();
|
||||||
|
|
||||||
|
todaydate:Date = new Date();
|
||||||
|
|
||||||
private notifier: NotifierService;
|
private notifier: NotifierService;
|
||||||
check_type:any=[{'type_id':"1",'type_name':'Date Information'},{'type_id':"2",'type_name':'Frequency Information'}]
|
check_type:any=[{'type_id':"1",'type_name':'Date Information'},{'type_id':"2",'type_name':'Frequency Information'}]
|
||||||
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManageDailySalesComponent>) {
|
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManageDailySalesComponent>) {
|
||||||
|
|||||||
@ -34,54 +34,67 @@
|
|||||||
<mat-radio-button class="example-radio-button" color="primary" [value]="types.type_id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
|
<mat-radio-button class="example-radio-button" color="primary" [value]="types.type_id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
|
||||||
</mat-radio-group>
|
</mat-radio-group>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item-margin" fxFlex="100">
|
<div class="item-margin" fxFlex="100">
|
||||||
<mat-form-field style="width: 25%" *ngIf="item.value.purchase_type=='1'">
|
<mat-form-field style="width: 25%" *ngIf="item.value.purchase_type=='1'">
|
||||||
<input OnlyNumber type="text" matInput placeholder="Purchase Quantity" (keyup)="purchaseCalculation(s,item.value)" formControlName="purchase_qty" required>
|
<input OnlyNumber type="text" matInput placeholder="Purchase Quantity" (keyup)="purchaseCalculation(s,item.value)" formControlName="purchase_qty" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 25%" *ngIf="item.value.purchase_type=='1'">
|
<mat-form-field style="width: 25%" *ngIf="item.value.purchase_type=='1'">
|
||||||
<mat-select placeholder="UOM" formControlName="fk_uom_id" (selectionChange)="generateOtherUOM(s,item.value)" required>
|
<mat-select placeholder="UOM" formControlName="fk_uom_id" (selectionChange)="generateOtherUOM(s,item.value)" required>
|
||||||
<mat-option *ngFor="let uom of UOMData" [value]="uom.uom_id">{{uom.name}}</mat-option>
|
<mat-option *ngFor="let uom of UOMData" [value]="uom.uom_id">{{uom.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 27%" *ngIf="item.controls['uom_other']">
|
<mat-form-field style="width: 27%" *ngIf="item.controls['uom_other']">
|
||||||
<input type="text" matInput placeholder="Other UOM" formControlName="uom_other" required>
|
<input type="text" matInput placeholder="Other UOM" formControlName="uom_other" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="item-margin" fxFlex="100" *ngIf="item.value.purchase_type=='1'">
|
<div [ngSwitch]="item.value.purchase_type" fxFlex="100">
|
||||||
<mat-form-field style="width: 25%">
|
<!-- Case 1 -->
|
||||||
<input OnlyNumber type="text" matInput placeholder="Rate/Unit of Purchase" formControlName="rate_per_unit" (keyup)="purchaseCalculation(s,item.value)" required>
|
<div *ngSwitchCase="1" class="item-margin" fxFlex="100">
|
||||||
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.rate_per_unit != ''">{{"₹"}} {{item.value.rate_per_unit | numberToWords}} Only</mat-hint>
|
<mat-form-field style="width: 25%">
|
||||||
|
|
||||||
|
<input OnlyNumber type="text" matInput placeholder="Rate/Unit of Purchase" formControlName="rate_per_unit" (keyup)="purchaseCalculation(s,item.value)" required>
|
||||||
|
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.rate_per_unit != ''">{{"₹"}} {{item.value.rate_per_unit | numberToWords}} Only</mat-hint>
|
||||||
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 25%">
|
<mat-form-field style="width: 25%">
|
||||||
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="purchaseCalculation(s,item.value)" required>
|
|
||||||
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field style="width: 27%">
|
|
||||||
<input matInput OnlyNumber type="text" placeholder="Annual Purchase" formControlName="annual_purchase_value" readonly>
|
|
||||||
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_purchase_value != ''">{{"₹"}} {{item.value.annual_purchase_value | numberToWords}} Only</mat-hint>
|
|
||||||
|
|
||||||
</mat-form-field>
|
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="purchaseCalculation(s,item.value)" required>
|
||||||
</div>
|
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
|
||||||
<div class="item-margin" fxFlex="100" *ngIf="item.value.purchase_type=='2'">
|
|
||||||
<mat-form-field style="width: 25%">
|
</mat-select>
|
||||||
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="purchaseCalculation(s,item.value)" required>
|
</mat-form-field>
|
||||||
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
|
<mat-form-field style="width: 27%">
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
<input matInput OnlyNumber type="text" placeholder="Annual Purchase" formControlName="annual_purchase_value" readonly>
|
||||||
<mat-form-field style="width: 25%">
|
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_purchase_value != ''">{{"₹"}} {{item.value.annual_purchase_value | numberToWords}} Only</mat-hint>
|
||||||
<input OnlyNumber type="text" matInput [placeholder]="item.value.fk_frequency_id=='1' ? 'Other Sale' : item.value.fk_frequency_id=='2' ? 'Yearly Sale' : item.value.fk_frequency_id=='3' ? 'Half Yearly Sale' : item.value.fk_frequency_id=='4' ? 'Fortnightly Sale' : item.value.fk_frequency_id=='5' ? 'Daily Sale' : item.value.fk_frequency_id=='6' ? 'Quarterly Sale' : item.value.fk_frequency_id=='7' ? 'Monthly Sale' : ''" formControlName="rate_per_unit" (selectionChange)="purchaseCalculation(s,item.value)" required>
|
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<!-- case 2 -->
|
||||||
|
<div *ngSwitchCase="2" class="item-margin" fxFlex="100">
|
||||||
|
<mat-form-field style="width: 25%">
|
||||||
|
|
||||||
|
<mat-select placeholder="Frequency" formControlName="fk_frequency_id" (selectionChange)="purchaseCalculation(s,item.value)" required>
|
||||||
|
<mat-option *ngFor="let frq of frequencyData" [value]="frq.frequency_id">{{frq.name}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width: 25%">
|
||||||
|
|
||||||
|
<input OnlyNumber type="text" matInput [placeholder]="item.value.fk_frequency_id=='1' ? 'Other Sale' : item.value.fk_frequency_id=='2' ? 'Yearly Sale' : item.value.fk_frequency_id=='3' ? 'Half Yearly Sale' : item.value.fk_frequency_id=='4' ? 'Fortnightly Sale' : item.value.fk_frequency_id=='5' ? 'Daily Sale' : item.value.fk_frequency_id=='6' ? 'Quarterly Sale' : item.value.fk_frequency_id=='7' ? 'Monthly Sale' : ''" formControlName="rate_per_unit" (keyup)="purchaseCalculation(s,item.value)" required>
|
||||||
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.rate_per_unit != ''">{{"₹"}} {{item.value.rate_per_unit | numberToWords}} Only</mat-hint>
|
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.rate_per_unit != ''">{{"₹"}} {{item.value.rate_per_unit | numberToWords}} Only</mat-hint>
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
<mat-form-field style="width: 27%">
|
</mat-form-field>
|
||||||
<input matInput OnlyNumber type="text" placeholder="Annual Purchase" formControlName="annual_purchase_value" readonly>
|
|
||||||
|
<mat-form-field style="width: 27%">
|
||||||
|
|
||||||
|
<input matInput OnlyNumber type="text" placeholder="Annual Purchase" formControlName="annual_purchase_value" readonly>
|
||||||
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_purchase_value != ''">{{"₹"}} {{item.value.annual_purchase_value | numberToWords}} Only</mat-hint>
|
<mat-hint align="start" style="font-size:90%" *ngIf="item.value.annual_purchase_value != ''">{{"₹"}} {{item.value.annual_purchase_value | numberToWords}} Only</mat-hint>
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="item-product-margin" fxFlex="100">
|
<div class="item-product-margin" fxFlex="100">
|
||||||
<mat-form-field style="width: 92%">
|
<mat-form-field style="width: 92%">
|
||||||
<textarea matInput type="text" placeholder="Remarks" formControlName="comments"></textarea>
|
<textarea matInput type="text" placeholder="Remarks" formControlName="comments"></textarea>
|
||||||
@ -107,4 +120,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
s
|
||||||
|
|||||||
@ -116,36 +116,8 @@ closeDialogue(){
|
|||||||
this.dialogRef.close({update_status:false});
|
this.dialogRef.close({update_status:false});
|
||||||
}
|
}
|
||||||
|
|
||||||
purchaseCalculation(indexVal: number,values: any): void {
|
|
||||||
let control:any = <FormArray>this.purchaseItemForm.controls['purchase'];
|
|
||||||
|
|
||||||
if(values.purchase_type=="1" &&values.purchase_qty!='' && values.rate_per_unit!='' && values.fk_frequency_id!='') {
|
|
||||||
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id);
|
|
||||||
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.purchase_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
|
||||||
}
|
|
||||||
else if(values.purchase_type=="2" && values.rate_per_unit!='' && values.fk_frequency_id!='') {
|
|
||||||
|
|
||||||
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id);
|
|
||||||
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
control.controls[indexVal].controls['annual_purchase_value'].setValue('');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
removeItem(indexVal: number) : void {
|
|
||||||
let control = <FormArray>this.purchaseItemForm.controls['purchase'];
|
|
||||||
control.removeAt(indexVal);
|
|
||||||
|
|
||||||
}
|
|
||||||
// generate other UOM
|
|
||||||
generateOtherUOM(index: number, values: any): void {
|
|
||||||
let control: any = <FormArray>this.purchaseItemForm.controls['purchase'];
|
|
||||||
values.fk_uom_id=="1" ? control.controls[index].addControl('uom_other', new FormControl('', Validators.required)) : control.controls[index].removeControl('uom_other');
|
|
||||||
}
|
|
||||||
|
|
||||||
changeOptions(indexVal: any,event: any): void{
|
changeOptions(indexVal: any,event: any): void{
|
||||||
|
console.log('indexVal: any,event: any',indexVal,event);
|
||||||
let control: any = <FormArray>this.purchaseItemForm.controls['purchase'];
|
let control: any = <FormArray>this.purchaseItemForm.controls['purchase'];
|
||||||
if(event.value=="1"){
|
if(event.value=="1"){
|
||||||
control.controls[indexVal].controls['purchase_qty'].setValidators([Validators.required]);
|
control.controls[indexVal].controls['purchase_qty'].setValidators([Validators.required]);
|
||||||
@ -167,6 +139,36 @@ changeOptions(indexVal: any,event: any): void{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
purchaseCalculation(indexVal: number,values: any): void {
|
||||||
|
console.log('indexVal: number,values: any',indexVal,values);
|
||||||
|
let control:any = <FormArray>this.purchaseItemForm.controls['purchase'];
|
||||||
|
|
||||||
|
if(values.purchase_type=="1" &&values.purchase_qty!='' && values.rate_per_unit!='' && values.fk_frequency_id!='') {
|
||||||
|
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id);
|
||||||
|
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.purchase_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
||||||
|
}
|
||||||
|
else if(values.purchase_type=="2" && values.rate_per_unit!='' && values.fk_frequency_id!='') {
|
||||||
|
console.log('purchaseCalculation else if');
|
||||||
|
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id);
|
||||||
|
control.controls[indexVal].controls['annual_purchase_value'].setValue(parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
control.controls[indexVal].controls['annual_purchase_value'].setValue('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
removeItem(indexVal: number) : void {
|
||||||
|
let control = <FormArray>this.purchaseItemForm.controls['purchase'];
|
||||||
|
control.removeAt(indexVal);
|
||||||
|
|
||||||
|
}
|
||||||
|
// generate other UOM
|
||||||
|
generateOtherUOM(index: number, values: any): void {
|
||||||
|
let control: any = <FormArray>this.purchaseItemForm.controls['purchase'];
|
||||||
|
values.fk_uom_id=="1" ? control.controls[index].addControl('uom_other', new FormControl('', Validators.required)) : control.controls[index].removeControl('uom_other');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// save purchase details
|
// save purchase details
|
||||||
submitDetails(records) {
|
submitDetails(records) {
|
||||||
if (this.purchaseItemForm.invalid) {
|
if (this.purchaseItemForm.invalid) {
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
<!-- Position1 Column -->
|
<!-- Position1 Column -->
|
||||||
<ng-container matColumnDef="position_2">
|
<ng-container matColumnDef="position_2">
|
||||||
<th mat-header-cell *matHeaderCellDef> Declared by customer</th>
|
<th mat-header-cell *matHeaderCellDef> Declared by Customer</th>
|
||||||
<td mat-cell *matCellDef="let element;let i = index">{{ i==7 ? element.declared_by_customer : i==9 ? element.declared_by_customer : element.declared_by_customer | rupeeCurrencyFormat}} </td>
|
<td mat-cell *matCellDef="let element;let i = index">{{ i==7 ? element.declared_by_customer : i==9 ? element.declared_by_customer : element.declared_by_customer | rupeeCurrencyFormat}} </td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -74,7 +74,7 @@
|
|||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab label="Sales">
|
<mat-tab label="Sales">
|
||||||
<ng-template matTabContent>
|
<ng-template matTabContent>
|
||||||
<app-gross-profit-calculation [masterData]="getCustomValues" [parentData]="grossProfitTypeList" (loadAssessedForms)="loadAIDetails()" TabLabel="Sales"></app-gross-profit-calculation>
|
<app-gross-profit-calculation [masterData]="getCustomValues" [parentData]="grossProfitTypeList" (loadAssessedForms)="loadAIDetails()"></app-gross-profit-calculation>
|
||||||
<app-sales-calculation [masterData]="getCustomValues" [parentData]="salesDeclaredCustomer" (loadAssessedForms)="loadAIDetails()"></app-sales-calculation>
|
<app-sales-calculation [masterData]="getCustomValues" [parentData]="salesDeclaredCustomer" (loadAssessedForms)="loadAIDetails()"></app-sales-calculation>
|
||||||
<app-sales-details [masterData]="getCustomValues" [parentData]="salesCaluatedItem" (loadAssessedForms)="loadAIDetails()"></app-sales-details>
|
<app-sales-details [masterData]="getCustomValues" [parentData]="salesCaluatedItem" (loadAssessedForms)="loadAIDetails()"></app-sales-details>
|
||||||
<app-daily-sales-details [masterData]="getCustomValues" [parentData]="salesMonthWiseExpandedItems" (loadAssessedForms)="loadAIDetails()"></app-daily-sales-details>
|
<app-daily-sales-details [masterData]="getCustomValues" [parentData]="salesMonthWiseExpandedItems" (loadAssessedForms)="loadAIDetails()"></app-daily-sales-details>
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import { RupeeCurrencyFormatPipe } from './../../../../../pd-pipes/rupee-currenc
|
|||||||
providers: [RupeeCurrencyFormatPipe]
|
providers: [RupeeCurrencyFormatPipe]
|
||||||
})
|
})
|
||||||
export class AssessedIncomeComponent implements OnInit {
|
export class AssessedIncomeComponent implements OnInit {
|
||||||
|
|
||||||
displayedSummaryColumns: any =[];
|
displayedSummaryColumns: any =[];
|
||||||
summaryItemSource:any = [];
|
summaryItemSource:any = [];
|
||||||
customer_segment_abbr: any;
|
customer_segment_abbr: any;
|
||||||
@ -213,6 +214,7 @@ public viewerOptions: any = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(value.records.final_data.length >0 && (value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.cost_of_goods_sold) || (value.records.final_data[0].sales_calculated_by_itemwise &&value.records.final_data[0].sales_calculated_by_itemwise.cost_of_goods_sold)|| (value.records.final_data[0].sales_calculated_by_monthwise &&value.records.final_data[0].sales_calculated_by_monthwise.cost_of_goods_sold) ){
|
if(value.records.final_data.length >0 && (value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.cost_of_goods_sold) || (value.records.final_data[0].sales_calculated_by_itemwise &&value.records.final_data[0].sales_calculated_by_itemwise.cost_of_goods_sold)|| (value.records.final_data[0].sales_calculated_by_monthwise &&value.records.final_data[0].sales_calculated_by_monthwise.cost_of_goods_sold) ){
|
||||||
|
|
||||||
let get_sumary: any=[];
|
let get_sumary: any=[];
|
||||||
// set sales and revenue
|
// set sales and revenue
|
||||||
get_sumary.push({"sno":'a. ',"label":'Sales / Revenue ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.sales_revenue) ? value.records.final_data[0].sales_declared_by_customer.sales_revenue:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue:0 });
|
get_sumary.push({"sno":'a. ',"label":'Sales / Revenue ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.sales_revenue) ? value.records.final_data[0].sales_declared_by_customer.sales_revenue:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue:0 });
|
||||||
@ -251,6 +253,7 @@ public viewerOptions: any = {
|
|||||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nerprofit })
|
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit Amount ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nerprofit })
|
||||||
:'';
|
:'';
|
||||||
|
|
||||||
|
|
||||||
// get conslidate net margin details
|
// get conslidate net margin details
|
||||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales %',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales %',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit to Sales % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||||
@ -277,6 +280,7 @@ public viewerOptions: any = {
|
|||||||
// this.sumary_details.net_disable_income_value = Number(this.sumary_details.net_profit) - Number(this.sumary_details.household_expenses);
|
// this.sumary_details.net_disable_income_value = Number(this.sumary_details.net_profit) - Number(this.sumary_details.household_expenses);
|
||||||
}
|
}
|
||||||
else if(value.records.final_data.length >0 && (value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.purchases) || (value.records.final_data[0].sales_calculated_by_itemwise &&value.records.final_data[0].sales_calculated_by_itemwise.purchases)|| (value.records.final_data[0].sales_calculated_by_monthwise &&value.records.final_data[0].sales_calculated_by_monthwise.purchases)){
|
else if(value.records.final_data.length >0 && (value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.purchases) || (value.records.final_data[0].sales_calculated_by_itemwise &&value.records.final_data[0].sales_calculated_by_itemwise.purchases)|| (value.records.final_data[0].sales_calculated_by_monthwise &&value.records.final_data[0].sales_calculated_by_monthwise.purchases)){
|
||||||
|
|
||||||
let get_sumary: any=[];
|
let get_sumary: any=[];
|
||||||
// set sales and revenue
|
// set sales and revenue
|
||||||
get_sumary.push({"sno":'a. ',"label":'Sales / Revenue ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.sales_revenue) ? value.records.final_data[0].sales_declared_by_customer.sales_revenue:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue:0 });
|
get_sumary.push({"sno":'a. ',"label":'Sales / Revenue ',"declared_by_customer":(value.records.final_data[0].sales_declared_by_customer && value.records.final_data[0].sales_declared_by_customer.sales_revenue) ? value.records.final_data[0].sales_declared_by_customer.sales_revenue:0, "derived_item_wise":(value.records.final_data[0].sales_calculated_by_itemwise && value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_itemwise.sales_revenue:0 ,"derived_sales_book":(value.records.final_data[0].sales_calculated_by_monthwise && value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue) ? value.records.final_data[0].sales_calculated_by_monthwise.sales_revenue:0 });
|
||||||
@ -314,6 +318,8 @@ public viewerOptions: any = {
|
|||||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nerprofit })
|
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer==null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Profit ',"declared_by_customer":'', "derived_item_wise":'' ,"derived_sales_book":value.records.final_data[0].consolidated_report.consolidated_nerprofit })
|
||||||
:'';
|
:'';
|
||||||
// get conslidate net margin details
|
// get conslidate net margin details
|
||||||
|
|
||||||
|
|
||||||
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
(value.records.final_data[0].consolidated_report && value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise!=null && value.records.final_data[0].sales_calculated_by_monthwise==null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||||
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
: (value.records.final_data[0].consolidated_report &&value.records.final_data[0].sales_declared_by_customer!=null && value.records.final_data[0].sales_calculated_by_itemwise==null && value.records.final_data[0].sales_calculated_by_monthwise!=null) ? get_sumary.push({"sno":'',"label":'Considered Net Margin % ',"declared_by_customer":value.records.final_data[0].consolidated_report.consolidated_nermagin +'%', "derived_item_wise":'' ,"derived_sales_book":'' })
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<mat-option *ngFor="let getSale of check_sales_type" [value]="getSale.id">{{getSale.name}}</mat-option>
|
<mat-option *ngFor="let getSale of check_sales_type" [value]="getSale.id">{{getSale.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field> -->
|
</mat-form-field> -->
|
||||||
<div style="width: 35%" fxFlex="35" *ngIf="grossProfitForm.controls['mode'].value == 1 && TabLabel == 'Purchase'">
|
<div style="width: 35%" fxFlex="35" *ngIf="grossProfitForm.controls['mode'].value == 1">
|
||||||
|
|
||||||
<!-- <mat-radio-group formControlName="margin" class="example-radio-group">
|
<!-- <mat-radio-group formControlName="margin" class="example-radio-group">
|
||||||
<mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of purchase_sub_type; let t = index">{{types.name}}</mat-radio-button>
|
<mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of purchase_sub_type; let t = index">{{types.name}}</mat-radio-button>
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { NotifierService } from 'angular-notifier';
|
|||||||
export class GrossProfitCalculationComponent implements OnInit, OnChanges {
|
export class GrossProfitCalculationComponent implements OnInit, OnChanges {
|
||||||
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number, company_id:number};
|
@Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number, company_id:number};
|
||||||
@Input() parentData: any;
|
@Input() parentData: any;
|
||||||
@Input() TabLabel: any;
|
// @Input() TabLabel: any;
|
||||||
@Output() loadAssessedForms = new EventEmitter<string>();
|
@Output() loadAssessedForms = new EventEmitter<string>();
|
||||||
public grossProfitForm: FormGroup;
|
public grossProfitForm: FormGroup;
|
||||||
check__purchse_type:any=[{'id':'1','name':'Yes'},{'id':'2','name':'No'}]
|
check__purchse_type:any=[{'id':'1','name':'Yes'},{'id':'2','name':'No'}]
|
||||||
@ -22,18 +22,15 @@ export class GrossProfitCalculationComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
console.log('TabLabel',this.TabLabel);
|
|
||||||
}
|
}
|
||||||
changeOptions(values: any){
|
changeOptions(values: any){
|
||||||
// console.log('values',values);
|
// console.log('values',values);
|
||||||
|
|
||||||
if(this.TabLabel == 'Sales' && values.mode == 1){
|
if(values.mode == 1){
|
||||||
this.grossProfitForm.controls['margin'].setValue('');
|
|
||||||
this.grossProfitForm.controls['purchase_type'].setValue('');
|
|
||||||
}
|
|
||||||
else if(this.TabLabel == 'Purchase' && values.mode == 1){
|
|
||||||
this.grossProfitForm.controls['margin'].setValue('');
|
this.grossProfitForm.controls['margin'].setValue('');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** if Mode Value is 'No' -> margin value is setted as netmargin and its id - 2
|
/** if Mode Value is 'No' -> margin value is setted as netmargin and its id - 2
|
||||||
* Refer => check_sales_type **/
|
* Refer => check_sales_type **/
|
||||||
if(values.mode == 2){
|
if(values.mode == 2){
|
||||||
@ -41,16 +38,9 @@ export class GrossProfitCalculationComponent implements OnInit, OnChanges {
|
|||||||
this.grossProfitForm.controls['purchase_type'].setValue('');
|
this.grossProfitForm.controls['purchase_type'].setValue('');
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('values',values);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if(values.mode == 2 && this.TabLabel == 'Purchase'){
|
|
||||||
// this.grossProfitForm.controls['margin'].setValue('2');
|
|
||||||
// this.grossProfitForm.controls['purchase_type'].setValue(null);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
submitDetails(records: any){
|
submitDetails(records: any){
|
||||||
console.log(records);
|
console.log(records);
|
||||||
// return;
|
// return;
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<ng-container matColumnDef="purchase_quantity">
|
<ng-container matColumnDef="purchase_quantity">
|
||||||
<th mat-header-cell *matHeaderCellDef> Purchase Quantity </th>
|
<th mat-header-cell *matHeaderCellDef> Purchase Quantity </th>
|
||||||
<td mat-cell *matCellDef="let element"> {{element.purchase_qty}} </td>
|
<td mat-cell *matCellDef="let element"> {{element.purchase_type=="1" ? element.purchase_qty : ''}} </td>
|
||||||
<td mat-footer-cell *matFooterCellDef> </td>
|
<td mat-footer-cell *matFooterCellDef> </td>
|
||||||
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@ -21,21 +21,26 @@
|
|||||||
{{tl.name}}
|
{{tl.name}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error *ngIf="applicant.controls['applicant_title_name'].invalid">Title Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 60%">
|
<mat-form-field style="width: 60%">
|
||||||
<input matInput placeholder="Name" formControlName="applicant_name" type="text" required>
|
<input matInput placeholder="Name" formControlName="applicant_name" type="text" required>
|
||||||
|
<mat-error *ngIf="applicant.controls['applicant_name'].invalid">Name Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 30%">
|
<mat-form-field style="width: 30%">
|
||||||
<input matInput placeholder="Age" formControlName="age" minlength="1" maxlength="3" OnlyNumber type="text"
|
<input matInput placeholder="Age" formControlName="age" minlength="1" maxlength="3" OnlyNumber type="text"
|
||||||
autocomplete="off">
|
autocomplete="off">
|
||||||
|
<mat-error *ngIf="applicant.controls['age'].invalid">Age Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 60%">
|
<mat-form-field style="width: 60%">
|
||||||
<mat-select placeholder="Qualification" formControlName="qualification" style="width: 75%;">
|
<mat-select placeholder="Qualification" formControlName="qualification" style="width: 75%;">
|
||||||
<mat-option *ngFor="let qual of qualificationList" [value]="qual.qualification_id">{{qual.qualification_name}}</mat-option>
|
<mat-option *ngFor="let qual of qualificationList" [value]="qual.qualification_id">{{qual.qualification_name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error *ngIf="applicant.controls['qualification'].invalid">Qualification Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 60%" [style.visibility]="applicant.get('qualification').value == '' || applicant.get('qualification').value == '4' || applicant.get('qualification').value == '6' ? 'hidden':'visible'">
|
<mat-form-field style="width: 60%" [style.visibility]="applicant.get('qualification').value == '' || applicant.get('qualification').value == '4' || applicant.get('qualification').value == '6' ? 'hidden':'visible'">
|
||||||
<input matInput placeholder="Qualification Details" formControlName="course_name" autocomplete="off">
|
<input matInput placeholder="Qualification Details" formControlName="course_name" autocomplete="off">
|
||||||
|
<mat-error *ngIf="applicant.controls['course_name'].invalid">Qualification Details Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<div fxLayout="row wrap">
|
<div fxLayout="row wrap">
|
||||||
|
|||||||
@ -93,7 +93,71 @@ export class OtherApplicantDetailsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// save applicant
|
// save applicant
|
||||||
|
temp: number = 0;
|
||||||
saveApplicant(formData: any) {
|
saveApplicant(formData: any) {
|
||||||
|
console.log(formData);
|
||||||
|
// console.log('formData',formData);
|
||||||
|
|
||||||
|
if (formData.applicant_list.length > 0) {
|
||||||
|
|
||||||
|
formData.applicant_list.forEach((val, index) => {
|
||||||
|
|
||||||
|
if (val.is_person_met == false && val.is_applicant == false) {
|
||||||
|
|
||||||
|
this.temp++;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.temp == formData.applicant_list.length) {
|
||||||
|
// this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
|
||||||
|
alert('Please Choose Name of Person Met (or) Name of Applicant .!');
|
||||||
|
this.temp = 0;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let control = <FormArray>this._OtherForm.controls['applicant_list'];
|
||||||
|
let individualCtrlLength: any = control.controls.length;
|
||||||
|
if (individualCtrlLength > 0) {
|
||||||
|
|
||||||
|
let icnt = 0;
|
||||||
|
while (icnt < individualCtrlLength) {
|
||||||
|
|
||||||
|
let individualChildCtrl: any = control.controls[icnt];
|
||||||
|
|
||||||
|
|
||||||
|
individualChildCtrl.controls.age.clearValidators();
|
||||||
|
individualChildCtrl.controls.qualification.clearValidators();
|
||||||
|
individualChildCtrl.controls.course_name.clearValidators();
|
||||||
|
// if (individualChildCtrl.controls.is_person_met.value == false && individualChildCtrl.controls.is_applicant.value == false) {
|
||||||
|
// alert('Both the check boxes are empty at'+(icnt+1));
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
if (individualChildCtrl.controls.is_person_met.value == false && individualChildCtrl.controls.is_applicant.value == true) {
|
||||||
|
|
||||||
|
individualChildCtrl.controls.age.setValidators(Validators.compose([Validators.required]));
|
||||||
|
individualChildCtrl.controls.qualification.setValidators(Validators.compose([Validators.required]));
|
||||||
|
|
||||||
|
}
|
||||||
|
if (individualChildCtrl.controls.is_person_met.value == true && individualChildCtrl.controls.is_applicant.value == true) {
|
||||||
|
|
||||||
|
individualChildCtrl.controls.age.setValidators(Validators.compose([Validators.required]));
|
||||||
|
individualChildCtrl.controls.qualification.setValidators(Validators.compose([Validators.required]));
|
||||||
|
|
||||||
|
}
|
||||||
|
if(individualChildCtrl.controls.qualification.value == '' || individualChildCtrl.controls.qualification.value == '4' || individualChildCtrl.controls.qualification.value == '6')
|
||||||
|
{ individualChildCtrl.controls.course_name.setValue(''); individualChildCtrl.controls.course_name.clearValidators(); }
|
||||||
|
else{ individualChildCtrl.controls.course_name.setValidators(Validators.compose([Validators.required]));}
|
||||||
|
|
||||||
|
individualChildCtrl.controls.age.updateValueAndValidity();
|
||||||
|
individualChildCtrl.controls.qualification.updateValueAndValidity();
|
||||||
|
individualChildCtrl.controls.course_name.updateValueAndValidity();
|
||||||
|
|
||||||
|
icnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this._OtherForm.invalid) {
|
if (this._OtherForm.invalid) {
|
||||||
this.validateAllFormFields(this._OtherForm);
|
this.validateAllFormFields(this._OtherForm);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -82,7 +82,7 @@
|
|||||||
</mat-form-field> -->
|
</mat-form-field> -->
|
||||||
|
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput placeholder="Number of yrs" formControlName="residence_No_of_years"
|
<input matInput placeholder="No of years in current residence" formControlName="residence_No_of_years"
|
||||||
OnlyNumber type="text" required>
|
OnlyNumber type="text" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|||||||
@ -49,8 +49,13 @@
|
|||||||
<ng-container matColumnDef="age">
|
<ng-container matColumnDef="age">
|
||||||
<mat-header-cell *matHeaderCellDef> Age </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Age </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||||
<input matInput placeholder="Age" formControlName="age" minlength="1" maxlength="3"
|
<div class="example-container">
|
||||||
OnlyNumber type="text" autocomplete="off">
|
<input matInput placeholder="Age" formControlName="age" minlength="1" maxlength="3"
|
||||||
|
OnlyNumber type="text" autocomplete="off">
|
||||||
|
<mat-error style="font-size:65%" *ngIf="details.controls['age'].invalid">Age Required</mat-error>
|
||||||
|
<!-- <mat-error style="font-size:65%" *ngIf="_generalForm.controls.individuals.value[i].qualificationdetails.controls['age'].invalid">Age Required</mat-error> -->
|
||||||
|
<!-- <mat-error style="font-size:65%" *ngIf="details.controls['age'].hasError('required')">Age Required</mat-error> -->
|
||||||
|
</div>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container matColumnDef="qualification">
|
<ng-container matColumnDef="qualification">
|
||||||
@ -59,13 +64,17 @@
|
|||||||
<mat-select placeholder="Qualification" formControlName="qualification" style="width: 75%;">
|
<mat-select placeholder="Qualification" formControlName="qualification" style="width: 75%;">
|
||||||
<mat-option *ngFor="let qual of qualificationList" [value]="qual.qualification_id">{{qual.qualification_name}}</mat-option>
|
<mat-option *ngFor="let qual of qualificationList" [value]="qual.qualification_id">{{qual.qualification_name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error style="font-size:65%" *ngIf="details.controls['qualification'].invalid">Qualification Required</mat-error>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container matColumnDef="course_name">
|
<ng-container matColumnDef="course_name">
|
||||||
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.individuals.value[i].qualification == '' || _generalForm.controls.individuals.value[i].qualification == '4' || _generalForm.controls.individuals.value[i].qualification == '6' ? 'hidden':'visible'">
|
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.individuals.value[i].qualification == '' || _generalForm.controls.individuals.value[i].qualification == '4' || _generalForm.controls.individuals.value[i].qualification == '6' ? 'hidden':'visible'">
|
||||||
|
<span class="example-container">
|
||||||
<input matInput placeholder="Qualification Details" formControlName="course_name"
|
<input matInput placeholder="Qualification Details" formControlName="course_name"
|
||||||
autocomplete="off">
|
autocomplete="off">
|
||||||
|
<mat-error style="font-size:65%" *ngIf="details.controls['course_name'].invalid">Qualification Details Required</mat-error>
|
||||||
|
</span>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container matColumnDef="actions">
|
<ng-container matColumnDef="actions">
|
||||||
@ -103,7 +112,8 @@
|
|||||||
<mat-form-field style="width: 20%;">
|
<mat-form-field style="width: 20%;">
|
||||||
<input matInput placeholder="Year" formControlName="rental_income_rcv_in_years" autocomplete="off"
|
<input matInput placeholder="Year" formControlName="rental_income_rcv_in_years" autocomplete="off"
|
||||||
OnlyNumber type="text" required>
|
OnlyNumber type="text" required>
|
||||||
<mat-error>Please Enter Correct Year</mat-error>
|
<mat-error *ngIf="com.controls['rental_income_rcv_in_years'].invalid">Please Enter Correct Year</mat-error>
|
||||||
|
<!-- <mat-error>Please Enter Correct Year</mat-error> -->
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 20%;">
|
<mat-form-field style="width: 20%;">
|
||||||
<input matInput type="text" placeholder="Month" formControlName="rental_income_rcv_in_month"
|
<input matInput type="text" placeholder="Month" formControlName="rental_income_rcv_in_month"
|
||||||
@ -132,18 +142,19 @@
|
|||||||
(selectionChange)="checkEntityType(com.value.business_entity_type,c)" required>
|
(selectionChange)="checkEntityType(com.value.business_entity_type,c)" required>
|
||||||
<mat-option [value]="entity.business_entity_type_id" *ngFor="let entity of businessEntityTypeList">{{entity.business_entity_type_name}}</mat-option>
|
<mat-option [value]="entity.business_entity_type_id" *ngFor="let entity of businessEntityTypeList">{{entity.business_entity_type_name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
<mat-error *ngIf="com.controls['business_entity_type'].invalid">Business Entity Type Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 45%;" *ngIf="com.controls.business_entity_type_other">
|
<mat-form-field style="width: 45%;" *ngIf="com.controls.business_entity_type_other">
|
||||||
<input matInput placeholder="Please Specify Others" formControlName="business_entity_type_other"
|
<input matInput placeholder="Please Specify Others" formControlName="business_entity_type_other"
|
||||||
required>
|
required>
|
||||||
|
<mat-error *ngIf="com.controls['business_entity_type_other'].invalid">Please Specify Others Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<p>Number of Years For Which The Business Has Been Running</p>
|
<p>Number of Years For Which The Business Has Been Running</p>
|
||||||
<mat-form-field style="width: 20%;">
|
<mat-form-field style="width: 20%;">
|
||||||
<input matInput placeholder="Year" formControlName="business_years" autocomplete="off"
|
<input matInput placeholder="Year" formControlName="business_years" autocomplete="off"
|
||||||
OnlyNumber type="text" required>
|
OnlyNumber type="text" required>
|
||||||
<mat-error>Please Enter Correct Year</mat-error>
|
<mat-error *ngIf="com.controls['business_years'].invalid">Please Enter Correct Year</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width: 20%;">
|
<mat-form-field style="width: 20%;">
|
||||||
<input matInput type="text" placeholder="Month" formControlName="business_month"
|
<input matInput type="text" placeholder="Month" formControlName="business_month"
|
||||||
|
|||||||
@ -13,6 +13,15 @@
|
|||||||
margin: 0 2%;
|
margin: 0 2%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.example-container {
|
||||||
|
// display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.example-container > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
mat-header-cell mat-cell {
|
mat-header-cell mat-cell {
|
||||||
display:flex;
|
display:flex;
|
||||||
justify-content:flex-end;
|
justify-content:flex-end;
|
||||||
|
|||||||
@ -603,7 +603,65 @@ export class GeneralInfoComponent implements OnInit {
|
|||||||
// submit form details
|
// submit form details
|
||||||
temp: number = 0;
|
temp: number = 0;
|
||||||
submitGeneralForm(formData: any) {
|
submitGeneralForm(formData: any) {
|
||||||
// console.log('formData',formData);
|
// console.log('formData',formData);
|
||||||
|
|
||||||
|
if (formData.individuals.length > 0) {
|
||||||
|
|
||||||
|
formData.individuals.forEach((val, index) => {
|
||||||
|
|
||||||
|
if (val.is_person_met == false) {
|
||||||
|
|
||||||
|
this.temp++;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
if (this.temp == formData.individuals.length) {
|
||||||
|
this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
|
||||||
|
|
||||||
|
this.temp = 0;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let individualCtrl: any = this._generalForm.get('individuals') as FormArray;
|
||||||
|
let individualCtrlLength: any = individualCtrl.controls.length;
|
||||||
|
|
||||||
|
if (individualCtrlLength > 0) {
|
||||||
|
|
||||||
|
let icnt = 0;
|
||||||
|
while (icnt < individualCtrlLength) {
|
||||||
|
|
||||||
|
let individualChildCtrl: any = individualCtrl.controls[icnt];
|
||||||
|
|
||||||
|
|
||||||
|
individualChildCtrl.controls.age.clearValidators();
|
||||||
|
individualChildCtrl.controls.qualification.clearValidators();
|
||||||
|
individualChildCtrl.controls.course_name.clearValidators();
|
||||||
|
|
||||||
|
if (individualChildCtrl.controls.is_person_met.value == false && individualChildCtrl.controls.is_applicant.value == true) {
|
||||||
|
|
||||||
|
individualChildCtrl.controls.age.setValidators(Validators.compose([Validators.required]));
|
||||||
|
individualChildCtrl.controls.qualification.setValidators(Validators.compose([Validators.required]));
|
||||||
|
|
||||||
|
}
|
||||||
|
if (individualChildCtrl.controls.is_person_met.value == true && individualChildCtrl.controls.is_applicant.value == true) {
|
||||||
|
|
||||||
|
individualChildCtrl.controls.age.setValidators(Validators.compose([Validators.required]));
|
||||||
|
individualChildCtrl.controls.qualification.setValidators(Validators.compose([Validators.required]));
|
||||||
|
|
||||||
|
}
|
||||||
|
if(individualChildCtrl.controls.qualification.value == '' || individualChildCtrl.controls.qualification.value == '4' || individualChildCtrl.controls.qualification.value == '6')
|
||||||
|
{individualChildCtrl.controls.course_name.setValue(''); individualChildCtrl.controls.course_name.clearValidators();}else{ individualChildCtrl.controls.course_name.setValidators(Validators.compose([Validators.required]));}
|
||||||
|
|
||||||
|
individualChildCtrl.controls.age.updateValueAndValidity();
|
||||||
|
individualChildCtrl.controls.qualification.updateValueAndValidity();
|
||||||
|
individualChildCtrl.controls.course_name.updateValueAndValidity();
|
||||||
|
|
||||||
|
icnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (this.customer_segment_abbr != 'SE-RI') {
|
if (this.customer_segment_abbr != 'SE-RI') {
|
||||||
this._generalForm.controls['rental_income_rcv_in_years'].clearValidators();
|
this._generalForm.controls['rental_income_rcv_in_years'].clearValidators();
|
||||||
this._generalForm.controls['rental_income_rcv_in_years'].updateValueAndValidity();
|
this._generalForm.controls['rental_income_rcv_in_years'].updateValueAndValidity();
|
||||||
@ -611,28 +669,28 @@ export class GeneralInfoComponent implements OnInit {
|
|||||||
// SE-RI means Companies Control Required Removed.
|
// SE-RI means Companies Control Required Removed.
|
||||||
if (this.customer_segment_abbr == 'SE-RI') {
|
if (this.customer_segment_abbr == 'SE-RI') {
|
||||||
let CompanyCtrl: any = this._generalForm.get('companies') as FormArray;
|
let CompanyCtrl: any = this._generalForm.get('companies') as FormArray;
|
||||||
let CompanyCtrlLength : any = CompanyCtrl.controls.length;
|
let CompanyCtrlLength: any = CompanyCtrl.controls.length;
|
||||||
if (CompanyCtrlLength > 0) {
|
if (CompanyCtrlLength > 0) {
|
||||||
let cnt = 0;
|
let cnt = 0;
|
||||||
while(cnt < CompanyCtrlLength){
|
while (cnt < CompanyCtrlLength) {
|
||||||
|
|
||||||
let CompanyChildCtrl : any = CompanyCtrl.controls[cnt];
|
let CompanyChildCtrl: any = CompanyCtrl.controls[cnt];
|
||||||
|
|
||||||
CompanyChildCtrl.controls.company_name.clearValidators();
|
CompanyChildCtrl.controls.company_name.clearValidators();
|
||||||
CompanyChildCtrl.controls.company_name.updateValueAndValidity();
|
CompanyChildCtrl.controls.company_name.updateValueAndValidity();
|
||||||
|
|
||||||
CompanyChildCtrl.controls.business_entity_type.clearValidators();
|
CompanyChildCtrl.controls.business_entity_type.clearValidators();
|
||||||
CompanyChildCtrl.controls.business_entity_type.updateValueAndValidity();
|
CompanyChildCtrl.controls.business_entity_type.updateValueAndValidity();
|
||||||
|
|
||||||
// CompanyChildCtrl.controls.business_entity_type_other.clearValidators();
|
// CompanyChildCtrl.controls.business_entity_type_other.clearValidators();
|
||||||
// CompanyChildCtrl.controls.business_entity_type_other.updateValueAndValidity();
|
// CompanyChildCtrl.controls.business_entity_type_other.updateValueAndValidity();
|
||||||
|
|
||||||
CompanyChildCtrl.controls.business_years.clearValidators();
|
CompanyChildCtrl.controls.business_years.clearValidators();
|
||||||
CompanyChildCtrl.controls.business_years.updateValueAndValidity();
|
CompanyChildCtrl.controls.business_years.updateValueAndValidity();
|
||||||
|
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (this._generalForm.invalid) {
|
if (this._generalForm.invalid) {
|
||||||
@ -642,25 +700,7 @@ export class GeneralInfoComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (formData.individuals.length > 0) {
|
|
||||||
|
|
||||||
formData.individuals.forEach((val, index) => {
|
|
||||||
|
|
||||||
if (val.is_person_met == false) {
|
|
||||||
|
|
||||||
this.temp++;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.temp == formData.individuals.length) {
|
|
||||||
this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
|
|
||||||
|
|
||||||
this.temp = 0;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.disableAfterSubmit = true;
|
this.disableAfterSubmit = true;
|
||||||
let saveRecords: any = {}
|
let saveRecords: any = {}
|
||||||
saveRecords.pdid = formData.pdid;
|
saveRecords.pdid = formData.pdid;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user