issues fixes : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-02-14 12:07:49 +05:30
parent ff50f9ec6b
commit e2c34445e5
7 changed files with 126 additions and 31 deletions

View File

@ -427,18 +427,27 @@ export class AddPdComponent implements OnInit, OnDestroy {
}
else{
this.disableAfterSubmit=true;
let concat_landline
let concat_landline1
if(formValue.lender_stdcode != null || formValue.lender_landline != null){
concat_landline = formValue.lender_stdcode +'-'+formValue.lender_landline;
if(formValue.lender_stdcode != '' && formValue.lender_landline != ''){
concat_landline = formValue.lender_stdcode +'-'+formValue.lender_landline;
}
else {
concat_landline = null;
}
}
else{
concat_landline = null;
}
if(formValue.applicant_stdcode != null || formValue.applicant_landline != null){
concat_landline1 = formValue.applicant_stdcode +'-'+formValue.applicant_landline;
if(formValue.applicant_stdcode != '' && formValue.applicant_landline != ''){
concat_landline1 = formValue.applicant_stdcode +'-'+formValue.applicant_landline;
}
else{
concat_landline1 = null;
}
}
else{
concat_landline1 = null;

View File

@ -1303,6 +1303,14 @@
<input matInput placeholder="Temporary"
formControlName="officer_temporary" required>
</mat-form-field> -->
<mat-form-field>
<mat-select placeholder="Was the Company name board sighted ?"
formControlName="was_the_company_name_board_sighted" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<!-- <mat-option value="not applicable">Not Applicable</mat-option> -->
</mat-select>
</mat-form-field>
</mat-card-content>
</mat-card>
<mat-card>
@ -1366,6 +1374,7 @@
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Do You Want to Add Other Documents?"
formControlName="other_documents" required>

View File

@ -614,7 +614,8 @@ export class BusinessInfoComponent implements OnInit {
employees_permanent: ['', Validators.compose([Validators.required])],
employees_temporary: ['', Validators.compose([Validators.required])],
employees_appx_salary:['', Validators.compose([Validators.required])],
officer_total: ['', Validators.compose([Validators.required])],
officer_total: ['' || null, Validators.compose([Validators.required])],
was_the_company_name_board_sighted:['',Validators.compose([Validators.required])],
// officer_permanent: ['', Validators.compose([Validators.required])],
// officer_temporary: ['', Validators.compose([Validators.required])],
//working_capital: ['', Validators.compose([Validators.required])],

View File

@ -76,7 +76,7 @@
<!-- <mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> -->
<mat-select placeholder="Payment Terms" formControlName="manufacturing_payment_type">
<mat-select placeholder="Payment Terms" formControlName="manufacturing_payment_type" (selectionChange)="checkCard($event.value,1,l);">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
@ -115,7 +115,7 @@
</div>
</div>
<div fxlayout="row">
<mat-form-field style="width: 80%">
<mat-form-field style="width: 80%" *ngIf="mfgCreditCardFlag">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="main_raw_materials_total_payments_percent_on_credit"
type="number">
</mat-form-field>
@ -189,7 +189,7 @@
<!-- <mat-select placeholder="Payment Type" formControlName="trade_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> -->
<mat-select placeholder="Payment Terms" formControlName="trade_product_payment_type">
<mat-select placeholder="Payment Terms" formControlName="trade_product_payment_type" (selectionChange)="checkCard($event.value,2,l);">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
@ -229,7 +229,7 @@
</div>
</div>
<div fxlayout="row">
<mat-form-field style="width: 80%">
<mat-form-field style="width: 80%" *ngIf="trdCreditCardFlag">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="trading_products_total_payments_percent_on_credit"
type="number">
</mat-form-field>
@ -302,7 +302,7 @@
<!-- <mat-select placeholder="Payment Type" formControlName="service_provider_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> -->
<mat-select placeholder="Payment Terms" formControlName="service_provider_product_payment_type">
<mat-select placeholder="Payment Terms" formControlName="service_provider_product_payment_type" (selectionChange)="checkCard($event.value,3,l);">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
@ -342,7 +342,7 @@
</div>
</div>
<div fxlayout="row">
<mat-form-field style="width: 80%">
<mat-form-field style="width: 80%" *ngIf="spCreditCardFlag">
<input matInput placeholder="What Percentage of Total Sales is done on Credit ?" formControlName="service_products_total_payments_percent_on_credit"
type="number">
</mat-form-field>

View File

@ -365,9 +365,13 @@ export class ClientInfoComponent implements OnInit {
if (datas === null) {
control.push(this.initManufacturingProducts(null));
} else {
for (let val of datas) {
datas.forEach((val,inx) => {
this.checkCard(val.manufacturing_payment_type,1,inx);
control.push(this.initManufacturingProducts(val));
}
});
// for (let val of datas) {
// control.push(this.initManufacturingProducts(val));
// }
}
}
@ -414,9 +418,13 @@ export class ClientInfoComponent implements OnInit {
if (datas === null) {
control.push(this.initTradingProducts(null));
} else {
for (let val of datas) {
datas.forEach((val,inx) => {
this.checkCard(val.trade_product_payment_type,2,inx);
control.push(this.initTradingProducts(val));
}
});
// for (let val of datas) {
// control.push(this.initTradingProducts(val));
// }
}
}
@ -463,9 +471,13 @@ export class ClientInfoComponent implements OnInit {
if (datas === null) {
control.push(this.initServiceProviderProducts(null));
} else {
for (let val of datas) {
datas.forEach((val,inx) => {
this.checkCard(val.service_provider_product_payment_type,3,inx);
control.push(this.initServiceProviderProducts(val));
}
});
// for (let val of datas) {
// control.push(this.initServiceProviderProducts(val));
// }
}
}
@ -670,6 +682,44 @@ export class ClientInfoComponent implements OnInit {
items.controls['other_person_designation'].updateValueAndValidity();
}
}
mfgCreditCardFlag : boolean = false;
trdCreditCardFlag : boolean = false;
spCreditCardFlag : boolean = false;
mfgCounter: any = [];
trdCounter: any = [];
spCounter: any =[];
checkCard(e,flag,index){
if(flag == 3 && e==3){
this.spCounter[index] = 1;
}
else if(flag == 3 && e!=3){
this.spCounter[index] = 0;
}
let SP = this.spCounter.reduce((sum, val) => sum + +val, 0);
this.spCreditCardFlag = SP > 0 ? true : false ;
if(flag == 2 && e==3){
this.trdCounter[index] = 1;
}
else if(flag == 2 && e!=3){
this.trdCounter[index] = 0;
}
let TRD = this.trdCounter.reduce((sum, val) => sum + +val, 0);
this.trdCreditCardFlag = TRD > 0 ? true : false ;
if(flag == 1 && e==3){
this.mfgCounter[index] = 1;
}
else if(flag == 1 && e!=3){
this.mfgCounter[index] = 0;
}
let MFG = this.mfgCounter.reduce((sum, val) => sum + +val, 0);
this.mfgCreditCardFlag = MFG > 0 ? true : false ;
}
// {
// 'main_raw_materials': 'sdkjfal',

View File

@ -73,7 +73,7 @@
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field> -->
<mat-select placeholder="Payment Terms" formControlName="manufacturing_payment_type" (selectionChange)="selectedPaymentTerms(items,$event.value,1)">
<mat-select placeholder="Payment Terms" formControlName="manufacturing_payment_type" (selectionChange)="selectedPaymentTerms(items,$event.value,1);checkCard($event.value,1,l);">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
@ -111,7 +111,7 @@
class="mr-1 mb-1 hover-icon" (click)="addMoreRawMaterials($event); false"><strong>Add More Supplier</strong></button>
</div>
</div>
<div fxLayout="row">
<div fxLayout="row" *ngIf="mfgCreditCardFlag">
<mat-form-field style="width: 100%">
<input matInput placeholder="What % of Total Purchase is Done on Credit?" formControlName="main_raw_materials_total_payments_percent_on_credit"
type="number" autocomplete="off" (keypress)="keyPress($event)" maxlength="3">
@ -181,7 +181,7 @@
<!-- <mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="trade_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> -->
<mat-select placeholder="Payment Terms" formControlName="trade_product_payment_type" (selectionChange)="selectedPaymentTerms(items,$event.value,2)">
<mat-select placeholder="Payment Terms" formControlName="trade_product_payment_type" (selectionChange)="selectedPaymentTerms(items,$event.value,2);checkCard($event.value,2,l);">
<mat-option *ngFor="let pm of m_paymentType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select>
</mat-form-field>
@ -220,7 +220,7 @@
class="mr-1 mb-1 hover-icon" (click)="addMoretradeProduct($event); false"><strong>Add More Supplier</strong></button>
</div>
</div>
<div fxlayout="row">
<div fxlayout="row" *ngIf="trdCreditCardFlag">
<mat-form-field style="width: 90%">
<input matInput placeholder="What % of Total Trade is done on Credit?" formControlName="trading_products_total_payments_percent_on_credit"
type="number" autocomplete="off">

View File

@ -262,9 +262,10 @@ export class SupplierInfoComponent implements OnInit {
if(datas === null){
control.push(this.initManufacturingProducts(null));
} else {
for (let val of datas) {
datas.forEach((val,inx) => {
this.checkCard(val.manufacturing_payment_type,1,inx);
control.push(this.initManufacturingProducts(val));
}
});
}
}
@ -309,12 +310,14 @@ export class SupplierInfoComponent implements OnInit {
initTradingProductsDetails(datas) {
const control = <FormArray>this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products'];
console.log('control',control);
if(datas === null){
control.push(this.initTradingProducts(null));
} else {
for (let val of datas) {
control.push(this.initTradingProducts(val));
}
datas.forEach((val,inx) => {
this.checkCard(val.trade_product_payment_type,2,inx);
control.push(this.initTradingProducts(val));
});
}
}
@ -495,11 +498,36 @@ export class SupplierInfoComponent implements OnInit {
}
}
mfgCreditCardFlag : boolean = false;
trdCreditCardFlag : boolean = false;
mfgCounter: any = [];
trdCounter: any = [];
checkCard(e,flag,index){
if(flag == 2 && e==3){
this.trdCounter[index] = 1;
}
else if(flag == 2 && e!=3){
this.trdCounter[index] = 0;
}
let TRD = this.trdCounter.reduce((sum, val) => sum + +val, 0);
this.trdCreditCardFlag = TRD > 0 ? true : false ;
if(flag == 1 && e==3){
this.mfgCounter[index] = 1;
}
else if(flag == 1 && e!=3){
this.mfgCounter[index] = 0;
}
let MFG = this.mfgCounter.reduce((sum, val) => sum + +val, 0);
this.mfgCreditCardFlag = MFG > 0 ? true : false ;
}
selectedPaymentTerms(items,e,flag){
if(flag == 2){
if(e==3){ items.controls['trade_product_credit_days_from'].setValidators([Validators.required]);
items.controls['trade_product_credit_days_to'].setValidators([Validators.required]);
}
if(e==3){
items.controls['trade_product_credit_days_from'].setValidators([Validators.required]);
items.controls['trade_product_credit_days_to'].setValidators([Validators.required]);
}
else{
items.controls['trade_product_credit_days_from'].clearValidators();
items.controls['trade_product_credit_days_from'].setValue('');
@ -508,11 +536,10 @@ export class SupplierInfoComponent implements OnInit {
}
items.controls['trade_product_credit_days_from'].updateValueAndValidity();
items.controls['trade_product_credit_days_to'].updateValueAndValidity();
}
else if(flag == 1){
if(e==3){ items.controls['manufacturing_credit_days_from'].setValidators([Validators.required]);
items.controls['manufacturing_credit_days_to'].setValidators([Validators.required]);
items.controls['manufacturing_credit_days_to'].setValidators([Validators.required]);
}
else{
items.controls['manufacturing_credit_days_from'].clearValidators();
@ -525,7 +552,6 @@ export class SupplierInfoComponent implements OnInit {
}
}
// {
// 'main_raw_materials': 'sdkjfal',
// 'supplier_details' ; [