sheet changes : ps
This commit is contained in:
parent
c94c53777c
commit
7915f22598
@ -136,7 +136,7 @@
|
||||
|
||||
|
||||
<div formArrayName="addresses" *ngFor="let addresses of pdAddresses.controls; let i = index; let last = last">
|
||||
<mat-card [formGroupName]="i">
|
||||
<mat-card [formGroupName]="i">{{addressesDeactivited[i]}}
|
||||
<mat-card-header>
|
||||
<mat-card-title>Address Details #{{i+1}} <span *ngIf="!addressesDeactivited[i]" style="color: red;" align="end"><i> Deactivited </i></span> </mat-card-title>
|
||||
</mat-card-header>
|
||||
@ -197,7 +197,7 @@
|
||||
</button>
|
||||
|
||||
|
||||
<button type="button" mat-raised-button mat-icon-button (click)="addAddresses()" *ngIf="last"
|
||||
<button type="button" mat-raised-button mat-icon-button (click)="addAddresses(i)" *ngIf="last"
|
||||
matTooltip="Add More Additional Addresses" matTooltipPosition="above"
|
||||
class="mr-1 mb-1 hover-icon" color="primary" type="button">
|
||||
<mat-icon>add</mat-icon>
|
||||
|
||||
@ -271,9 +271,13 @@ export class EditPdMasterComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
};
|
||||
addAddresses() {
|
||||
addAddresses(index) {
|
||||
console.log(index);
|
||||
this.addressesDeactivited[index] = true;
|
||||
console.log('this.addressesDeactivited[index]',this.addressesDeactivited[index]);
|
||||
this.addresses = this._EditPDtriggerForm.get('addresses') as FormArray;
|
||||
this.addresses.push(this.createAddresses(null));
|
||||
|
||||
}
|
||||
|
||||
removeAddresses(index: number,strflag : any) {
|
||||
@ -283,7 +287,7 @@ export class EditPdMasterComponent implements OnInit {
|
||||
this.addressesDeactivited[index] = false;
|
||||
}
|
||||
else if(strflag == 'Activited'){
|
||||
address_control.controls[index]['controls'].isactive.setValue(1);
|
||||
address_control.controls[index]['controls'].isactive.setValue(1);
|
||||
this.addressesDeactivited[index] = true;
|
||||
}
|
||||
|
||||
|
||||
@ -337,7 +337,7 @@
|
||||
<div fxFlex="40" align="end">
|
||||
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="submit" matTooltip="Save" matTooltipPosition="above"><mat-icon>save</mat-icon></button> -->
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above"
|
||||
type="submit" (click)="onSubmit()">
|
||||
type="submit" (click)="onSubmit()" [disabled]="disableAfterSubmit===true">
|
||||
<mat-icon>save</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -28,7 +28,7 @@ export class AddressComponent implements OnInit {
|
||||
main_applicant: any;
|
||||
|
||||
pageTitle: string = "PD Address Details";
|
||||
|
||||
disableAfterSubmit : boolean = false;
|
||||
/**Declaration of FormField Variables */
|
||||
//@Input() pdid: number;
|
||||
pdid: number;
|
||||
@ -345,7 +345,7 @@ createAddresses(AddressDetails): FormGroup {
|
||||
else if (type == 2 && val.isactive == 1) {
|
||||
this.commentData.push(val);
|
||||
}
|
||||
else if (type == 3 && val.isactive == 1) {
|
||||
else if (type == 3 && val.isactive == 1 && val.is_land_uom != 0) {
|
||||
this.uomData.push(val);
|
||||
}
|
||||
else if (type == 4 && val.isactive == 1) {
|
||||
@ -432,14 +432,16 @@ createAddresses(AddressDetails): FormGroup {
|
||||
|
||||
if (!this.addressForm.valid) {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
this.disableAfterSubmit = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if(this.addressForm.value.bussiness_activity_remark == ''){
|
||||
this.notifier.notify('warning', 'Fill Remark!');
|
||||
this.disableAfterSubmit = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this.disableAfterSubmit = true;
|
||||
let records: any = {};
|
||||
records.addresses = this.addressForm.controls.addresses.value;
|
||||
// records.address = this.address.value;
|
||||
@ -483,13 +485,16 @@ createAddresses(AddressDetails): FormGroup {
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
setTimeout(() => {
|
||||
this.dialogRef.close();
|
||||
this.disableAfterSubmit = false;
|
||||
}, 3000);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 20%" *ngIf="data.margin_calculation_status===true">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Value" formControlName="margin_value" readonly>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="sales.get('margin_value').value != ''">{{"₹"}} {{marginAmtInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeProducts(s)" *ngIf="(salesItemForm.controls.sales_product.value | deleteRecordsCount)>1"
|
||||
matTooltip="Remove" matTooltipPosition="above">
|
||||
|
||||
@ -19,6 +19,7 @@ export class ManageDailySalesComponent implements OnInit {
|
||||
salesItemForm:FormGroup;
|
||||
UOMData: any[]=[];
|
||||
frequencyData: any[]=[];
|
||||
marginAmtInwords: any[]=[];
|
||||
private notifier: NotifierService;
|
||||
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManageDailySalesComponent>) {
|
||||
this.pageTitle = this.data.manage_status==1 ? 'Add Daily Sales Item' : 'Update Daily Sales Item';
|
||||
@ -38,10 +39,12 @@ export class ManageDailySalesComponent implements OnInit {
|
||||
this.salesItemForm = this._fb.group({
|
||||
sales_product: this._fb.array([this.createSalesItemWithData(this.data.editData)]),
|
||||
});
|
||||
this.inWords(this.data.editData.margin_value,0,2);
|
||||
let control: any = <FormArray>this.salesItemForm.controls['sales_product'];
|
||||
control = control.controls[0].get('child') as FormArray;
|
||||
this.data.editData.values.forEach(elementVal => {
|
||||
this.data.editData.values.forEach((elementVal,inx) => {
|
||||
control.push(this.createDailySalesWithData(elementVal,this.data.editData.sim_id))
|
||||
this.inWords(elementVal.sales_value,inx,1);
|
||||
});
|
||||
}
|
||||
else{
|
||||
@ -161,6 +164,7 @@ salesCalculation(indexVal: number,values: any): void {
|
||||
let getTotalValueCounts = transformData.map(val=>val.sales_value)
|
||||
.reduce((sum, curr) => parseInt(sum) + parseInt(curr));
|
||||
control.controls[indexVal].controls['margin_value'].setValue(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)));
|
||||
this.inWords(parseInt(getTotalValueCounts) * (parseInt(values.margin_per)/100) * (12 / parseInt(getUniqueMonthCounts.length)),indexVal,2);
|
||||
}
|
||||
else{
|
||||
control.controls[indexVal].controls['margin_value'].setValue('');
|
||||
@ -219,6 +223,10 @@ submitDetails(records) {
|
||||
case 1 :
|
||||
this.Value[c] = this._pd.convertNumberToWords(e);
|
||||
break;
|
||||
case 2 :
|
||||
this.marginAmtInwords[c] = this._pd.convertNumberToWords(e);
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<div fxLayout="row wrap" *ngFor="let item of businessIncomeItemForm.controls.busIncome['controls']; let s = index;" [formGroupName]="s">
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 87%">
|
||||
<mat-select placeholder="business Income" formControlName="business_income_id" required>
|
||||
<mat-select placeholder="Business Income" formControlName="business_income_id" required>
|
||||
<mat-option *ngFor="let income of businessIncomeData" [value]="income.business_income_id">{{income.business_income_item}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -23,8 +23,7 @@
|
||||
</div>
|
||||
<div class="item-margin" fxFlex="100">
|
||||
<mat-form-field style="width: 25%">
|
||||
<input OnlyNumber type="text" matInput placeholder="Sale Quantity" (keyup)="salesCalculation(s,sales.value);inWords($event.target.value,s,1)" formControlName="sales_qty" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="sales.get('sales_qty').value != ''">{{"₹"}} {{Sale_Quantity[s]}} Only</mat-hint>
|
||||
<input OnlyNumber type="text" matInput placeholder="Sale Quantity" (keyup)="salesCalculation(s,sales.value);" formControlName="sales_qty" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 25%">
|
||||
<mat-select placeholder="UOM" formControlName="fk_uom_id" required>
|
||||
@ -33,6 +32,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 25%">
|
||||
<input OnlyNumber type="text" matInput placeholder="Rate/Unit of Sale" formControlName="rate_per_unit" (keyup)="salesCalculation(s,sales.value)" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="sales.get('rate_per_unit').value != ''">{{"₹"}} {{ratePerUnitAmtInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
@ -42,8 +42,9 @@
|
||||
<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%">
|
||||
<mat-form-field style="width: 54%">
|
||||
<input matInput OnlyNumber type="text" placeholder="Annual Sales" formControlName="annual_sale_value" readonly>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="sales.get('annual_sale_value').value != ''">{{"₹"}} {{annualSaleAmtInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div class="item-margin" fxFlex="100" *ngIf="data.margin_calculation_status===true">
|
||||
@ -51,10 +52,12 @@
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Percentage %" formControlName="margin_per" (keyup)="salesMarginPerCalculation(s,sales.value)">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 25%">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Amount" formControlName="margin_per_uom" (keyup)="salesMarginAmtCalculation(s,sales.value)">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Per Unit" formControlName="margin_per_uom" (keyup)="salesMarginAmtCalculation(s,sales.value)">
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="sales.get('margin_per_uom').value != ''">{{"₹"}} {{marginAmtInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 25%">
|
||||
<input matInput OnlyNumber type="text" placeholder="Final Value" formControlName="margin_final_value" readonly>
|
||||
<input matInput OnlyNumber type="text" placeholder="Considered Margin Amount" formControlName="margin_final_value" readonly>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="sales.get('margin_final_value').value != ''">{{"₹"}} {{marginFinalAmtInwords[s]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
@ -10,11 +10,18 @@ import { NotifierService } from 'angular-notifier';
|
||||
styleUrls: ['./manage-sales.component.scss']
|
||||
})
|
||||
export class ManageSalesComponent implements OnInit {
|
||||
Sale_Quantity: any[]=[];
|
||||
|
||||
pageTitle: string;
|
||||
salesItemForm:FormGroup;
|
||||
UOMData: any[]=[];
|
||||
frequencyData: any[]=[];
|
||||
|
||||
//Declaration for Amout INwords.
|
||||
annualSaleAmtInwords: any[]=[];
|
||||
marginAmtInwords: any[]=[];
|
||||
marginFinalAmtInwords: any[]=[];
|
||||
ratePerUnitAmtInwords: any[]=[];
|
||||
|
||||
private notifier: NotifierService;
|
||||
constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<ManageSalesComponent>) {
|
||||
this.UOMData=this.data.masterData.UOMList;
|
||||
@ -27,7 +34,21 @@ export class ManageSalesComponent implements OnInit {
|
||||
if(this.data.manage_status==2){
|
||||
this.salesItemForm = this._fb.group({
|
||||
salesCalItemwise: this._fb.array([this.createSalesItemWithData(this.data.editData)]),
|
||||
});
|
||||
});
|
||||
|
||||
let indexforedit = 0
|
||||
this.inWords(this.data.editData.annual_sale_value,indexforedit,1);
|
||||
this.inWords(this.data.editData.margin_per_uom,indexforedit,2);
|
||||
this.inWords(this.data.editData.margin_final_value,indexforedit,3);
|
||||
this.inWords(this.data.editData.rate_per_unit,indexforedit,4);
|
||||
|
||||
// this.data.editData.forEach((val,index) => {
|
||||
// this.inWords(val.annual_sale_value,index,1);
|
||||
// this.inWords(val.margin_per_uom,index,2);
|
||||
// this.inWords(val.margin_final_value,index,3);
|
||||
// this.inWords(val.rate_per_unit,index,4);
|
||||
// });
|
||||
|
||||
}
|
||||
else{
|
||||
this.salesItemForm = this._fb.group({
|
||||
@ -87,9 +108,14 @@ closeDialogue(){
|
||||
|
||||
salesCalculation(indexVal: number,values: any): void {
|
||||
let control:any = <FormArray>this.salesItemForm.controls['salesCalItemwise'];
|
||||
if(values.rate_per_unit!=''){
|
||||
this.inWords(values.rate_per_unit,indexVal,4)
|
||||
}
|
||||
if(values.sales_qty!='' && values.rate_per_unit!='' && values.fk_frequency_id!='') {
|
||||
let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id);
|
||||
let AnnualSalesValue = parseInt(values.sales_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor)
|
||||
control.controls[indexVal].controls['annual_sale_value'].setValue(parseInt(values.sales_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor));
|
||||
this.inWords(AnnualSalesValue,indexVal,1)
|
||||
|
||||
}
|
||||
else {
|
||||
@ -104,6 +130,7 @@ salesMarginPerCalculation(indexVal: number,values: any): void {
|
||||
control.controls[indexVal].controls['margin_per_uom'].setValue('');
|
||||
if(values.margin_per!='' && values.annual_sale_value!='') {
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue(parseInt(values.annual_sale_value) * (parseInt(values.margin_per)/100));
|
||||
this.inWords(parseInt(values.annual_sale_value) * (parseInt(values.margin_per)/100),indexVal,3)
|
||||
}
|
||||
else {
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue('');
|
||||
@ -112,8 +139,14 @@ salesMarginPerCalculation(indexVal: number,values: any): void {
|
||||
salesMarginAmtCalculation(indexVal: number,values: any): void {
|
||||
let control:any = <FormArray>this.salesItemForm.controls['salesCalItemwise'];
|
||||
control.controls[indexVal].controls['margin_per'].setValue('');
|
||||
if(values.margin_per_uom!=''){
|
||||
this.inWords(values.margin_per_uom,indexVal,2)
|
||||
}
|
||||
|
||||
if(values.margin_per_uom!='' && values.sales_qty!='') {
|
||||
let MarginFinalValue = parseInt(values.sales_qty) * parseInt(values.margin_per_uom);
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue(parseInt(values.sales_qty) * parseInt(values.margin_per_uom));
|
||||
this.inWords(MarginFinalValue,indexVal,3)
|
||||
}
|
||||
else {
|
||||
control.controls[indexVal].controls['margin_final_value'].setValue('');
|
||||
@ -157,12 +190,20 @@ submitDetails(records) {
|
||||
});
|
||||
}
|
||||
|
||||
inWords(e,s,flag){
|
||||
inWords(value,inx,flag){
|
||||
switch(flag){
|
||||
case 1 :
|
||||
this.Sale_Quantity[s] = this._pd.convertNumberToWords(e);
|
||||
this.annualSaleAmtInwords[inx] = this._pd.convertNumberToWords(value);
|
||||
break;
|
||||
}
|
||||
case 2 :
|
||||
this.marginAmtInwords[inx] = this._pd.convertNumberToWords(value);
|
||||
break;
|
||||
case 3 :
|
||||
this.marginFinalAmtInwords[inx] = this._pd.convertNumberToWords(value);
|
||||
break;
|
||||
case 4 :
|
||||
this.ratePerUnitAmtInwords[inx] = this._pd.convertNumberToWords(value);
|
||||
break;
|
||||
default:break;}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -16,6 +16,13 @@
|
||||
<mat-tab-group #matgroup>
|
||||
<mat-tab label="Summary">
|
||||
<ng-template matTabContent>
|
||||
<div class="complete-button" align="end">
|
||||
<!-- <button mat-raised-button type="button" matTooltip="Complete Assessed Income" matTooltipPosition="above" (click)="completeAI()" *ngIf="matgroup.selectedIndex == 0" ><strong>Complete</strong></button> -->
|
||||
<button type="button" mat-flat-button (click)="completeAI()"
|
||||
matTooltip="Complete Assessed Income" matTooltipPosition="above" color="primary">
|
||||
<strong>Complete</strong>
|
||||
</button>
|
||||
</div>
|
||||
<mat-card>
|
||||
<mat-card-content>
|
||||
<!-- this is for sales revenue -->
|
||||
@ -302,11 +309,11 @@
|
||||
<!-- end assessed income tabs control -->
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end">
|
||||
<!-- <mat-dialog-actions align="end">
|
||||
<button type="button" mat-flat-button (click)="completeAI()"
|
||||
matTooltip="Complete Assessed Income" matTooltipPosition="above" color="primary">
|
||||
<strong>Complete</strong>
|
||||
</button>
|
||||
</mat-dialog-actions>
|
||||
</mat-dialog-actions> -->
|
||||
|
||||
<notifier-container></notifier-container>
|
||||
@ -12,6 +12,9 @@
|
||||
color:#e00201 !important;
|
||||
}
|
||||
|
||||
.complete-button button {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.paragraph_change {
|
||||
color: #fff !important;
|
||||
|
||||
@ -19,7 +19,7 @@
|
||||
<mat-card-header>
|
||||
<mat-card-title>
|
||||
<small class="expan_table_header">{{expandDetails.salesItem}}</small>
|
||||
<small class="expan_table_header" *ngIf="activateMariginCalculation===true">(Margin Percentage % : {{expandDetails.margin_per}} Margin Value : {{expandDetails.margin_value}})</small>
|
||||
<small class="expan_table_header" *ngIf="activateMariginCalculation===true"> ( Margin Percentage : {{expandDetails.margin_per}} % Margin Value : {{expandDetails.margin_value}} )</small>
|
||||
</mat-card-title>
|
||||
<mat-card-subtitle *ngFor="let footer of expandDetails.footerMessage">
|
||||
|
||||
|
||||
@ -31,3 +31,7 @@ tr.mat-footer-row {
|
||||
.delete-margin {
|
||||
margin-left: 3%;
|
||||
}
|
||||
.mat-footer-cell {
|
||||
font-weight: bold;
|
||||
font-size: 1.2rem !important;
|
||||
}
|
||||
@ -10,11 +10,11 @@
|
||||
<mat-option *ngFor="let getData of check__purchse_type" [value]="getData.id">{{getData.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 30%" *ngIf="grossProfitForm.controls['mode'].value == 2">
|
||||
<!-- <mat-form-field style="width: 30%" *ngIf="grossProfitForm.controls['mode'].value == 2">
|
||||
<mat-select placeholder="Sales Type" formControlName="margin">
|
||||
<mat-option *ngFor="let getSale of check_sales_type" [value]="getSale.id">{{getSale.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-form-field> -->
|
||||
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Save" matTooltipPosition="above" (click)="submitDetails(grossProfitForm.value)"><mat-icon>save</mat-icon>
|
||||
</button>
|
||||
|
||||
|
||||
@ -24,7 +24,14 @@ export class GrossProfitCalculationComponent implements OnInit, OnChanges {
|
||||
|
||||
}
|
||||
changeOptions(values: any){
|
||||
// console.log('values',values);
|
||||
this.grossProfitForm.controls['margin'].setValue('');
|
||||
/** if Mode Value is 'No' -> margin value is setted as netmargin and its id - 2
|
||||
* Refer => check_sales_type **/
|
||||
if(values.mode == 2){
|
||||
// console.log('2');
|
||||
this.grossProfitForm.controls['margin'].setValue('2');
|
||||
}
|
||||
}
|
||||
submitDetails(records: any){
|
||||
if (this.grossProfitForm.invalid) {
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<table mat-table [dataSource]="businessIncomeItemSource">
|
||||
|
||||
<ng-container matColumnDef="buiness_income" sticky>
|
||||
<th mat-header-cell *matHeaderCellDef> business Income </th>
|
||||
<th mat-header-cell *matHeaderCellDef> Business Income </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.business_income_item}} </td>
|
||||
<td mat-footer-cell *matFooterCellDef> Total of Income</td>
|
||||
|
||||
|
||||
@ -3,16 +3,19 @@
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title>Sales Calculation</mat-card-title>
|
||||
</mat-card-header>
|
||||
</mat-card-header>{{activateMariginCalculation}}
|
||||
<mat-card-content>
|
||||
<mat-form-field style="width: 82%">
|
||||
<input matInput OnlyNumber type="text" placeholder="Sales Declared by the Customer as the Annual Sales Actually Done" formControlName="sales_declared_by_customer" (keyup)="salesCalculation(salesCalculationForm.value)" required>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="salesCalculationForm.value.sales_declared_by_customer != ''">{{"₹"}} {{SaleAmtInwords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<!-- {{salesCalculationForm.value.sales_declared_by_customer}} -->
|
||||
<mat-form-field style="width: 40%" *ngIf="activateMariginCalculation">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Percentage %" formControlName="margin_per" (keyup)="salesCalculation(salesCalculationForm.value)" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 40%" *ngIf="activateMariginCalculation">
|
||||
<input matInput OnlyNumber type="text" placeholder="Margin Value" formControlName="margin_value" readonly>
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="salesCalculationForm.value.margin_value != ''">{{"₹"}} {{marginAmtInwords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Save" matTooltipPosition="above" (click)="submitDetails(salesCalculationForm.value)"><mat-icon>save</mat-icon>
|
||||
</button>
|
||||
|
||||
@ -15,6 +15,8 @@ export class SalesCalculationComponent implements OnInit, OnChanges, DoCheck {
|
||||
salesCalculationForm:FormGroup;
|
||||
activateMariginCalculation: boolean;
|
||||
private notifier: NotifierService;
|
||||
SaleAmtInwords : any;
|
||||
marginAmtInwords: any;
|
||||
constructor(notifier:NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService) {
|
||||
this.activateMariginCalculation=false;
|
||||
this.notifier = notifier;
|
||||
@ -23,9 +25,12 @@ export class SalesCalculationComponent implements OnInit, OnChanges, DoCheck {
|
||||
ngOnInit() {
|
||||
}
|
||||
salesCalculation(values): void {
|
||||
if(values.sales_declared_by_customer !=''){this.SaleAmtInwords = this._pd.convertNumberToWords(values.sales_declared_by_customer);}
|
||||
if(values.margin_per !='' && values.sales_declared_by_customer !='')
|
||||
{
|
||||
|
||||
this.salesCalculationForm.controls['margin_value'].setValue(values.sales_declared_by_customer * (values.margin_per/100));
|
||||
this.marginAmtInwords = this._pd.convertNumberToWords(values.sales_declared_by_customer * (values.margin_per/100));
|
||||
}
|
||||
}
|
||||
// save sales calculations details
|
||||
@ -60,7 +65,9 @@ validateAllFormFields(formGroup: any) {
|
||||
|
||||
// do check component bases
|
||||
ngDoCheck() {
|
||||
|
||||
// console.log('ngDoCheck this.activateMariginCalculation',this.activateMariginCalculation);
|
||||
// console.log('ngDoCheck this.masterData.grossProfitTypeList',this.masterData.grossProfitTypeList);
|
||||
// console.log('69',this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].margin);
|
||||
if(this.masterData.grossProfitTypeList.length>0){
|
||||
this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].margin==2 && this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==2 ? true : false;
|
||||
}
|
||||
@ -71,6 +78,9 @@ ngDoCheck() {
|
||||
|
||||
//detect chnges from parent
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
// console.log('ngDoCheck this.activateMariginCalculation',this.activateMariginCalculation);
|
||||
// console.log('ngDoCheck this.masterData.grossProfitTypeList',changes.masterData);
|
||||
// console.log('82',changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode);
|
||||
if(changes.masterData){
|
||||
if(changes.masterData.currentValue.grossProfitTypeList.length>0){
|
||||
this.activateMariginCalculation = changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].margin==2 && changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode==2 ? true : false;
|
||||
@ -78,6 +88,8 @@ ngOnChanges(changes: SimpleChanges) {
|
||||
}
|
||||
if(changes.parentData){
|
||||
if(changes.parentData.currentValue.length>0){
|
||||
this.SaleAmtInwords = this._pd.convertNumberToWords(changes.parentData.currentValue[changes.parentData.currentValue.length-1].sales_declared_by_customer);
|
||||
this.marginAmtInwords = this._pd.convertNumberToWords(changes.parentData.currentValue[changes.parentData.currentValue.length-1].margin_value);
|
||||
this.salesCalculationForm = this._fb.group({
|
||||
sdc_id:[changes.parentData.currentValue[changes.parentData.currentValue.length-1].sdc_id],
|
||||
sales_declared_by_customer:[changes.parentData.currentValue[changes.parentData.currentValue.length-1].sales_declared_by_customer, Validators.compose([Validators.required])],
|
||||
@ -100,5 +112,4 @@ ngOnChanges(changes: SimpleChanges) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<div [formGroupName]="s">
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Property Type" formControlName="property_type" (selectionChange)="setRequiredValidation($event.value,detail,1)">
|
||||
<mat-select placeholder="Property Type" formControlName="property_type" (selectionChange)="setRequiredValidation($event.value,i,s,1)">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||
</mat-select>
|
||||
@ -279,8 +279,8 @@
|
||||
<!-- <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 (selectionChange)="setRequiredValidation($event.value.id,sup,4)">
|
||||
<mat-select multiple placeholder="Name of the Owner"
|
||||
formControlName="name_of_the_owner" [compareWith]="compareObjects" required (selectionChange)="setRequiredValidation($event.value,i,'',4)">
|
||||
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
|
||||
<mat-option *ngFor="let val of group.groupValues" [value]="val">
|
||||
{{val.name}}
|
||||
@ -289,7 +289,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="checkOthers(sup.get('name_of_the_owner').value)===true" style="width:45%">
|
||||
<mat-form-field *ngIf="isOtherOwner[i]" style="width:45%">
|
||||
<input matInput placeholder="Specify Owner Name"
|
||||
formControlName="other_owner" autocomplete="off">
|
||||
</mat-form-field>
|
||||
@ -488,7 +488,7 @@
|
||||
</div>
|
||||
<div fxFlex="40" align="end">
|
||||
<!-- <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button> -->
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="disableAfterSubmit===true" ><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
</mat-dialog-actions>
|
||||
</form>
|
||||
|
||||
@ -45,6 +45,9 @@ export class AssetsInfoComponent implements OnInit {
|
||||
public applicants: any;
|
||||
otherEmiamtFlag : boolean = false;
|
||||
businessEmiAmtFlag : boolean = false;
|
||||
isOtherOwner:any = [];
|
||||
disableAfterSubmit : boolean = false;
|
||||
|
||||
public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"},
|
||||
{'value': "no",'viewValue': "No"},
|
||||
{'value': "nan",'viewValue': "NA"}]
|
||||
@ -119,30 +122,31 @@ export class AssetsInfoComponent implements OnInit {
|
||||
// this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
|
||||
// this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
|
||||
// });
|
||||
|
||||
this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
|
||||
if(data.dataStatus){
|
||||
this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true);
|
||||
if (data.dataStatus) {
|
||||
this.existCompanyList = data.records.filter(val => val.is_active === true);
|
||||
}
|
||||
|
||||
// get company list
|
||||
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 })
|
||||
}
|
||||
// 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})
|
||||
|
||||
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})
|
||||
}
|
||||
|
||||
})
|
||||
// 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.getM_Assets_Type();
|
||||
this.getM_PropertyType();
|
||||
@ -591,11 +595,7 @@ export class AssetsInfoComponent implements OnInit {
|
||||
var result = Object.keys(supp_data).map(function (key) {
|
||||
return supp_data[key];
|
||||
});
|
||||
result.forEach((datas,index) => {
|
||||
|
||||
this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.approximate_market_value);
|
||||
|
||||
});
|
||||
|
||||
if (result.length > 0) {
|
||||
for (let val of result) {
|
||||
let vals = {
|
||||
@ -610,9 +610,21 @@ export class AssetsInfoComponent implements OnInit {
|
||||
emi: val.emi,
|
||||
};
|
||||
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
|
||||
|
||||
// let Avaliablity = 1;
|
||||
// val.name_of_the_owner.forEach(option => {
|
||||
// if(option.id == 0 && option.group_id == 2){
|
||||
// Avaliablity = option.id;
|
||||
// }
|
||||
// });
|
||||
// this.isOtherOwner = Avaliablity == 0 ? true : false;
|
||||
control.push(this.initDetailsWithdata(vals));
|
||||
this.setAssetsDetailsWithData(vals.assets_mode, val.details, control.length - 1)
|
||||
}
|
||||
result.forEach((datas,index) => {
|
||||
this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.approximate_market_value);
|
||||
this.setRequiredValidation(datas.name_of_the_owner,index,'',4);
|
||||
});
|
||||
}
|
||||
this.loadDetails = true;
|
||||
}
|
||||
@ -789,8 +801,10 @@ export class AssetsInfoComponent implements OnInit {
|
||||
// stop here if form is invalid
|
||||
if (this._assetsQuesFrom.invalid) {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
this.disableAfterSubmit = false;
|
||||
return;
|
||||
} else {
|
||||
this.disableAfterSubmit = true;
|
||||
var answerFormValues = this._assetsQuesFrom.value;
|
||||
|
||||
//To Remove The "Null" With Key also
|
||||
@ -802,13 +816,16 @@ export class AssetsInfoComponent implements OnInit {
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
setTimeout(() =>{
|
||||
this.dialogRef.close();
|
||||
this.disableAfterSubmit = false;
|
||||
},3000);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
// this.dialogRef.close();
|
||||
});
|
||||
//After Saving the BRANCH data then popup close
|
||||
@ -854,44 +871,75 @@ export class AssetsInfoComponent implements OnInit {
|
||||
// }
|
||||
|
||||
}
|
||||
setRequiredValidation(value,item,flag) {
|
||||
|
||||
setRequiredValidation(value,ParInx,ChdInx,flag) {
|
||||
console.log('value',value,'ParInx',ParInx,'ChdInx',ChdInx,'flag',flag);
|
||||
let ParCtrls = <FormArray>this._assetsQuesFrom.controls.assets_details;
|
||||
console.log('ParCtrls',ParCtrls);
|
||||
let ChdCtrls:any = <FormArray>ParCtrls.controls[ParInx];
|
||||
console.log('ChdCtrls',ChdCtrls);
|
||||
if(flag == 1){
|
||||
value==1
|
||||
? item.controls.other_property_type.setValidators([Validators.required])
|
||||
: item.controls.other_property_type.clearValidators();
|
||||
item.controls.other_property_type.updateValueAndValidity();
|
||||
|
||||
// ? controls2[ChdInx].controls.other_property_type.setValidators([Validators.required])
|
||||
// : item.controls.other_property_type.clearValidators();
|
||||
// item.controls.other_property_type.updateValueAndValidity();
|
||||
}
|
||||
if(flag == 2){
|
||||
value==1
|
||||
? item.controls.other_frequency_mode.setValidators([Validators.required])
|
||||
: item.controls.other_frequency_mode.clearValidators();
|
||||
item.controls.other_frequency_mode.updateValueAndValidity();
|
||||
// if(flag == 2){
|
||||
// value==1
|
||||
// ? item.controls.other_frequency_mode.setValidators([Validators.required])
|
||||
// : item.controls.other_frequency_mode.clearValidators();
|
||||
// item.controls.other_frequency_mode.updateValueAndValidity();
|
||||
// }
|
||||
// if(flag == 3){
|
||||
// value==1
|
||||
// ? item.controls.other_investments_type.setValidators([Validators.required])
|
||||
// : item.controls.other_investments_type.clearValidators();
|
||||
// item.controls.other_investments_type.updateValueAndValidity();
|
||||
// }
|
||||
// if(flag == 4){
|
||||
// value==0
|
||||
// ? item.controls.other_owner.setValidators([Validators.required])
|
||||
// : item.controls.other_owner.clearValidators();
|
||||
// item.controls.other_owner.updateValueAndValidity();
|
||||
// }
|
||||
if (flag == 4) {
|
||||
let Avaliablity = 1;
|
||||
// console.log('val',value);
|
||||
value.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
if(Avaliablity == 0){
|
||||
// console.log('if Avaliablity',Avaliablity);
|
||||
// console.log('if this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]);
|
||||
ChdCtrls.controls.other_owner.setValidators([Validators.required]);
|
||||
this.isOtherOwner[ParInx] = true;
|
||||
// console.log('if this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]);
|
||||
}else if(Avaliablity == 1){
|
||||
// console.log('else Avaliablity',Avaliablity);
|
||||
// console.log('esle this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]);
|
||||
ChdCtrls.controls.other_owner.setValue('');
|
||||
ChdCtrls.controls.other_owner.clearValidators();
|
||||
this.isOtherOwner[ParInx] = false;
|
||||
// console.log('else this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]);
|
||||
}
|
||||
|
||||
ChdCtrls.controls.other_owner.updateValueAndValidity();
|
||||
|
||||
}
|
||||
if(flag == 3){
|
||||
value==1
|
||||
? item.controls.other_investments_type.setValidators([Validators.required])
|
||||
: item.controls.other_investments_type.clearValidators();
|
||||
item.controls.other_investments_type.updateValueAndValidity();
|
||||
}
|
||||
if(flag == 4){
|
||||
value==0
|
||||
? item.controls.other_owner.setValidators([Validators.required])
|
||||
: item.controls.other_owner.clearValidators();
|
||||
item.controls.other_owner.updateValueAndValidity();
|
||||
}
|
||||
if(flag == 5){
|
||||
value==1
|
||||
? item.controls.other_vehicle_type.setValidators([Validators.required])
|
||||
: item.controls.other_vehicle_type.clearValidators();
|
||||
item.controls.other_vehicle_type.updateValueAndValidity();
|
||||
}
|
||||
if(flag == 6){
|
||||
value==1
|
||||
? item.controls.other_uom.setValidators([Validators.required])
|
||||
: item.controls.other_uom.clearValidators();
|
||||
item.controls.other_uom.updateValueAndValidity();
|
||||
}
|
||||
// if(flag == 5){
|
||||
// value==1
|
||||
// ? item.controls.other_vehicle_type.setValidators([Validators.required])
|
||||
// : item.controls.other_vehicle_type.clearValidators();
|
||||
// item.controls.other_vehicle_type.updateValueAndValidity();
|
||||
// }
|
||||
// if(flag == 6){
|
||||
// value==1
|
||||
// ? item.controls.other_uom.setValidators([Validators.required])
|
||||
// : item.controls.other_uom.clearValidators();
|
||||
// item.controls.other_uom.updateValueAndValidity();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
<mat-error>Asset Owned by Required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:45%" *ngIf="isOtherOwnerForAddress">
|
||||
<mat-form-field style="width:45%" *ngIf="isOtherOwnerForAddress[i]">
|
||||
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
@ -315,7 +315,7 @@
|
||||
<mat-error>Asset Owned by Required</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="isOtherOwner" style="width:45%">
|
||||
<mat-form-field *ngIf="isOtherOwner[i]" style="width:45%">
|
||||
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
@ -33,8 +33,8 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
private notifier: NotifierService;
|
||||
public _businessAssetsQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
isOtherOwnerForAddress : boolean = false;
|
||||
isOtherOwner: boolean = false;
|
||||
isOtherOwnerForAddress : any = [];
|
||||
isOtherOwner : any = [];
|
||||
loadDetails: boolean;
|
||||
|
||||
CustSegAbbr: any;
|
||||
@ -553,7 +553,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
var result = Object.keys(data).map(function (key) {
|
||||
return data[key];
|
||||
});
|
||||
|
||||
if (result.length > 0) {
|
||||
result.forEach((datas, index) => {
|
||||
this.RentAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_monthly_rented_amt);
|
||||
@ -567,7 +566,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
this.isOtherOwnerForAddress = Avaliablity == 0 ? true : false;
|
||||
this.isOtherOwnerForAddress[index] = Avaliablity == 0 ? true : false;
|
||||
|
||||
});
|
||||
|
||||
@ -609,8 +608,13 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value);
|
||||
this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt);
|
||||
let Avaliablity = 1;
|
||||
|
||||
this.isOtherOwner = Avaliablity == 0 ? true : false;
|
||||
|
||||
datas.business_name_of_the_owner.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
this.isOtherOwner[index] = Avaliablity == 0 ? true : false;
|
||||
|
||||
});
|
||||
|
||||
@ -843,7 +847,57 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
this.yearErrorMessage[i] = '';
|
||||
}
|
||||
}
|
||||
setRequiredValidation2(value, ParInx,ChdInx, flag) {
|
||||
if (flag == 4) {
|
||||
let ParCtrls = <FormArray>this._businessAssetsQuesFrom.controls.assets_details;
|
||||
let ChdCtrls:any = <FormArray>ParCtrls.controls[ParInx];
|
||||
|
||||
let Avaliablity = 1;
|
||||
value.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
if(Avaliablity == 0){
|
||||
|
||||
ChdCtrls.controls.business_name_of_the_other_owner.setValidators([Validators.required]);
|
||||
this.isOtherOwner[ParInx] = true;
|
||||
}else{
|
||||
|
||||
ChdCtrls.controls.business_name_of_the_other_owner.setValue('');
|
||||
ChdCtrls.controls.business_name_of_the_other_owner.clearValidators();
|
||||
this.isOtherOwner[ParInx] = false;
|
||||
}
|
||||
|
||||
ChdCtrls.controls.business_name_of_the_other_owner.updateValueAndValidity();
|
||||
|
||||
}
|
||||
if(flag == 8){
|
||||
let ParCtrls = <FormArray>this._businessAssetsQuesFrom.controls.business_assets_for_address;
|
||||
let ChdCtrls:any = <FormArray>ParCtrls.controls[ParInx];
|
||||
|
||||
let Avaliablity = 1;
|
||||
value.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
|
||||
if(Avaliablity == 0){
|
||||
|
||||
ChdCtrls.controls.business_name_of_the_other_owner.setValidators([Validators.required]);
|
||||
this.isOtherOwnerForAddress[ParInx] = true;
|
||||
}else{
|
||||
|
||||
ChdCtrls.controls.business_name_of_the_other_owner.setValue('');
|
||||
ChdCtrls.controls.business_name_of_the_other_owner.clearValidators();
|
||||
this.isOtherOwnerForAddress[ParInx] = false;
|
||||
}
|
||||
|
||||
ChdCtrls.controls.business_name_of_the_other_owner.updateValueAndValidity();
|
||||
|
||||
}
|
||||
}
|
||||
setRequiredValidation(value, item, flag) {
|
||||
|
||||
if (flag == 1) {
|
||||
@ -879,27 +933,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
item.controls.business_monthly_rented_amt.updateValueAndValidity();
|
||||
item.controls.business_name_of_the_owner.updateValueAndValidity();
|
||||
}
|
||||
if (flag == 4) {
|
||||
let Avaliablity = 1;
|
||||
value.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
if(Avaliablity == 0){
|
||||
|
||||
item.controls.business_name_of_the_other_owner.setValidators([Validators.required]);
|
||||
this.isOtherOwner = true;
|
||||
}else{
|
||||
|
||||
item.controls.business_name_of_the_other_owner.setValue('');
|
||||
item.controls.business_name_of_the_other_owner.clearValidators();
|
||||
this.isOtherOwner = false;
|
||||
}
|
||||
|
||||
item.controls.business_name_of_the_other_owner.updateValueAndValidity();
|
||||
|
||||
}
|
||||
|
||||
if (flag == 5) {
|
||||
value == 1
|
||||
? item.controls.other_vehicle_type.setValidators([Validators.required])
|
||||
@ -929,28 +963,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
|
||||
item.controls.business_monthly_rented_amt.updateValueAndValidity();
|
||||
item.controls.business_name_of_the_owner.updateValueAndValidity();
|
||||
}
|
||||
if(flag == 8){
|
||||
let Avaliablity = 1;
|
||||
value.forEach(option => {
|
||||
if(option.id == 0 && option.group_id == 2){
|
||||
Avaliablity = option.id;
|
||||
}
|
||||
});
|
||||
|
||||
if(Avaliablity == 0){
|
||||
|
||||
item.controls.business_name_of_the_other_owner.setValidators([Validators.required]);
|
||||
this.isOtherOwnerForAddress = true;
|
||||
}else{
|
||||
|
||||
item.controls.business_name_of_the_other_owner.setValue('');
|
||||
item.controls.business_name_of_the_other_owner.clearValidators();
|
||||
this.isOtherOwnerForAddress = false;
|
||||
}
|
||||
|
||||
item.controls.business_name_of_the_other_owner.updateValueAndValidity();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -59,8 +59,8 @@
|
||||
<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="final_form_remarks"></textarea>
|
||||
<mat-label>Other Remarks</mat-label>
|
||||
<textarea matInput placeholder="Other Remarks" formControlName="final_form_remarks"></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="40" align="end">
|
||||
|
||||
@ -622,10 +622,12 @@ export class GeneralInfoComponent implements OnInit {
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
// this.errorMessage = "Some Thing Wents Wrong Try Again !";
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
// this.errorMessage = "Something Wents Wrong Try Again !";
|
||||
});
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@
|
||||
|
||||
|
||||
<div fxFlex="40" align="end">
|
||||
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit" matTooltipPosition="above" type="button" (click)="submitLRForm()"><mat-icon>save</mat-icon>
|
||||
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit" matTooltipPosition="above" type="button" [disabled]="disableAfterSubmit===true" (click)="submitLRForm()"><mat-icon>save</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</mat-dialog-actions>
|
||||
|
||||
@ -30,7 +30,7 @@ export class LenderRepresentativeComponent implements OnInit {
|
||||
pageTitle: string ="Lender Representative Details";
|
||||
pdid: number;
|
||||
form_id: number;
|
||||
|
||||
disableAfterSubmit : boolean = false;
|
||||
//snack bar
|
||||
|
||||
|
||||
@ -141,9 +141,11 @@ export class LenderRepresentativeComponent implements OnInit {
|
||||
submitLRForm() {
|
||||
if (!this.representativeForm.valid) {
|
||||
this.validateAllFormFields(this.representativeForm);
|
||||
this.disableAfterSubmit = false;
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
return;
|
||||
}
|
||||
this.disableAfterSubmit = true;
|
||||
let records: any = {};
|
||||
records.pdid = this.pdid;
|
||||
records.formid = this.form_id;
|
||||
@ -158,13 +160,16 @@ export class LenderRepresentativeComponent implements OnInit {
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
setTimeout(() =>{
|
||||
this.dialogRef.close();
|
||||
this.disableAfterSubmit = false;
|
||||
},3000);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
})
|
||||
}
|
||||
validateAllFormFields(formGroup: FormGroup) {
|
||||
|
||||
@ -377,7 +377,7 @@
|
||||
|
||||
<div fxFlex="40" align="end">
|
||||
<button type="submit" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Submit"
|
||||
matTooltipPosition="above" (click)="submitLoanDetails()">
|
||||
matTooltipPosition="above" (click)="submitLoanDetails()" [disabled]="disableAfterSubmit===true">
|
||||
<mat-icon>save</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -31,7 +31,7 @@ export class LoanDetailsComponent implements OnInit {
|
||||
lender_applicant_id: any;
|
||||
main_applicant: any;
|
||||
pageTitle: string = "Loan Details";
|
||||
|
||||
disableAfterSubmit : boolean = false;
|
||||
|
||||
/**Declaration of formfields Variables */
|
||||
private notifier: NotifierService;
|
||||
@ -655,9 +655,10 @@ export class LoanDetailsComponent implements OnInit {
|
||||
|
||||
if (!this.loanDetailsForm.valid) {
|
||||
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||
this.disableAfterSubmit = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this.disableAfterSubmit = true;
|
||||
let records: any = {};
|
||||
records.pdid = this.pdid;
|
||||
records.formid = this.form_id;
|
||||
@ -746,13 +747,16 @@ export class LoanDetailsComponent implements OnInit {
|
||||
// this.dialogRef.close();
|
||||
setTimeout(() => {
|
||||
this.dialogRef.close();
|
||||
this.disableAfterSubmit = false;
|
||||
}, 3000);
|
||||
}
|
||||
else {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
}
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
this.disableAfterSubmit = false;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -56,6 +56,12 @@
|
||||
formControlName="others_source">
|
||||
</mat-form-field>
|
||||
|
||||
<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-form-field>
|
||||
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Income earned by"
|
||||
formControlName="income_earned_by">
|
||||
|
||||
@ -24,6 +24,8 @@ import {
|
||||
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
|
||||
import { RentalInfoComponent} from './../rental-info/rental-info.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-other-income',
|
||||
templateUrl: './other-income.component.html',
|
||||
@ -58,6 +60,7 @@ export class OtherIncomeComponent implements OnInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService,
|
||||
private dialog: MatDialog,
|
||||
private dialogRef: MatDialogRef<OtherIncomeComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any)
|
||||
{
|
||||
@ -154,6 +157,7 @@ public viewerOptions: any = {
|
||||
return this.fb.group({
|
||||
source: [''],
|
||||
others_source : [''],
|
||||
address : [''],
|
||||
income_earned_by:[''],
|
||||
others_income_earned_by:[''],
|
||||
amount: [''],
|
||||
@ -246,5 +250,30 @@ public viewerOptions: any = {
|
||||
inWords(e,i){
|
||||
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
|
||||
}
|
||||
|
||||
Toview(){
|
||||
alert('Rental Info ');
|
||||
// const dialogRef = this.dialog.open(RentalInfoComponent, {
|
||||
// data: {}
|
||||
// });
|
||||
|
||||
// dialogRef.afterClosed()
|
||||
// .subscribe(dataresult => {
|
||||
|
||||
// });
|
||||
const dialogRef = this.dialog.open(RentalInfoComponent, {
|
||||
data: this.pd_all_details,
|
||||
maxWidth: '100vw',
|
||||
maxHeight: '100vh',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
// this.getCompanyListForBusiness();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
<span>{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
|
||||
{{pageTitle}}
|
||||
</div> -->
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;"></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>
|
||||
|
||||
|
||||
@ -333,11 +333,14 @@ export class StockComponent implements OnInit {
|
||||
manufacturingFormCreation(record) {
|
||||
|
||||
let arr = record.from_business.filter(data => data.type_of_activity_id == 2);
|
||||
let arrlength = arr[0].hasOwnProperty("products") ? arr[0].products.length : 0;
|
||||
let rm_arr = record.from_supplier;
|
||||
// let rm_arr = 0;
|
||||
|
||||
this.manufacturingForm = true;
|
||||
if(arr.length > 0){
|
||||
console.log('manu arr',arr);
|
||||
console.log('rm_arr',rm_arr);
|
||||
// let rm_arr = 0;
|
||||
if(arrlength > 0){
|
||||
this.manufacturingForm = true;
|
||||
return this.fb.group({
|
||||
manufacturing_raw_materials: this.fb.array([]),
|
||||
is_sufficiant_raw: [],
|
||||
@ -345,9 +348,8 @@ export class StockComponent implements OnInit {
|
||||
manufacturing_finished_goods: this.fb.array([]),
|
||||
})
|
||||
}
|
||||
|
||||
else {
|
||||
return;
|
||||
else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user