issues fixes : ps
This commit is contained in:
parent
21355637d0
commit
45764746d7
BIN
ng6-seed/SE_PROD_030519.zip
Normal file
BIN
ng6-seed/SE_PROD_030519.zip
Normal file
Binary file not shown.
@ -493,17 +493,81 @@
|
|||||||
<mat-option value="no">No</mat-option>
|
<mat-option value="no">No</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:45%;" *ngIf="financialForm.controls.is_there_working_capital_available.value == 'yes'">
|
<!-- <mat-form-field style="width:45%;" *ngIf="financialForm.controls.is_there_working_capital_available.value == 'yes'">
|
||||||
<mat-select multiple formControlName="working_capital_facilities_availed"
|
<mat-select multiple formControlName="working_capital_facilities_availed"
|
||||||
placeholder="Working Capital Facilities availed">
|
placeholder="Working Capital Facilities availed">
|
||||||
<!-- <mat-option>Select</mat-option> -->
|
<!-- <mat-option>Select</mat-option> --
|
||||||
<mat-option *ngFor="let a of av" [value]="a.id">{{a.name}}</mat-option>
|
<mat-option *ngFor="let a of av" [value]="a.id">{{a.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
</mat-form-field> -->
|
||||||
|
<div *ngIf="financialForm.controls.is_there_working_capital_available.value == 'yes'">
|
||||||
|
|
||||||
|
<mat-card-subtitle>
|
||||||
|
<p>Working Capital Facilities availed</p>
|
||||||
|
</mat-card-subtitle>
|
||||||
|
|
||||||
|
<div class="toggle" fxLayout="row wrap" formArrayName="select_working_capital_facilities_availed">
|
||||||
|
<div fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25"
|
||||||
|
*ngFor="let entityType of financialForm.controls.select_working_capital_facilities_availed['controls']; let e = index;"
|
||||||
|
[formGroupName]="e">
|
||||||
|
<mat-checkbox class="example-margin" color="primary" formControlName="exist_status"
|
||||||
|
(click)="changeBusinessActivity(entityType)">{{entityType.controls.name.value}}</mat-checkbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['other_reason_for_working_capital_facilities_availed']">
|
||||||
|
<input matInput autocomplete="off" placeholder="Others Working Capital Facilities availed"
|
||||||
|
formControlName="other_reason_for_working_capital_facilities_availed">
|
||||||
|
<mat-error *ngIf="financialForm.controls['other_reason_for_working_capital_facilities_availed'].hasError('required')">other_reason_for_working_capital_facilities_availed Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:42%;" *ngIf="financialForm.controls.is_there_working_capital_available.value == 'yes' && financialForm.controls.working_capital_facilities_availed.value != ''">
|
|
||||||
<input matInput autocomplete="off" placeholder="Details of Facility"
|
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['reason_for_working_capital_facilities_availed']">
|
||||||
|
<input matInput autocomplete="off" placeholder="Details of Others Facility"
|
||||||
formControlName="reason_for_working_capital_facilities_availed">
|
formControlName="reason_for_working_capital_facilities_availed">
|
||||||
|
<mat-error *ngIf="financialForm.controls['reason_for_working_capital_facilities_availed'].hasError('required')">reason_for_working_capital_facilities_availed Required</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['bank_guarantee']">
|
||||||
|
<input matInput autocomplete="off" placeholder="Details of Bank Guarantee Facility"
|
||||||
|
formControlName="bank_guarantee">
|
||||||
|
<mat-error *ngIf="financialForm.controls['bank_guarantee'].hasError('required')">reason_for_working_capital_facilities_availed Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['cash_credit_limit']">
|
||||||
|
<input matInput autocomplete="off" placeholder="Details of Cash Credit Limit"
|
||||||
|
formControlName="cash_credit_limit">
|
||||||
|
<mat-error *ngIf="financialForm.controls['cash_credit_limit'].hasError('required')">cash_credit_limit Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['factoring']">
|
||||||
|
<input matInput autocomplete="off" placeholder="Details of Factoring"
|
||||||
|
formControlName="factoring">
|
||||||
|
<mat-error *ngIf="financialForm.controls['factoring'].hasError('required')">cash_credit_limit Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['letter_of_credit']">
|
||||||
|
<input matInput autocomplete="off" placeholder="Details of Letter of Credit"
|
||||||
|
formControlName="letter_of_credit">
|
||||||
|
<mat-error *ngIf="financialForm.controls['letter_of_credit'].hasError('required')">letter_of_credit Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['forfaiting']">
|
||||||
|
<input matInput autocomplete="off" placeholder="Details of Forfaiting"
|
||||||
|
formControlName="factoring">
|
||||||
|
<mat-error *ngIf="financialForm.controls['forfaiting'].hasError('required')">forfaiting Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
<mat-form-field style="width:42%;" *ngIf="financialForm.controls['od_limit']">
|
||||||
|
<input matInput autocomplete="off" placeholder="Details of OD Limit"
|
||||||
|
formControlName="od_limit">
|
||||||
|
<mat-error *ngIf="financialForm.controls['od_limit'].hasError('required')">forfaiting Required</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -20,6 +20,10 @@
|
|||||||
.mat-form-field-appearance-legacy .mat-hint{
|
.mat-form-field-appearance-legacy .mat-hint{
|
||||||
color:rgba(0, 0, 0, 0.8) !important;
|
color:rgba(0, 0, 0, 0.8) !important;
|
||||||
}
|
}
|
||||||
|
.toggle{
|
||||||
|
padding: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
.underline input {
|
.underline input {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,8 +123,9 @@ export class FinancialInfoComponent implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.initstockForm();
|
this.initstockForm();
|
||||||
|
|
||||||
|
const businessActivityControl = <FormArray>this.financialForm.controls['select_working_capital_facilities_availed'];
|
||||||
let params: any = {};
|
let params: any = {};
|
||||||
params.parent_pdid = this.parent_pdid;
|
params.parent_pdid = this.parent_pdid;
|
||||||
params.pd_id = this.pdid;
|
params.pd_id = this.pdid;
|
||||||
@ -137,6 +138,59 @@ export class FinancialInfoComponent implements OnInit {
|
|||||||
|
|
||||||
if (value.status == 200) {
|
if (value.status == 200) {
|
||||||
let retriveData = value.records;
|
let retriveData = value.records;
|
||||||
|
let activityData = this.av.map(item => ({ name: item.name, id: item.id }))
|
||||||
|
let exist_activity_data: any = [];
|
||||||
|
|
||||||
|
if (retriveData.select_working_capital_facilities_availed) {
|
||||||
|
exist_activity_data = Object.keys(retriveData.select_working_capital_facilities_availed).map(function (key) {
|
||||||
|
return retriveData.select_working_capital_facilities_availed[key].id;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let actual_businees_activity = activityData.map(item => item.id);
|
||||||
|
let check_exist_businees_activity = actual_businees_activity.map((id, index) => {
|
||||||
|
if (exist_activity_data.indexOf(id) < 0) {
|
||||||
|
activityData[index].exist_status = 0;
|
||||||
|
return activityData[index];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
activityData[index].exist_status = 1;
|
||||||
|
return activityData[index];
|
||||||
|
}
|
||||||
|
}).filter(item => item != undefined);
|
||||||
|
|
||||||
|
if (check_exist_businees_activity.length > 0) {
|
||||||
|
check_exist_businees_activity.forEach(val => {
|
||||||
|
businessActivityControl.push(this.createEntityType(val));
|
||||||
|
|
||||||
|
if (val.exist_status == 1 && val.id == 2) {
|
||||||
|
this.financialForm.addControl('bank_guarantee', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (val.exist_status == 1 && val.id == 3) {
|
||||||
|
this.financialForm.addControl('cash_credit_limit', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (val.exist_status == 1 && val.id == 4) {
|
||||||
|
this.financialForm.addControl('factoring', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (val.exist_status == 1 && val.id == 5) {
|
||||||
|
this.financialForm.addControl('forfaiting', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (val.exist_status == 1 && val.id == 6) {
|
||||||
|
this.financialForm.addControl('letter_of_credit', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (val.exist_status == 1 && val.id == 7) {
|
||||||
|
this.financialForm.addControl('od_limit', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (val.exist_status == 1 && val.id == 1) {
|
||||||
|
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
|
||||||
|
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
console.log(val);
|
||||||
|
});
|
||||||
|
console.log('check_exist_businees_activity',check_exist_businees_activity);
|
||||||
|
retriveData.select_working_capital_facilities_availed = check_exist_businees_activity;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(value.records.is_financial_statements == 'yes'){
|
if(value.records.is_financial_statements == 'yes'){
|
||||||
this.isDisplay = true;
|
this.isDisplay = true;
|
||||||
@ -195,12 +249,41 @@ export class FinancialInfoComponent implements OnInit {
|
|||||||
retriveData.formid = this.form_id;
|
retriveData.formid = this.form_id;
|
||||||
retriveData.company_id = this.company_id;
|
retriveData.company_id = this.company_id;
|
||||||
retriveData.fk_createdby = this.pdid;
|
retriveData.fk_createdby = this.pdid;
|
||||||
this.financialForm.setValue(retriveData);
|
this.financialForm.patchValue(retriveData);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
let activityData = this.av.map(item => ({ name: item.name, id: item.id }))
|
||||||
|
let exist_activity_data: any = [];
|
||||||
|
// if (data.records.select_working_capital_facilities_availed) {
|
||||||
|
// exist_activity_data = Object.keys(data.records.select_working_capital_facilities_availed).map(function (key) {
|
||||||
|
// return data.records.select_working_capital_facilities_availed[key].id;
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
let actual_businees_activity = activityData.map(item => item.id);
|
||||||
|
let check_exist_businees_activity = actual_businees_activity.map((id, index) => {
|
||||||
|
if (exist_activity_data.indexOf(id) < 0) {
|
||||||
|
activityData[index].exist_status = 0;
|
||||||
|
return activityData[index];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
activityData[index].exist_status = 1;
|
||||||
|
return activityData[index];
|
||||||
|
}
|
||||||
|
}).filter(item => item != undefined);
|
||||||
|
|
||||||
|
|
||||||
|
if (check_exist_businees_activity.length > 0) {
|
||||||
|
check_exist_businees_activity.forEach(val => {
|
||||||
|
businessActivityControl.push(this.createEntityType(val));
|
||||||
|
});
|
||||||
|
// businessVal.select_working_capital_facilities_availed = check_exist_businees_activity;
|
||||||
|
}
|
||||||
//financial_date.push(this.createDate());
|
//financial_date.push(this.createDate());
|
||||||
//estimated_val.push(this.createValue(''));
|
//estimated_val.push(this.createValue(''));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this._pd.retriveFile(this.pdid,this.form_id,this.company_id).subscribe(data => {
|
this._pd.retriveFile(this.pdid,this.form_id,this.company_id).subscribe(data => {
|
||||||
if (data.status == 200) {
|
if (data.status == 200) {
|
||||||
if(data.records.length>0){
|
if(data.records.length>0){
|
||||||
@ -221,6 +304,16 @@ export class FinancialInfoComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createEntityType(details: any): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
id: [details.id, Validators.compose([Validators.required])],
|
||||||
|
name: [details.name, Validators.compose([Validators.required])],
|
||||||
|
exist_status: [details.exist_status == 1 ? true : false]
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
pdf(fileURL){
|
pdf(fileURL){
|
||||||
window.open(fileURL);
|
window.open(fileURL);
|
||||||
}
|
}
|
||||||
@ -250,10 +343,11 @@ export class FinancialInfoComponent implements OnInit {
|
|||||||
unsold_stock_lies_in_days:[''],
|
unsold_stock_lies_in_days:[''],
|
||||||
is_there_working_capital_available:[''],
|
is_there_working_capital_available:[''],
|
||||||
working_capital_facilities_availed:[''],
|
working_capital_facilities_availed:[''],
|
||||||
reason_for_working_capital_facilities_availed:[''],
|
// reason_for_working_capital_facilities_availed:[''],
|
||||||
// same_as_financial_statements:[''],
|
// same_as_financial_statements:[''],
|
||||||
date_per_financial: this.fb.array([]),
|
date_per_financial: this.fb.array([]),
|
||||||
estimated_value: this.fb.array([])
|
estimated_value: this.fb.array([]),
|
||||||
|
select_working_capital_facilities_availed : this.fb.array([])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,6 +380,68 @@ export class FinancialInfoComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeBusinessActivity(event: any) {
|
||||||
|
console.log('event',event);
|
||||||
|
if (event.value.exist_status == true && event.value.id == 2) {
|
||||||
|
console.log('event.value.exist_status == true && event.value.id == 2',event.value.exist_status,event.value.id)
|
||||||
|
|
||||||
|
this.financialForm.removeControl('bank_guarantee');
|
||||||
|
}
|
||||||
|
else if (event.value.exist_status == false && event.value.id == 2) {
|
||||||
|
console.log('event.value.exist_status == true && event.value.id == 2',event.value.exist_status,event.value.id)
|
||||||
|
this.financialForm.addControl('bank_guarantee', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (event.value.exist_status == true && event.value.id == 3) {
|
||||||
|
this.financialForm.removeControl('cash_credit_limit');
|
||||||
|
}
|
||||||
|
else if (event.value.exist_status == false && event.value.id == 3) {
|
||||||
|
this.financialForm.addControl('cash_credit_limit', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (event.value.exist_status == true && event.value.id == 4) {
|
||||||
|
this.financialForm.removeControl('factoring');
|
||||||
|
}
|
||||||
|
else if (event.value.exist_status == false && event.value.id == 4) {
|
||||||
|
this.financialForm.addControl('factoring', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (event.value.exist_status == true && event.value.id == 5) {
|
||||||
|
this.financialForm.removeControl('forfaiting');
|
||||||
|
}
|
||||||
|
else if (event.value.exist_status == false && event.value.id == 5) {
|
||||||
|
this.financialForm.addControl('forfaiting', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (event.value.exist_status == true && event.value.id == 6) {
|
||||||
|
this.financialForm.removeControl('letter_of_credit');
|
||||||
|
}
|
||||||
|
else if (event.value.exist_status == false && event.value.id == 6) {
|
||||||
|
this.financialForm.addControl('letter_of_credit', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (event.value.exist_status == true && event.value.id == 7) {
|
||||||
|
this.financialForm.removeControl('od_limit');
|
||||||
|
}
|
||||||
|
else if (event.value.exist_status == false && event.value.id == 7) {
|
||||||
|
this.financialForm.addControl('od_limit', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
if (event.value.exist_status == true && event.value.id == 1) {
|
||||||
|
this.financialForm.removeControl('other_reason_for_working_capital_facilities_availed');
|
||||||
|
this.financialForm.removeControl('reason_for_working_capital_facilities_availed');
|
||||||
|
}
|
||||||
|
else if (event.value.exist_status == false && event.value.id == 1) {
|
||||||
|
this.financialForm.addControl('other_reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
|
||||||
|
this.financialForm.addControl('reason_for_working_capital_facilities_availed', new FormControl('', Validators.required));
|
||||||
|
}
|
||||||
|
|
||||||
|
// if(event.value.exist_status==true && event.value.id==1){
|
||||||
|
// let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
|
||||||
|
// othersControl.controls = [];
|
||||||
|
// othersControl.setValue([]);
|
||||||
|
// }
|
||||||
|
// else if(event.value.exist_status==false && event.value.id==1){
|
||||||
|
// let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
|
||||||
|
// othersControl.push(this.createOthersActivity());
|
||||||
|
// }
|
||||||
|
// check activity type for make dosument sighted filed dynamically
|
||||||
|
}
|
||||||
|
|
||||||
/** CREATING financial Customer ( financial_year AutoGenerate ) */
|
/** CREATING financial Customer ( financial_year AutoGenerate ) */
|
||||||
createValue(date) {
|
createValue(date) {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
@ -1699,11 +1855,15 @@ export class FinancialInfoComponent implements OnInit {
|
|||||||
this.financialForm.value.date_per_financial['financial_margin_of_loss'].updateValueAndValidity();
|
this.financialForm.value.date_per_financial['financial_margin_of_loss'].updateValueAndValidity();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!this.financialForm.valid) {
|
if (!this.financialForm.valid) {
|
||||||
// this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
console.log('this.financialForm.value',this.financialForm.value);
|
||||||
let records = this.financialForm.value;
|
let records = this.financialForm.value;
|
||||||
|
records.select_working_capital_facilities_availed = records.select_working_capital_facilities_availed.filter(value => value.exist_status == 1);
|
||||||
|
console.log('records',records);
|
||||||
|
|
||||||
this._pd.saveForm(records).subscribe(data => {
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
if(data.status == 200) {
|
if(data.status == 200) {
|
||||||
this.notifier.notify('success', 'Saved Successfully.');
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
|||||||
@ -208,13 +208,13 @@ export class DialogEntityEditListTatComponent implements OnInit {
|
|||||||
get f() { return this.tatListEditForm.controls };
|
get f() { return this.tatListEditForm.controls };
|
||||||
get f1() { return this.tatEditAddForm.controls };
|
get f1() { return this.tatEditAddForm.controls };
|
||||||
|
|
||||||
// onSubmit() {
|
onSubmit() {
|
||||||
// this.submitted = true;
|
this.submitted = true;
|
||||||
// if (this.tatListEditForm.invalid) {
|
if (this.tatListEditForm.invalid) {
|
||||||
// return;
|
return;
|
||||||
// } else {
|
} else {
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
onSubmitEditAddForm() {
|
onSubmitEditAddForm() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user