From b8fb9c6ff021ea8bfa054e161aa2cf20a5a76d1f Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 4 Feb 2019 16:50:54 +0530 Subject: [PATCH 1/6] UI changes --- .../final-remarks.component.html | 21 +++++++++++++++++++ .../final-remarks/final-remarks.component.ts | 8 +++++++ 2 files changed, 29 insertions(+) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html index dcf7ee39d..4603d85f1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html @@ -34,6 +34,27 @@ + + + + + Positive + Negative + Refer to Credit + Others + + + + + + + + + + + + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts index 6d22cd494..c3c8a61e8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts @@ -58,6 +58,10 @@ export class FinalRemarksComponent implements OnInit { final_custormer_remark_type : [], final_other_customer_behaviour:[], is_service_provided: ['', Validators.required], + pd_officers_recommendation:['', Validators.required], + others_pd_officers_recommendation:[''], + enter_reason_for_negative:[''], + enter_reason_for_refer_to_credit:[''], final_form_remarks: ['',Validators.required] }); this.getM_Type(); @@ -88,6 +92,10 @@ export class FinalRemarksComponent implements OnInit { if(data.dataStatus){ this._finalRemarkForm.controls.final_custormer_remark_type.setValue(data.records.final_custormer_remark_type); this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour); + this._finalRemarkForm.controls.pd_officers_recommendation.setValue(data.records.pd_officers_recommendation); + this._finalRemarkForm.controls.others_pd_officers_recommendation.setValue(data.records.others_pd_officers_recommendation); + this._finalRemarkForm.controls.enter_reason_for_negative.setValue(data.records.enter_reason_for_negative); + this._finalRemarkForm.controls.enter_reason_for_refer_to_credit.setValue(data.records.enter_reason_for_refer_to_credit); this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided); this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks); this.noRecordsFound = true; From 9f9ac3cd2c3232370a913682799b3aaf951fc61d Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 4 Feb 2019 17:27:27 +0530 Subject: [PATCH 2/6] UI Changes --- .../manage-pd/list-pd/add-pd/add-pd.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index f1dd890d8..25d14d8da 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -210,8 +210,9 @@ export class AddPdComponent implements OnInit, OnDestroy { data => { if (data.status == 200) { this.titleList=data.records.filter(val=>val.isactive==1); - let index1 = this.titleList.map(data => data.name).indexOf("Master"); - this.titleList.splice(index1, 1); + // console.log(this.titleList); + // let index1 = this.titleList.map(data => data.name).indexOf("Master"); + // this.titleList.splice(index1, 1); } }, error => this.errorMessage = error); From 80ad486e4337c98178a408902adbe66bf2181c5e Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 4 Feb 2019 18:10:15 +0530 Subject: [PATCH 3/6] assessed income changes --- .../manage-busines-expense.component.html | 55 ++ .../manage-busines-expense.component.scss | 21 + .../manage-busines-expense.component.spec.ts | 25 + .../manage-busines-expense.component.ts | 125 ++++ .../manage-daily-sales.component.html | 72 +++ .../manage-daily-sales.component.scss | 21 + .../manage-daily-sales.component.spec.ts | 25 + .../manage-daily-sales.component.ts | 213 +++++++ .../manage-house-hold.component.html | 53 ++ .../manage-house-hold.component.scss | 21 + .../manage-house-hold.component.spec.ts | 25 + .../manage-house-hold.component.ts | 122 ++++ ...anage-other-business-income.component.html | 55 ++ ...anage-other-business-income.component.scss | 21 + ...ge-other-business-income.component.spec.ts | 25 + .../manage-other-business-income.component.ts | 125 ++++ .../manage-purchase.component.html | 68 ++ .../manage-purchase.component.scss | 21 + .../manage-purchase.component.spec.ts | 25 + .../manage-purchase.component.ts | 129 ++++ .../manage-sales/manage-sales.component.html | 78 +++ .../manage-sales/manage-sales.component.scss | 22 + .../manage-sales.component.spec.ts | 25 + .../manage-sales/manage-sales.component.ts | 157 +++++ .../assessed-income.component.html | 587 +++++++----------- .../assessed-income.component.scss | 43 +- .../assessed-income.component.ts | 114 +++- .../business-expense-details.component.html | 56 ++ .../business-expense-details.component.scss | 30 + ...business-expense-details.component.spec.ts | 25 + .../business-expense-details.component.ts | 88 +++ .../daily-sales-details.component.html | 69 ++ .../daily-sales-details.component.scss | 33 + .../daily-sales-details.component.spec.ts | 25 + .../daily-sales-details.component.ts | 121 ++++ .../gross-profit-calculation.component.html | 26 + .../gross-profit-calculation.component.scss | 3 + ...gross-profit-calculation.component.spec.ts | 25 + .../gross-profit-calculation.component.ts | 79 +++ .../house-hold-details.component.html | 57 ++ .../house-hold-details.component.scss | 30 + .../house-hold-details.component.spec.ts | 25 + .../house-hold-details.component.ts | 90 +++ ...her-business-income-details.component.html | 55 ++ ...her-business-income-details.component.scss | 30 + ...-business-income-details.component.spec.ts | 25 + ...other-business-income-details.component.ts | 87 +++ .../purchase-details.component.html | 68 ++ .../purchase-details.component.scss | 30 + .../purchase-details.component.spec.ts | 25 + .../purchase-details.component.ts | 100 +++ .../sales-calculation.component.html | 21 + .../sales-calculation.component.scss | 3 + .../sales-calculation.component.spec.ts | 25 + .../sales-calculation.component.ts | 102 +++ .../sales-details.component.html | 86 +++ .../sales-details.component.scss | 30 + .../sales-details.component.spec.ts | 25 + .../sales-details/sales-details.component.ts | 119 ++++ .../manage-pd/manage-pd.module.ts | 22 +- .../delete-records-count.pipe.spec.ts | 8 + .../pd-pipes/delete-records-count.pipe.ts | 18 + .../pd-service/pd-triger.service.ts | 9 + .../personal-discussion.module.ts | 1 - .../numbers-only/numbers-only.directive.ts | 31 + ng6-seed/src/app/shared/shared.module.ts | 7 +- 66 files changed, 3554 insertions(+), 428 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.ts create mode 100644 ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.ts create mode 100644 ng6-seed/src/app/shared/numbers-only/numbers-only.directive.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.html new file mode 100644 index 000000000..d24d79dd8 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.html @@ -0,0 +1,55 @@ +
+ +

+
+ {{pageTitle}} +
+
+ +
+

+ + + +
+
+ + + {{expense.expense_item}} + + + +
+
+ + + + + + {{frq.name}} + + + + + +
+ +
+
+
+ +
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.scss new file mode 100644 index 000000000..3f33ba147 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.scss @@ -0,0 +1,21 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + mat-form-field { + margin: 0 2%; + } + .example-section { + height: 120px; + } + + .example-margin { + margin: 0 10px; + } + ::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; +} + +.item-margin { + margin-left: 2%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.spec.ts new file mode 100644 index 000000000..d55a1db2c --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ManageBusinesExpenseComponent } from './manage-busines-expense.component'; + +describe('ManageBusinesExpenseComponent', () => { + let component: ManageBusinesExpenseComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ManageBusinesExpenseComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ManageBusinesExpenseComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.ts new file mode 100644 index 000000000..85e9d8501 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.ts @@ -0,0 +1,125 @@ +import { Component, OnInit, Input, Output, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { PdTrigerService } from './../../../../../../../pd-service/pd-triger.service'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-manage-busines-expense', + templateUrl: './manage-busines-expense.component.html', + styleUrls: ['./manage-busines-expense.component.scss'] +}) +export class ManageBusinesExpenseComponent implements OnInit { + + pageTitle:string; + businessItemForm:FormGroup; + frequencyData: any[]=[]; + businessExpenseData: any[]=[]; + private notifier: NotifierService; + constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { + this.frequencyData=this.data.masterData.frequencyList; + this.businessExpenseData = this.data.masterData.businessExpenseList; + this.pageTitle = this.data.manage_status==1 ? 'Add Business Expense Item' : 'Update Business Expense Item'; + this.notifier = notifier; + } + + ngOnInit() { + if(this.data.manage_status==2){ + this.businessItemForm = this._fb.group({ + busExpense: this._fb.array([this.createBusinessItemWithData(this.data.editData)]), + }); + } + else{ + this.businessItemForm = this._fb.group({ + busExpense: this._fb.array([this.createBusinessItem()]), + }); + + } + + } + + // add business item details + createBusinessItem():FormGroup { + return this._fb.group({ + pd_expense_id:[''], + fk_pd_id:[this.data.masterData.pdid], + expense_item_id:['',Validators.compose([Validators.required])], + expense_value:['',Validators.compose([Validators.required])], + fk_frequency_id:['',Validators.compose([Validators.required])], + annual_expenses_value:['',Validators.compose([Validators.required])], + }); +} + +// create form with data +createBusinessItemWithData(values: any) { + return this._fb.group({ + pd_expense_id:[values.pd_expense_id], + fk_pd_id:[this.data.masterData.pdid], + expense_item_id:[values.expense_item_id,Validators.compose([Validators.required])], + expense_value:[values.expense_value,Validators.compose([Validators.required])], + fk_frequency_id:[values.fk_frequency_id,Validators.compose([Validators.required])], + annual_expenses_value:[values.annual_expenses_value,Validators.compose([Validators.required])], + }); +} + +// add more item +addMore(): void{ + let control = this.businessItemForm.controls['busExpense']; + control.push(this.createBusinessItem()); +} + +// close dialogue manually +closeDialogue(){ + this.dialogRef.close({update_status:false}); +} + +businessCalculation(indexVal: number,values: any): void { + let control:any = this.businessItemForm.controls['busExpense']; + if(values.expense_value!='' && values.fk_frequency_id!='') { + let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id); + control.controls[indexVal].controls['annual_expenses_value'].setValue(parseInt(values.expense_value) * parseInt(filterFrequencyValue[0].mutiple_factor)); + + } + else { + control.controls[indexVal].controls['annual_expenses_value'].setValue(''); + } +} + +removeItem(indexVal: number) : void { + let control = this.businessItemForm.controls['busExpense']; + control.removeAt(indexVal); + +} + +// save purchase details +submitDetails(records) { + if (this.businessItemForm.invalid) { + this.validateAllFormFields(this.businessItemForm); + this.notifier.notify('warning',"Please Check All Manatory Fields.."); + return; + } + this._pd.saveAssessedDetails('saveAssessedIncomeBusinessExpenses',records.busExpense).subscribe(data => { + this.notifier.notify('success', this.data.manage_status==2 ? 'Updated Successfully.' : 'Saved Successfully.'); + setTimeout(() =>{ + this.dialogRef.close({update_status:true}); + },3000); + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); +} + + // validate all form group and form array fields + validateAllFormFields(formGroup: any) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } else if (control instanceof FormArray) { + this.validateAllFormFields(control); + } + }); +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.html new file mode 100644 index 000000000..e75308643 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.html @@ -0,0 +1,72 @@ + + +

+
+ {{pageTitle}} +
+
+ +
+

+ + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + +
+
+
+
+ + + + +
+ +
+ + + +
+ +
+ + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.scss new file mode 100644 index 000000000..3f33ba147 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.scss @@ -0,0 +1,21 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + mat-form-field { + margin: 0 2%; + } + .example-section { + height: 120px; + } + + .example-margin { + margin: 0 10px; + } + ::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; +} + +.item-margin { + margin-left: 2%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.spec.ts new file mode 100644 index 000000000..cc694278a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ManageDailySalesComponent } from './manage-daily-sales.component'; + +describe('ManageDailySalesComponent', () => { + let component: ManageDailySalesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ManageDailySalesComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ManageDailySalesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.ts new file mode 100644 index 000000000..f0a702803 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.ts @@ -0,0 +1,213 @@ +import { Component, OnInit, Input, Output, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { PdTrigerService } from './../../../../../../../pd-service/pd-triger.service'; +import { NotifierService } from 'angular-notifier'; +import { DatePipe } from '@angular/common'; +import { DeleteRecordsCountPipe } from './../../../../../../../pd-pipes/delete-records-count.pipe'; + +@Component({ + selector: 'app-manage-daily-sales', + templateUrl: './manage-daily-sales.component.html', + styleUrls: ['./manage-daily-sales.component.scss'], + providers: [DeleteRecordsCountPipe], +}) +export class ManageDailySalesComponent implements OnInit { + pipe = new DatePipe('en-US'); + pageTitle:string; + salesItemForm:FormGroup; + UOMData: any[]=[]; + frequencyData: any[]=[]; + private notifier: NotifierService; + constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { + this.pageTitle = this.data.manage_status==1 ? 'Add Daily Sales Item' : 'Update Daily Sales Item'; + this.notifier = notifier; + } + + ngOnInit() { + if(this.data.manage_status==1){ + this.salesItemForm = this._fb.group({ + sales_product: this._fb.array([this.createSalesItem()]), + }); + let control: any = this.salesItemForm.controls['sales_product']; + control = control.controls[0].get('child') as FormArray; + control.push(this.createDailySalesData('')) + } + else if(this.data.manage_status==2){ + this.salesItemForm = this._fb.group({ + sales_product: this._fb.array([this.createSalesItemWithData(this.data.editData)]), + }); + let control: any = this.salesItemForm.controls['sales_product']; + control = control.controls[0].get('child') as FormArray; + this.data.editData.values.forEach(elementVal => { + control.push(this.createDailySalesWithData(elementVal,this.data.editData.sim_id)) + }); + } + else{ + this.salesItemForm = this._fb.group({ + sales_product: this._fb.array([]), + }); + + } + + } + + // add sales item details + createSalesItem():FormGroup { + return this._fb.group({ + fk_pd_id: [this.data.masterData.pdid], + sim_id: [''], + sales_item: ['', Validators.compose([Validators.required])], + child: this._fb.array([]), + margin_per: [''], + margin_value: [''], + isactive:[true] + }); +} +// create daily list empty +createDailySalesData(sim_id: string) { + return this._fb.group({ + simc_id: [''], + fk_sim_id: [sim_id], + sales_date: [''], + sales_value: ['', Validators.compose([Validators.required])], + isactive:[true] + }) +} + +// create form with data +createSalesItemWithData(values: any) { + return this._fb.group({ + fk_pd_id: [this.data.masterData.pdid], + sim_id: [values.sim_id], + sales_item: [values.salesItem, Validators.compose([Validators.required])], + child: this._fb.array([]), + margin_per: [this.data.margin_calculation_status===true ? values.margin_per: ''], + margin_value: [this.data.margin_calculation_status===true ? values.margin_value: ''], + isactive:[true] + }); +} +// create daily list +createDailySalesWithData(values: any, sim_id: string) { + return this._fb.group({ + simc_id: [values.simc_id], + fk_sim_id: [sim_id], + sales_date: [new Date(this.pipe.transform(values.sales_date, 'yyyy-MM-dd')), Validators.compose([Validators.required])], + sales_value: [values.sales_value, Validators.compose([Validators.required])], + isactive:[true] + }) +} + +// add more item +addMore(parentIndex: number): void{ + let control = this.salesItemForm.controls['sales_product']; + control.push(this.createSalesItem()); + control = control.controls[parentIndex].get('child') as FormArray; + control.push(this.createDailySalesData('')) +} + +// add more daily items +addMoreDailySales(parentIndex: number,values: any): void{ + let control: any = this.salesItemForm.controls['sales_product']; + control=control.controls[parentIndex].get('child') as FormArray; + control.push(this.createDailySalesData(values.sim_id)); +} + +// remove daily items +removeDailyItems(parentIndex: number,childIndex:number, childValue:any): void { + let control: any = this.salesItemForm.controls['sales_product']; + control=control.controls[parentIndex].get('child') as FormArray; + if(childValue.simc_id=='' || childValue.simc_id==null){ + control.removeAt(childIndex); + let calculatControlValues: any = this.salesItemForm.controls['sales_product']; + calculatControlValues = calculatControlValues.controls[parentIndex]; + this.salesCalculation(parentIndex,calculatControlValues.value); + } + else { + control.controls[childIndex].controls.isactive.setValue(false); + let calculatControlValues: any = this.salesItemForm.controls['sales_product']; + calculatControlValues = calculatControlValues.controls[parentIndex]; + this.salesCalculation(parentIndex,calculatControlValues.value); + } + +} + +removeProducts(parentIndex:number){ + let control: any = this.salesItemForm.controls['sales_product']; + control.removeAt(parentIndex); +} + +// close dialogue manually +closeDialogue(){ + this.dialogRef.close({update_status:false}); +} + +salesCalculation(indexVal: number,values: any): void { + if(this.data.margin_calculation_status===true){ + let control:any = this.salesItemForm.controls['sales_product']; + if(values.child.length>0 && values.margin_per!=''){ + let transformData = values.child.filter(val=>val.sales_date!='' && val.sales_date!=null && val.sales_date!=undefined && val.sales_value!='' && val.isactive===true).map(mval=>{ + mval.custum_date = this.pipe.transform(mval.sales_date, 'yyyy-MM'); + return mval; + }); + if(transformData.length>0) { + let getUniqueMonthCounts = transformData.map(val=>val.custum_date) + .filter((fVal,fIndex,fArray)=>{ + return fIndex === fArray.indexOf(fVal); + }); + 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))); + } + else{ + control.controls[indexVal].controls['margin_value'].setValue(''); + } + + } + else { + control.controls[indexVal].controls['margin_value'].setValue(''); + + } + } + +} +// save sales details +submitDetails(records) { + if (this.salesItemForm.invalid) { + this.validateAllFormFields(this.salesItemForm); + this.notifier.notify('warning',"Please Check All Manatory Fields.."); + return; + } + // this is for remove custom date key from my array values + records.sales_product.forEach(parVal => { + parVal.child.forEach(childVal => { + if(childVal['custum_date']){ + delete childVal['custum_date'] ; + } + }); + }); + this._pd.saveAssessedDetails('saveAssessedIncomeMonthwiseItems',records.sales_product).subscribe(data => { + this.notifier.notify('success', this.data.manage_status==2 ? 'Updated Successfully.' : 'Saved Successfully.'); + setTimeout(() =>{ + this.dialogRef.close({update_status:true}); + },3000); + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); +} + + // validate all form group and form array fields + validateAllFormFields(formGroup: any) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } else if (control instanceof FormArray) { + this.validateAllFormFields(control); + } + }); +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.html new file mode 100644 index 000000000..a0221e46f --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.html @@ -0,0 +1,53 @@ + + +

+
+ {{pageTitle}} +
+
+ +
+

+ + + +
+
+ + + + +
+
+ + + + + + {{frq.name}} + + + + + +
+ +
+
+
+ +
+
+
+
+ +
+ + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.scss new file mode 100644 index 000000000..3f33ba147 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.scss @@ -0,0 +1,21 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + mat-form-field { + margin: 0 2%; + } + .example-section { + height: 120px; + } + + .example-margin { + margin: 0 10px; + } + ::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; +} + +.item-margin { + margin-left: 2%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.spec.ts new file mode 100644 index 000000000..293bd8847 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ManageHouseHoldComponent } from './manage-house-hold.component'; + +describe('ManageHouseHoldComponent', () => { + let component: ManageHouseHoldComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ManageHouseHoldComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ManageHouseHoldComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.ts new file mode 100644 index 000000000..09ca82366 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component.ts @@ -0,0 +1,122 @@ +import { Component, OnInit, Input, Output, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { PdTrigerService } from './../../../../../../../pd-service/pd-triger.service'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-manage-house-hold', + templateUrl: './manage-house-hold.component.html', + styleUrls: ['./manage-house-hold.component.scss'] +}) +export class ManageHouseHoldComponent implements OnInit { + pageTitle:string; + houseItemForm:FormGroup; + frequencyData: any[]=[]; + private notifier: NotifierService; + constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { + this.frequencyData=this.data.masterData.frequencyList; + this.pageTitle = this.data.manage_status==1 ? 'Add House Hold Item' : 'Update House Hold Item'; + this.notifier = notifier; + } + + ngOnInit() { + if(this.data.manage_status==2){ + this.houseItemForm = this._fb.group({ + houseExpense: this._fb.array([this.createHouseholdItemWithData(this.data.editData)]), + }); + } + else{ + this.houseItemForm = this._fb.group({ + houseExpense: this._fb.array([this.createHouseholdItem()]), + }); + + } + + } + + // add Household item details + createHouseholdItem():FormGroup { + return this._fb.group({ + household_expense_id:[''], + fk_pd_id:[this.data.masterData.pdid] , + expense_item: ['',Validators.compose([Validators.required])], + expense_value: ['',Validators.compose([Validators.required])], + fk_frequency_id: ['',Validators.compose([Validators.required])], + annual_expense_value: ['',Validators.compose([Validators.required])], + }); +} + +// create form with data +createHouseholdItemWithData(values: any) { + return this._fb.group({ + household_expense_id:[values.household_expense_id], + fk_pd_id:[this.data.masterData.pdid] , + expense_item: [values.expense_item,Validators.compose([Validators.required])], + expense_value: [values.expense_value,Validators.compose([Validators.required])], + fk_frequency_id: [values.fk_frequency_id,Validators.compose([Validators.required])], + annual_expense_value: [values.annual_expense_value,Validators.compose([Validators.required])], + }); +} + +// add more item +addMore(): void{ + let control = this.houseItemForm.controls['houseExpense']; + control.push(this.createHouseholdItem()); +} + +// close dialogue manually +closeDialogue(){ + this.dialogRef.close({update_status:false}); +} + +houseCalculation(indexVal: number,values: any): void { + let control:any = this.houseItemForm.controls['houseExpense']; + if(values.expense_value!='' && values.fk_frequency_id!='') { + let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id); + control.controls[indexVal].controls['annual_expense_value'].setValue(parseInt(values.expense_value) * parseInt(filterFrequencyValue[0].mutiple_factor)); + + } + else { + control.controls[indexVal].controls['annual_expense_value'].setValue(''); + } +} + +removeItem(indexVal: number) : void { + let control = this.houseItemForm.controls['houseExpense']; + control.removeAt(indexVal); + +} + +// save house hold details +submitDetails(records) { + if (this.houseItemForm.invalid) { + this.validateAllFormFields(this.houseItemForm); + this.notifier.notify('warning',"Please Check All Manatory Fields.."); + return; + } + this._pd.saveAssessedDetails('saveAssessedIncomeHouseholdExpenses',records.houseExpense).subscribe(data => { + this.notifier.notify('success', this.data.manage_status==2 ? 'Updated Successfully.' : 'Saved Successfully.'); + setTimeout(() =>{ + this.dialogRef.close({update_status:true}); + },3000); + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); +} + + // validate all form group and form array fields + validateAllFormFields(formGroup: any) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } else if (control instanceof FormArray) { + this.validateAllFormFields(control); + } + }); +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.html new file mode 100644 index 000000000..6f5c5e89b --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.html @@ -0,0 +1,55 @@ + + +

+
+ {{pageTitle}} +
+
+ +
+

+ + + +
+
+ + + {{income.business_income_item}} + + + +
+
+ + + + + + {{frq.name}} + + + + + +
+ +
+
+
+ +
+
+
+
+ +
+ + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.scss new file mode 100644 index 000000000..3f33ba147 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.scss @@ -0,0 +1,21 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + mat-form-field { + margin: 0 2%; + } + .example-section { + height: 120px; + } + + .example-margin { + margin: 0 10px; + } + ::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; +} + +.item-margin { + margin-left: 2%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.spec.ts new file mode 100644 index 000000000..d8a661b5d --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ManageOtherBusinessIncomeComponent } from './manage-other-business-income.component'; + +describe('ManageOtherBusinessIncomeComponent', () => { + let component: ManageOtherBusinessIncomeComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ManageOtherBusinessIncomeComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ManageOtherBusinessIncomeComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.ts new file mode 100644 index 000000000..d3eb35298 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component.ts @@ -0,0 +1,125 @@ +import { Component, OnInit, Input, Output, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { PdTrigerService } from './../../../../../../../pd-service/pd-triger.service'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-manage-other-business-income', + templateUrl: './manage-other-business-income.component.html', + styleUrls: ['./manage-other-business-income.component.scss'] +}) +export class ManageOtherBusinessIncomeComponent implements OnInit { + + pageTitle:string; + businessIncomeItemForm:FormGroup; + frequencyData: any[]=[]; + businessIncomeData: any[]=[]; + private notifier: NotifierService; + constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { + this.frequencyData=this.data.masterData.frequencyList; + this.businessIncomeData = this.data.masterData.businessIncomeList; + this.pageTitle = this.data.manage_status==1 ? 'Add Business Income Item' : 'Update Business Income Item'; + this.notifier = notifier; + } + + ngOnInit() { + if(this.data.manage_status==2){ + this.businessIncomeItemForm = this._fb.group({ + busIncome: this._fb.array([this.createBusinessIncomeItemWithData(this.data.editData)]), + }); + } + else{ + this.businessIncomeItemForm = this._fb.group({ + busIncome: this._fb.array([this.createBusinessIncomeItem()]), + }); + + } + + } + + // add business Income item details + createBusinessIncomeItem():FormGroup { + return this._fb.group({ + pd_business_income_id:[''], + fk_pd_id:[this.data.masterData.pdid], + business_income_id:['',Validators.compose([Validators.required])], + income_value:['',Validators.compose([Validators.required])], + fk_frequency_id:['',Validators.compose([Validators.required])], + annual_income_value:['',Validators.compose([Validators.required])], + }); +} + +// create form with data +createBusinessIncomeItemWithData(values: any) { + return this._fb.group({ + pd_business_income_id:[values.pd_business_income_id], + fk_pd_id:[this.data.masterData.pdid], + business_income_id:[values.business_income_id,Validators.compose([Validators.required])], + income_value:[values.income_value,Validators.compose([Validators.required])], + fk_frequency_id:[values.fk_frequency_id,Validators.compose([Validators.required])], + annual_income_value:[values.annual_income_value,Validators.compose([Validators.required])], + }); +} + +// add more item +addMore(): void{ + let control = this.businessIncomeItemForm.controls['busIncome']; + control.push(this.createBusinessIncomeItem()); +} + +// close dialogue manually +closeDialogue(){ + this.dialogRef.close({update_status:false}); +} + +businessCalculation(indexVal: number,values: any): void { + let control:any = this.businessIncomeItemForm.controls['busIncome']; + if(values.income_value!='' && values.fk_frequency_id!='') { + let filterFrequencyValue: any = this.frequencyData.filter(val =>val.frequency_id==values.fk_frequency_id); + control.controls[indexVal].controls['annual_income_value'].setValue(parseInt(values.income_value) * parseInt(filterFrequencyValue[0].mutiple_factor)); + + } + else { + control.controls[indexVal].controls['annual_income_value'].setValue(''); + } +} + +removeItem(indexVal: number) : void { + let control = this.businessIncomeItemForm.controls['busIncome']; + control.removeAt(indexVal); + +} + +// save purchase details +submitDetails(records) { + if (this.businessIncomeItemForm.invalid) { + this.validateAllFormFields(this.businessIncomeItemForm); + this.notifier.notify('warning',"Please Check All Manatory Fields.."); + return; + } + this._pd.saveAssessedDetails('saveOtherBusinessIncome',records.busIncome).subscribe(data => { + this.notifier.notify('success', this.data.manage_status==2 ? 'Updated Successfully.' : 'Saved Successfully.'); + setTimeout(() =>{ + this.dialogRef.close({update_status:true}); + },3000); + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); +} + + // validate all form group and form array fields + validateAllFormFields(formGroup: any) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } else if (control instanceof FormArray) { + this.validateAllFormFields(control); + } + }); +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.html new file mode 100644 index 000000000..672c66b24 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.html @@ -0,0 +1,68 @@ + + +

+
+ {{pageTitle}} +
+
+ +
+

+ + + +
+
+ + + + +
+
+ + + + + + {{uom.name}} + + + + + +
+ +
+ + + {{frq.name}} + + + + + +
+ +
+
+
+ +
+
+
+
+ +
+ + + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.scss new file mode 100644 index 000000000..3f33ba147 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.scss @@ -0,0 +1,21 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + mat-form-field { + margin: 0 2%; + } + .example-section { + height: 120px; + } + + .example-margin { + margin: 0 10px; + } + ::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; +} + +.item-margin { + margin-left: 2%; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.spec.ts new file mode 100644 index 000000000..2b4112bda --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ManagePurchaseComponent } from './manage-purchase.component'; + +describe('ManagePurchaseComponent', () => { + let component: ManagePurchaseComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ManagePurchaseComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ManagePurchaseComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.ts new file mode 100644 index 000000000..2ba3bfe63 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component.ts @@ -0,0 +1,129 @@ +import { Component, OnInit, Input, Output, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { PdTrigerService } from './../../../../../../../pd-service/pd-triger.service'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-manage-purchase', + templateUrl: './manage-purchase.component.html', + styleUrls: ['./manage-purchase.component.scss'] +}) +export class ManagePurchaseComponent implements OnInit { + + pageTitle:string; + purchaseItemForm:FormGroup; + UOMData: any[]=[]; + frequencyData: any[]=[]; + private notifier: NotifierService; + constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { + this.UOMData=this.data.masterData.UOMList; + this.frequencyData=this.data.masterData.frequencyList; + this.pageTitle = this.data.manage_status==1 ? 'Add Purchase Item' : 'Update Purchase Item'; + this.notifier = notifier; + } + + ngOnInit() { + if(this.data.manage_status==2){ + this.purchaseItemForm = this._fb.group({ + purchase: this._fb.array([this.createPurchaseItemWithData(this.data.editData)]), + }); + } + else{ + this.purchaseItemForm = this._fb.group({ + purchase: this._fb.array([this.createPurchaseItem()]), + }); + + } + + } + + // add purchase item details + createPurchaseItem():FormGroup { + return this._fb.group({ + purchase_id:[''], + fk_pd_id:[this.data.masterData.pdid], + purchase_item:['',Validators.compose([Validators.required])], + purchase_qty:['',Validators.compose([Validators.required])], + fk_uom_id:['',Validators.compose([Validators.required])], + rate_per_unit:['',Validators.compose([Validators.required])], + fk_frequency_id:['',Validators.compose([Validators.required])], + annual_purchase_value:['',Validators.compose([Validators.required])], + }); +} + +// create form with data +createPurchaseItemWithData(values: any) { + return this._fb.group({ + purchase_id:[values.purchase_id], + fk_pd_id:[this.data.masterData.pdid], + purchase_item:[values.purchase_item,Validators.compose([Validators.required])], + purchase_qty:[values.purchase_qty,Validators.compose([Validators.required])], + fk_uom_id:[values.fk_uom_id,Validators.compose([Validators.required])], + rate_per_unit:[values.rate_per_unit,Validators.compose([Validators.required])], + fk_frequency_id:[values.fk_frequency_id,Validators.compose([Validators.required])], + annual_purchase_value:[values.annual_purchase_value,Validators.compose([Validators.required])], + }); +} + +// add more item +addMore(): void{ + let control = this.purchaseItemForm.controls['purchase']; + control.push(this.createPurchaseItem()); +} + +// close dialogue manually +closeDialogue(){ + this.dialogRef.close({update_status:false}); +} + +purchaseCalculation(indexVal: number,values: any): void { + let control:any = this.purchaseItemForm.controls['purchase']; + if(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 { + control.controls[indexVal].controls['annual_purchase_value'].setValue(''); + } +} + +removeItem(indexVal: number) : void { + let control = this.purchaseItemForm.controls['purchase']; + control.removeAt(indexVal); + +} + +// save purchase details +submitDetails(records) { + if (this.purchaseItemForm.invalid) { + this.validateAllFormFields(this.purchaseItemForm); + this.notifier.notify('warning',"Please Check All Manatory Fields.."); + return; + } + this._pd.saveAssessedDetails('saveAssessedIncomePurchaseDetails',records.purchase).subscribe(data => { + this.notifier.notify('success', this.data.manage_status==2 ? 'Updated Successfully.' : 'Saved Successfully.'); + setTimeout(() =>{ + this.dialogRef.close({update_status:true}); + },3000); + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); +} + + // validate all form group and form array fields + validateAllFormFields(formGroup: any) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } else if (control instanceof FormArray) { + this.validateAllFormFields(control); + } + }); +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.html new file mode 100644 index 000000000..8511f63d1 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.html @@ -0,0 +1,78 @@ + + +

+
+ {{pageTitle}} +
+
+ +
+

+ + + +
+
+ + + + +
+
+ + + + + + {{uom.name}} + + + + + +
+ +
+ + + {{frq.name}} + + + + + +
+
+ + + + + + + + + +
+ +
+
+
+ +
+
+
+
+ +
+ + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.scss new file mode 100644 index 000000000..5e737ca3c --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.scss @@ -0,0 +1,22 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + mat-form-field { + margin: 0 2%; + } + .example-section { + height: 120px; + } + + .example-margin { + margin: 0 10px; + } + ::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; +} + +.item-margin { + margin-left: 2%; +} + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.spec.ts new file mode 100644 index 000000000..05b03c31b --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ManageSalesComponent } from './manage-sales.component'; + +describe('ManageSalesComponent', () => { + let component: ManageSalesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ManageSalesComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ManageSalesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.ts new file mode 100644 index 000000000..384ee80a2 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component.ts @@ -0,0 +1,157 @@ +import { Component, OnInit, Input, Output, Inject } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { PdTrigerService } from './../../../../../../../pd-service/pd-triger.service'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-manage-sales', + templateUrl: './manage-sales.component.html', + styleUrls: ['./manage-sales.component.scss'] +}) +export class ManageSalesComponent implements OnInit { + pageTitle:string; + salesItemForm:FormGroup; + UOMData: any[]=[]; + frequencyData: any[]=[]; + private notifier: NotifierService; + constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { + this.UOMData=this.data.masterData.UOMList; + this.frequencyData=this.data.masterData.frequencyList; + this.pageTitle = this.data.manage_status==1 ? 'Add Sales Item' : 'Update Sales Item'; + this.notifier = notifier; + } + + ngOnInit() { + if(this.data.manage_status==2){ + this.salesItemForm = this._fb.group({ + salesCalItemwise: this._fb.array([this.createSalesItemWithData(this.data.editData)]), + }); + } + else{ + this.salesItemForm = this._fb.group({ + salesCalItemwise: this._fb.array([this.createSalesItem()]), + }); + + } + + } + + // add sales item details + createSalesItem():FormGroup { + return this._fb.group({ + sci_id:[], + fk_pd_id:[this.data.masterData.pdid], + sales_item:['',Validators.compose([Validators.required])], + sales_qty:['',Validators.compose([Validators.required])], + fk_uom_id:['',Validators.compose([Validators.required])], + rate_per_unit:['',Validators.compose([Validators.required])], + fk_frequency_id:['',Validators.compose([Validators.required])], + annual_sale_value:[''], + margin_per:[''], + margin_per_uom:[''], + margin_final_value:[''], + }); +} + +// create form with data +createSalesItemWithData(values: any) { + return this._fb.group({ + sci_id:[values.sci_id], + fk_pd_id:[this.data.masterData.pdid], + sales_item:[values.sales_item,Validators.compose([Validators.required])], + sales_qty:[values.sales_qty,Validators.compose([Validators.required])], + fk_uom_id:[values.fk_uom_id,Validators.compose([Validators.required])], + rate_per_unit:[values.rate_per_unit,Validators.compose([Validators.required])], + fk_frequency_id:[values.fk_frequency_id,Validators.compose([Validators.required])], + annual_sale_value:[values.annual_sale_value], + margin_per:[this.data.margin_calculation_status===true ? values.margin_per : ''], + margin_per_uom:[this.data.margin_calculation_status===true ? values.margin_per_uom :''], + margin_final_value:[this.data.margin_calculation_status===true ? values.margin_final_value: ''], + }); +} + +// add more item +addMore(): void{ + let control = this.salesItemForm.controls['salesCalItemwise']; + control.push(this.createSalesItem()); +} + +// close dialogue manually +closeDialogue(){ + this.dialogRef.close({update_status:false}); +} + +salesCalculation(indexVal: number,values: any): void { + let control:any = this.salesItemForm.controls['salesCalItemwise']; + 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); + control.controls[indexVal].controls['annual_sale_value'].setValue(parseInt(values.sales_qty) * parseInt(values.rate_per_unit) * parseInt(filterFrequencyValue[0].mutiple_factor)); + + } + else { + control.controls[indexVal].controls['annual_sale_value'].setValue(''); + } + if(this.data.margin_calculation_status===true) { + values.margin_per_uom=='' && values.margin_per!='' ? this.salesMarginPerCalculation(indexVal,this.salesItemForm.value.salesCalItemwise[indexVal]): values.margin_per_uom!='' && values.margin_per=='' ? this.salesMarginAmtCalculation(indexVal,this.salesItemForm.value.salesCalItemwise[indexVal]) : values.margin_per_uom!='' && values.margin_per!='' ? this.salesMarginAmtCalculation(indexVal,this.salesItemForm.value.salesCalItemwise[indexVal]) :this.salesMarginAmtCalculation(indexVal,this.salesItemForm.value.salesCalItemwise[indexVal]); + } +} +salesMarginPerCalculation(indexVal: number,values: any): void { + let control:any = this.salesItemForm.controls['salesCalItemwise']; + 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)); + } + else { + control.controls[indexVal].controls['margin_final_value'].setValue(''); + } +} +salesMarginAmtCalculation(indexVal: number,values: any): void { + let control:any = this.salesItemForm.controls['salesCalItemwise']; + control.controls[indexVal].controls['margin_per'].setValue(''); + if(values.margin_per_uom!='' && values.sales_qty!='') { + control.controls[indexVal].controls['margin_final_value'].setValue(parseInt(values.sales_qty) * parseInt(values.margin_per_uom)); + } + else { + control.controls[indexVal].controls['margin_final_value'].setValue(''); + } +} + +removeItem(indexVal: number) : void { + let control = this.salesItemForm.controls['salesCalItemwise']; + control.removeAt(indexVal); + +} + +// save sales details +submitDetails(records) { + if (this.salesItemForm.invalid) { + this.validateAllFormFields(this.salesItemForm); + this.notifier.notify('warning',"Please Check All Manatory Fields.."); + return; + } + this._pd.saveAssessedDetails('saveAssessedIncomeSalesCalculatedByItemwise',records.salesCalItemwise).subscribe(data => { + this.notifier.notify('success', this.data.manage_status==2 ? 'Updated Successfully.' : 'Saved Successfully.'); + setTimeout(() =>{ + this.dialogRef.close({update_status:true}); + },3000); + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); +} + + // validate all form group and form array fields + validateAllFormFields(formGroup: any) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } else if (control instanceof FormArray) { + this.validateAllFormFields(control); + } + }); +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html index 206bbfe1e..8ec856cb6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html @@ -1,6 +1,4 @@ - - -

+

{{pageTitle}}
@@ -11,371 +9,228 @@

- - - - - -
-
- + + + + + + - - - - - - - - - Sales Calculate Item Wise - - - {{salesCaluatedItem.length}}  Items - - - -
- - - - - - - - - - - - - - - - - + + + + +
+

a) Cost of Goods Sold

+
+
+

{{sales_value}}

+
+ +
+ +
+

b) Purchases

+
+
+

{{purchase_value}}

+
+ +
+ +
+

c) Gross Profit (a-b)

+
+
+

{{gross_profit_value}}

+
+ +
+ +
+

d) Other Income

+
+
+

{{other_income_value}}

+
+ +
+ +
+

e) Other Expenses

+
+
+

{{other_expense_value}}

+
+ +
+ +
+

f) Net Profit (c+d-e)

- -
- - - - - - - - - - -
Item{{salesItem.sales_item}} Qty/UOM{{salesItem.sales_qty }}/{{salesItem.uom_name }} Rate/Unit {{salesItem.rate_per_unit }} Frequency {{salesItem.frequency_name}} Annual Sale Value {{salesItem.annual_sale_value}}
-
-
-
- - - - Sales Calculate Month Wise - - - {{salesMonthWiseExpandedItems.length}}  Items - - - - - - - {{expandDetails.salesItem}} - -
- {{footer.month_message}}   {{footer.year_message}} -
- -
-
- - - -
- -

{{eachItem.header}}

- - - - - - - - - - - - - - - - -
Date{{itemValue.sales_date | date: 'dd-MM-yyyy'}} Total Amount{{itemValue.sales_value}} {{getTotalCost(eachItem.value)}}
-
- -
+
+
+

{{net_profit_value}}

+
+ + + +
+

g) Household Expenses

+ +
+
+

{{house_hold_value}}

+
+ +
+ +
+

h) Net Disposable Income (f-g)

+ + +
+
+

{{net_disable_income_value}}

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - Purchase Details - - - {{purchaseDetails.length}}  Items - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Item{{purchaseItem.purchase_item}} Qty/UOM{{purchaseItem.purchase_qty }}/{{purchaseItem.uom_name }} Rate/Unit {{purchaseItem.rate_per_unit }} Frequency {{purchaseItem.frequency_name}} Annual Purchase Value {{purchaseItem.annual_purchase_value}}
-
-
-
- - - - Business Expenses - - - {{businessExpenses.length}}  Items - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
Item {{businessEx.expense_item}} Value {{businessEx.expense_value }} Frequency {{businessEx.frequency_name}} Annual Expenses Value {{businessEx.annual_expenses_value}}
-
-
-
- - - - House Hold Expenses - - - {{houseHoldExpenses.length}}  Items - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
Item{{householdItem.expense_item}} Value{{householdItem.expense_value }}Frequency {{householdItem.frequency_name}} Annual Expenses Value {{householdItem.annual_expense_value}}
-
-
-
- - - - - -
-
- - - - -
-
-
-
-
-
-
Image 1
-
-
-
-
-
-
-
Image 2
-
-
-
-
-
-
-
Image 3
-
-
-
-
-
-
-
Image 2
-
-
-
-
-
-
-
Image 3
-
-
-
-
-
-
-
Image 1
-
-
-
-
-
- - - - - + +
+
+ + + + @@ -388,7 +243,7 @@
--> +
- - + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss index 294dc4fa9..71e617ab3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss @@ -3,35 +3,11 @@ overflow: auto; } -table { - width: 100%; -} - -tr.mat-footer-row { - font-weight: bold; -} - -.mat-table-sticky { - border-top: 1px solid #e0e0e0; -} ::ng-deep .cdk-global-overlay-wrapper{ justify-content: center !important; } - .mat-form-field { - width: 100%; - } - .expan_footer{ - font-size: 18px; - direction: rtl; - } - .expan_table_header { - font-size: 18px; - text-align: center; - } - .h4_font { - font-size: 18px; - } + .subtitle_message { color:#e00201 !important; } @@ -144,4 +120,21 @@ tr.mat-footer-row { border:1px solid rgba(0, 0, 0, 0.12); } + mat-list-item:nth-child(3) { + background-color: #f5f5f5; + } + mat-list-item:nth-child(6) { + background-color: #f5f5f5; + } + mat-list-item:nth-child(8) { + background-color: #f5f5f5; + } + .mat_list_right_div { + text-align: left; + } + .mat_list_center_div { + text-align: center; + } + + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts index f8a6e5b87..bdb939669 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts @@ -1,5 +1,4 @@ import {Component,OnInit,Inject,Input, ViewChild } from '@angular/core'; -import {FormBuilder,FormGroup,Validators,FormArray, FormControl,} from '@angular/forms'; import { NotifierService } from 'angular-notifier'; import { MatDialog, @@ -16,42 +15,65 @@ import { ActivatedRoute, Router } from "@angular/router"; styleUrls: ['./assessed-income.component.scss'] }) export class AssessedIncomeComponent implements OnInit { - public _assessedIncomeFormFrom: FormGroup; private notifier: NotifierService; pageTitle: string ="Assessed Income Details"; // @Input() pdid: number; // @Input() form_id: number; pdid: number; form_id: number; - salesCaluatedItemColumns: string[] = ['Item', 'Qty/UOM','Rate/Unit','Frequency','Annual Sale Value']; + displayedColumns = ['sno','list','amount']; + sales_value: number; + purchase_value: number; + gross_profit_value: number; + other_income_value: number; + other_expense_value: number; + net_profit_value: number; + house_hold_value: number; + net_disable_income_value: number; public salesCaluatedItem:any= []; - salesItemMonthWiseColumns: string[] = ['Item', 'Value','Frequency','Annual Expenses Value']; public salesItemMonthWise:any= []; - purchaseDetailsColumns: string[] = ['Item', 'Qty/UOM','Rate/Unit','Frequency','Annual Purchase Value']; public purchaseDetails:any= []; - businessExpensesColumns: string[] = ['Item', 'Value','Frequency','Annual Expenses Value']; public businessExpenses:any= []; - houseHoldExpensesColumns: string[] = ['Item', 'Value','Frequency','Annual Expenses Value']; public houseHoldExpenses:any= []; - - public salesMonthItemColumns = ['Date','Amount']; + public otherBusinessIncome: any=[]; // Sales Item MonthWise declare table header,body andd footer elements salesMonthWiseTable:any=[]; salesItemMonthWiseBody: any[]; salesItemMonthWiseFooter: any[]; - salesMonthWiseExpandedItems: any=[] - - constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, +public UOMList: any=[]; +public frequencyList: any=[]; +public businessExpenseList: any=[]; +public businessIncomeList: any=[]; +public grossProfitTypeList: any=[]; +public salesDeclaredCustomer: any=[]; +public getCustomValues:any = { UOMList: this.UOMList,frequencyList: this.frequencyList,businessExpenseList: this.businessExpenseList,businessIncomeList:this.businessIncomeList,pdid:'',grossProfitTypeList:this.grossProfitTypeList}; +//public finalData: any; + constructor(notifier: NotifierService, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.notifier = notifier; this.form_id = 16; + this.loadAIDetails(); + this.getAIMaster('UOM',1); + this.getAIMaster('FREQUENCY',2); + this.getAIMaster('BUSINESSEXPENSES',3); + this.getAIMaster('BUSINESSINCOME',4); + this.getCustomValues.pdid = this.pd_all_details.pdmaster_details.pd_id; + this.sales_value=0; + this.purchase_value=0; + this.gross_profit_value=0; + this.other_income_value=0; + this.other_expense_value=0; + this.net_profit_value=0; + this.house_hold_value=0; + this.net_disable_income_value=0; + } public viewerOptions: any = { navbar: false, @@ -73,19 +95,22 @@ public viewerOptions: any = { } }; ngOnInit() { - - this.initAssessedIncomeForm(); + + } + // load ai details + loadAIDetails(): void{ + this.salesMonthWiseExpandedItems=[] let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = this.form_id; this._pd.getAssessedIncomeFormDetails(params).subscribe(value => { if (value.status == 200) { - if(value.records.sales_declared_by_customer){ - this._assessedIncomeFormFrom.controls['sales_declared_by_customer'].setValue(value.records.sales_declared_by_customer[0].sales_declared_by_customer); + if(value.records.gross_profit_calculation_type){ + this.grossProfitTypeList = value.records.gross_profit_calculation_type; + this.getCustomValues.grossProfitTypeList=this.grossProfitTypeList; } - else{ - this._assessedIncomeFormFrom.controls['sales_declared_by_customer'].setValue(''); - + if(value.records.sales_declared_by_customer){ + this.salesDeclaredCustomer = value.records.sales_declared_by_customer; } if(value.records.sales_calculated_by_itemwise){ this.salesCaluatedItem = value.records.sales_calculated_by_itemwise; @@ -142,10 +167,8 @@ public viewerOptions: any = { // message: ' Yearly ' + itemElement.sales_item + ' Sales Arrived', // value: calculateAllItemsTotal * convertYear, // }) - this.salesMonthWiseExpandedItems.push({salesItem:itemElement.sales_item, expandElements:expandBodyContent, footerMessage: footerMessage}); + this.salesMonthWiseExpandedItems.push({sim_id:itemElement.sim_id,salesItem:itemElement.sales_item,margin_per:itemElement.margin_per,margin_value:itemElement.margin_value, expandElements:expandBodyContent, footerMessage: footerMessage}); }); - - } if(value.records.purchase_details){ this.purchaseDetails = value.records.purchase_details; @@ -156,6 +179,22 @@ public viewerOptions: any = { if(value.records.house_hold_expenses){ this.houseHoldExpenses = value.records.house_hold_expenses; } + if(value.records.othre_business_income){ + this.otherBusinessIncome = value.records.othre_business_income; + } + + if(value.records.final_data.length >0){ + // this.finalData = value.records.final_data[0]; + + this.sales_value = value.records.final_data[0].income.sales_revenue !='' && value.records.final_data[0].income.sales_revenue !=null ? value.records.final_data[0].income.sales_revenue : 0; + this.purchase_value = value.records.final_data[0].expense.purchase !='' && value.records.final_data[0].expense.purchase !=null ? value.records.final_data[0].expense.purchase : 0; + this.gross_profit_value = value.records.final_data[0].gross_profit !='' && value.records.final_data[0].gross_profit !=null ? value.records.final_data[0].gross_profit : 0; + this.other_income_value = value.records.final_data[0].income.other_business_income !='' && value.records.final_data[0].income.other_business_income !=null ? value.records.final_data[0].income.other_business_income : 0; + this.other_expense_value = value.records.final_data[0].expense.business_expense !='' && value.records.final_data[0].expense.business_expense !=null ? value.records.final_data[0].expense.business_expense : 0; + this.net_profit_value = value.records.final_data[0].expense.net_profit !='' && value.records.final_data[0].expense.net_profit !=null ? value.records.final_data[0].expense.net_profit : 0; + this.house_hold_value = 0; + this.net_disable_income_value = this.net_profit_value-this.house_hold_value; + } } }) @@ -166,14 +205,29 @@ public viewerOptions: any = { return getItems.map(t => t.sales_value).reduce((acc, value) => acc + Number(value), 0); } + // get common drop down list + getAIMaster(table:string, type:Number):void { + this._pd.getAllMasterDatas(table).subscribe( + data => { + if (data.dataStatus == true) { + if(type==1){ + this.UOMList = data.records.filter(uom=>uom.isactive==1); + this.getCustomValues.UOMList= this.UOMList; + } + if(type==2){ + this.frequencyList = data.records.filter(frq=>frq.isactive==1); + this.getCustomValues.frequencyList= this.frequencyList; + } + if(type==3) { + this.businessExpenseList = data.records.filter(val=>val.isactive==1); + this.getCustomValues.businessExpenseList= this.businessExpenseList; + } + if(type==4){ + this.businessIncomeList=data.records.filter(val=>val.isactive==1); + this.getCustomValues.businessIncomeList= this.businessIncomeList; - // Dynamic Form field creation - - public initAssessedIncomeForm(): void { - this._assessedIncomeFormFrom = this.fb.group({ - sales_declared_by_customer: ['', Validators.compose([Validators.required])], - // lender_representative_details: this.fb.array([]), + } + } }); -} - + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.html new file mode 100644 index 000000000..4aa869563 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.html @@ -0,0 +1,56 @@ + + +
+
+ Business Expense Items +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Buiness Expense {{element.expense_item}} Amount (Rs) {{element.expense_value}} Frequency {{element.frequency_name}} + Annual Expenses {{element.annual_expenses_value}} + + + +
+
+
+
+ + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.scss new file mode 100644 index 000000000..a464130a1 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.scss @@ -0,0 +1,30 @@ +.example-container { + max-height: 280px; + width: 100%; + overflow: auto; + margin-top: 2%; + } + + table { + width: 100%; + } + + td{ + padding-right: 2%; + padding-left: 2%; + white-space: nowrap; + } + + th { + padding-left: 2%; + padding-right: 2%; + white-space: nowrap; + } + + .mat-table-sticky:first-child { + border-right: 1px solid #e0e0e0; + } + + .mat-table-sticky:last-child { + border-left: 1px solid #e0e0e0; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.spec.ts new file mode 100644 index 000000000..3687bddfc --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BusinessExpenseDetailsComponent } from './business-expense-details.component'; + +describe('BusinessExpenseDetailsComponent', () => { + let component: BusinessExpenseDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BusinessExpenseDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BusinessExpenseDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.ts new file mode 100644 index 000000000..6b54e794f --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component.ts @@ -0,0 +1,88 @@ +import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter } from '@angular/core'; +import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material'; +import { ManageBusinesExpenseComponent } from './../AI-diologue/manage-busines-expense/manage-busines-expense.component'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-business-expense-details', + templateUrl: './business-expense-details.component.html', + styleUrls: ['./business-expense-details.component.scss'] +}) +export class BusinessExpenseDetailsComponent implements OnInit { + + displayedColumns = ['buiness_expense','expense_value','frequency','annual_expenses','action']; + public businessItemSource= new MatTableDataSource(); + @Input() parentData: any; + @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number}; + @Output() loadAssessedForms = new EventEmitter(); + private notifier: NotifierService; + constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) { + this.notifier= notifier; + } + + ngOnInit() { + } + + // add more item details + addMoreItem():void { + let passValues: any = { + manage_status:1, + masterData: this.masterData + } + const dialogRef = this.dialog.open(ManageBusinesExpenseComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); + +} +editExpenseItem(value:any) { + let passValues: any = { + manage_status:2, + masterData: this.masterData, + editData:value + } + const dialogRef = this.dialog.open(ManageBusinesExpenseComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); +} + +// remove expense item +removeExpenseItem(value: any) : void{ + + let deleteRecords: any =[{ + "fk_pd_id":this.masterData.pdid, + "pd_expense_id":value.pd_expense_id, + "isactive":false, + }]; + this._pd.saveAssessedDetails('saveAssessedIncomeBusinessExpenses',deleteRecords).subscribe(data => { + this.notifier.notify('success','Removed Successfully'); + this.loadAssessedForms.next('1'); +}, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); +}); +} + +// detect chnges from parent +ngOnChanges(changes: SimpleChanges) { + this.businessItemSource.data = changes.parentData.currentValue; +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html new file mode 100644 index 000000000..f0951717b --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html @@ -0,0 +1,69 @@ + + + +
+
+ Sales Calculate Daily Wise +
+
+ +
+
+ + + + {{expandDetails.salesItem}} + (Margin Percentage % : {{expandDetails.margin_per}}   Margin Value : {{expandDetails.margin_value}}) + + + +
+ {{footer.month_message}}   {{footer.year_message}} +
+
+
+ + + + +
+ +

{{eachItem.header}}

+ + + + + + + + + + + + + + + +
Date{{itemValue.sales_date | date: 'dd-MM-yyyy'}} Total Amount{{itemValue.sales_value}} {{getTotalCost(eachItem.value)}}
+
+ +
+ + + + + +
+
+
+ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss new file mode 100644 index 000000000..588f58a6b --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss @@ -0,0 +1,33 @@ +.example-container { + max-height: 500px; + overflow: auto; +} + +table { + width: 100%; +} + +tr.mat-footer-row { + font-weight: bold; +} + +.mat-table-sticky { + border-top: 1px solid #e0e0e0; +} + .expan_footer{ + font-size: 18px; + direction: rtl; +} +.expan_table_header { + font-size: 18px; + //text-align: center; +} +.h4_font { + font-size: 18px; +} +.subtitle_message { + color:#e00201 !important; +} +.delete-margin { + margin-left: 3%; + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.spec.ts new file mode 100644 index 000000000..b8081b9f6 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DailySalesDetailsComponent } from './daily-sales-details.component'; + +describe('DailySalesDetailsComponent', () => { + let component: DailySalesDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ DailySalesDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(DailySalesDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts new file mode 100644 index 000000000..a3aa5c5ba --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.ts @@ -0,0 +1,121 @@ +import { Component, OnInit, Input, Output, Inject, DoCheck, EventEmitter } from '@angular/core'; +import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material'; +import { ManageDailySalesComponent } from './../AI-diologue/manage-daily-sales/manage-daily-sales.component'; +import { NotifierService } from 'angular-notifier'; +import { AnyAaaaRecord } from 'dns'; + +@Component({ + selector: 'app-daily-sales-details', + templateUrl: './daily-sales-details.component.html', + styleUrls: ['./daily-sales-details.component.scss'] +}) +export class DailySalesDetailsComponent implements OnInit, DoCheck { + public salesMonthItemColumns = ['Date','Amount']; + public salesMonthWiseExpandedItems: any[]=[]; + @Input() parentData: any; + @Input() masterData: { UOMList: any; frequencyList: any; pdid:number, grossProfitTypeList:any}; + @Output() loadAssessedForms = new EventEmitter(); + activateMariginCalculation: boolean; + private notifier:NotifierService; + constructor(notifier:NotifierService, private _pd: PdTrigerService, private dialog: MatDialog) { + this.activateMariginCalculation=false; + this.notifier = notifier; + } + + ngOnInit() { + } + + // get total cost + getTotalCost(getItems:any) { + return getItems.map(t => t.sales_value).reduce((acc, value) => acc + Number(value), 0); + } + +// add more item details +addMoreItem():void { + let passValues: any = { + manage_status:1, + masterData: this.masterData, + margin_calculation_status:this.activateMariginCalculation, + } + const dialogRef = this.dialog.open(ManageDailySalesComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); + +} +editSalesItem(value:any) { + let transformData: any = value.expandElements.map(val=>val.value); + transformData = [].concat.apply([], transformData); + let editValue: any = { + "fk_pd_id":this.masterData.pdid, + "sim_id":value.sim_id, + "salesItem":value.salesItem, + "margin_value":value.margin_value, + "margin_per":value.margin_per, + "values":transformData + } + let passValues: any = { + manage_status:2, + masterData: this.masterData, + editData:editValue, + margin_calculation_status:this.activateMariginCalculation, + } + const dialogRef = this.dialog.open(ManageDailySalesComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); +} + +// remove sales item +removeSalesItem(value: any) : void{ + // let transformData: any = value.expandElements.map(val=>val.value); + // transformData = [].concat.apply([], transformData); + let deleteRecords: any =[{ + "sim_id":value.sim_id, + "isactive":false, + "child":[] + }]; + this._pd.saveAssessedDetails('saveAssessedIncomeMonthwiseItems',deleteRecords).subscribe(data => { + this.notifier.notify('success','Removed Successfully'); + this.loadAssessedForms.next('1'); +}, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); +}); +} + +// do check component bases +ngDoCheck() { + this.salesMonthWiseExpandedItems = this.parentData; + + 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; + }} + + // detect chnges from parent +// ngOnChanges(changes: SimpleChanges) { +// this.salesMonthWiseExpandedItems = changes.parentData.currentValue; +// 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; +// } +// } +// } + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html new file mode 100644 index 000000000..42dd4466c --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html @@ -0,0 +1,26 @@ +
+ + + + + + + + + {{getData.name}} + + + + + {{getSale.name}} + + + + + + + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.scss new file mode 100644 index 000000000..b559b3c47 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.scss @@ -0,0 +1,3 @@ +mat-form-field { + margin: 0 2%; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.spec.ts new file mode 100644 index 000000000..d9b770dc8 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { GrossProfitCalculationComponent } from './gross-profit-calculation.component'; + +describe('GrossProfitCalculationComponent', () => { + let component: GrossProfitCalculationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ GrossProfitCalculationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(GrossProfitCalculationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts new file mode 100644 index 000000000..b9f81139f --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts @@ -0,0 +1,79 @@ +import { Component, OnInit, Input, Output, Inject,EventEmitter, OnChanges, SimpleChanges } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-gross-profit-calculation', + templateUrl: './gross-profit-calculation.component.html', + styleUrls: ['./gross-profit-calculation.component.scss'] +}) +export class GrossProfitCalculationComponent implements OnInit, OnChanges { + @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number}; + @Input() parentData: any; + @Output() loadAssessedForms = new EventEmitter(); + public grossProfitForm: FormGroup; + check__purchse_type:any=[{'id':'1','name':'Yes'},{'id':'2','name':'No'}] + check_sales_type:any=[{'id':'1','name':'Gross Margin'},{'id':'2','name':'Net Margin'}] + private notifier: NotifierService; + constructor(notifier: NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService) { + this.notifier = notifier; + } + + ngOnInit() { + + } + changeOptions(values: any){ + this.grossProfitForm.controls['margin'].setValue(''); + } + submitDetails(records: any){ + if (this.grossProfitForm.invalid) { + this.validateAllFormFields(this.grossProfitForm); + this.notifier.notify('warning',"Please Check All Manatory Fields.."); + return; + } + this._pd.saveAssessedDetails('saveAssessedIncomeCalculateMode',records).subscribe(data => { + this.notifier.notify('success','Saved Successfully.'); + this.loadAssessedForms.next('1'); + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.loadAssessedForms.next('1'); + }); + } + + // detect chnges from parent +ngOnChanges(changes: SimpleChanges) { + if(changes.parentData.currentValue.length>0){ + this.grossProfitForm = this._fb.group( + { + calc_type_id:[changes.parentData.currentValue[0].calc_type_id], + fk_pd_id:[this.masterData.pdid], + mode:[changes.parentData.currentValue[0].mode,Validators.compose([Validators.required])], + margin:[changes.parentData.currentValue[0].margin], + }) + } + else { + this.grossProfitForm = this._fb.group( + { + calc_type_id:[''], + fk_pd_id:[this.masterData.pdid], + mode:['',Validators.compose([Validators.required])], + margin:[''], + }) + } +} + +// validate all form group and form array fields +validateAllFormFields(formGroup: any) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } else if (control instanceof FormArray) { + this.validateAllFormFields(control); + } + }); +} +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.html new file mode 100644 index 000000000..031f03552 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.html @@ -0,0 +1,57 @@ + + +
+
+ House Hold Items +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Expense Particulars {{element.expense_item}} Amount (Rs) {{element.expense_value}} Frequency {{element.frequency_name}} + Annual Expenses {{element.annual_expense_value}} + + + +
+
+
+
+ + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.scss new file mode 100644 index 000000000..a464130a1 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.scss @@ -0,0 +1,30 @@ +.example-container { + max-height: 280px; + width: 100%; + overflow: auto; + margin-top: 2%; + } + + table { + width: 100%; + } + + td{ + padding-right: 2%; + padding-left: 2%; + white-space: nowrap; + } + + th { + padding-left: 2%; + padding-right: 2%; + white-space: nowrap; + } + + .mat-table-sticky:first-child { + border-right: 1px solid #e0e0e0; + } + + .mat-table-sticky:last-child { + border-left: 1px solid #e0e0e0; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.spec.ts new file mode 100644 index 000000000..a2d07f83b --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HouseHoldDetailsComponent } from './house-hold-details.component'; + +describe('HouseHoldDetailsComponent', () => { + let component: HouseHoldDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HouseHoldDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HouseHoldDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.ts new file mode 100644 index 000000000..1a168c080 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component.ts @@ -0,0 +1,90 @@ +import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter } from '@angular/core'; +import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material'; +import { ManageHouseHoldComponent } from './../AI-diologue/manage-house-hold/manage-house-hold.component'; +import { NotifierService } from 'angular-notifier'; + + +@Component({ + selector: 'app-house-hold-details', + templateUrl: './house-hold-details.component.html', + styleUrls: ['./house-hold-details.component.scss'] +}) +export class HouseHoldDetailsComponent implements OnInit { + + displayedColumns = ['buiness_particulars','expense_value','frequency','annual_expenses','action']; + public houseItemSource= new MatTableDataSource(); + @Input() parentData: any; + @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number}; + @Output() loadAssessedForms = new EventEmitter(); + private notifier: NotifierService; + constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) { + this.notifier= notifier; + } + + ngOnInit() { + } + + // add more item details + addMoreItem():void { + let passValues: any = { + manage_status:1, + masterData: this.masterData + } + const dialogRef = this.dialog.open(ManageHouseHoldComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); + +} +editHouseItem(value:any) { + let passValues: any = { + manage_status:2, + masterData: this.masterData, + editData:value + } + const dialogRef = this.dialog.open(ManageHouseHoldComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); +} + +// remove house item +removeHouseItem(value: any) : void{ + + let deleteRecords: any =[{ + "fk_pd_id":this.masterData.pdid, + "household_expense_id":value.household_expense_id, + "isactive":false, + }]; + this._pd.saveAssessedDetails('saveAssessedIncomeHouseholdExpenses',deleteRecords).subscribe(data => { + this.notifier.notify('success','Removed Successfully'); + this.loadAssessedForms.next('1'); +}, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); +}); +} + + +// detect chnges from parent +ngOnChanges(changes: SimpleChanges) { + this.houseItemSource.data = changes.parentData.currentValue; +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html new file mode 100644 index 000000000..49e26601d --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html @@ -0,0 +1,55 @@ + + +
+
+ Other Business Income Items +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Buiness Income {{element.business_income_item}} Amount (Rs) {{element.income_value}} Frequency {{element.frequency_name}} + Annual Income {{element.annual_income_value}} + + + +
+
+
+
+ + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.scss new file mode 100644 index 000000000..a464130a1 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.scss @@ -0,0 +1,30 @@ +.example-container { + max-height: 280px; + width: 100%; + overflow: auto; + margin-top: 2%; + } + + table { + width: 100%; + } + + td{ + padding-right: 2%; + padding-left: 2%; + white-space: nowrap; + } + + th { + padding-left: 2%; + padding-right: 2%; + white-space: nowrap; + } + + .mat-table-sticky:first-child { + border-right: 1px solid #e0e0e0; + } + + .mat-table-sticky:last-child { + border-left: 1px solid #e0e0e0; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.spec.ts new file mode 100644 index 000000000..dc12132a1 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { OtherBusinessIncomeDetailsComponent } from './other-business-income-details.component'; + +describe('OtherBusinessIncomeDetailsComponent', () => { + let component: OtherBusinessIncomeDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ OtherBusinessIncomeDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(OtherBusinessIncomeDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.ts new file mode 100644 index 000000000..f7dd09c2a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.ts @@ -0,0 +1,87 @@ +import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter } from '@angular/core'; +import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material'; +import { ManageOtherBusinessIncomeComponent } from './../AI-diologue/manage-other-business-income/manage-other-business-income.component'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-other-business-income-details', + templateUrl: './other-business-income-details.component.html', + styleUrls: ['./other-business-income-details.component.scss'] +}) +export class OtherBusinessIncomeDetailsComponent implements OnInit { + + displayedColumns = ['buiness_income','income_value','frequency','annual_income','action']; + public businessIncomeItemSource= new MatTableDataSource(); + @Input() parentData: any; + @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any; pdid:number}; + @Output() loadAssessedForms = new EventEmitter(); + private notifier: NotifierService; + constructor(notifier: NotifierService, private _pd: PdTrigerService, private dialog: MatDialog) { + this.notifier=notifier; + } + + ngOnInit() { + } + + // add more item details + addMoreItem():void { + let passValues: any = { + manage_status:1, + masterData: this.masterData + } + const dialogRef = this.dialog.open(ManageOtherBusinessIncomeComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); + +} +editIncomeItem(value:any) { + let passValues: any = { + manage_status:2, + masterData: this.masterData, + editData:value + } + const dialogRef = this.dialog.open(ManageOtherBusinessIncomeComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); +} +// remove income item +removeIncomeItem(value: any) : void{ + + let deleteRecords: any =[{ + "fk_pd_id":this.masterData.pdid, + "pd_business_income_id":value.pd_business_income_id, + "isactive":false, + }]; + this._pd.saveAssessedDetails('saveOtherBusinessIncome',deleteRecords).subscribe(data => { + this.notifier.notify('success','Removed Successfully'); + this.loadAssessedForms.next('1'); +}, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); +}); +} + +// detect chnges from parent +ngOnChanges(changes: SimpleChanges) { + this.businessIncomeItemSource.data = changes.parentData.currentValue; +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.html new file mode 100644 index 000000000..766e42c2d --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.html @@ -0,0 +1,68 @@ + + +
+
+ Purchase Item +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Raw Material/Trading Item {{element.purchase_item}} Purchase Quantity {{element.purchase_qty}} UOM {{element.uom_name}} Rate/Unit of Purchase {{element.rate_per_unit}} Frequency {{element.frequency_name}} + Annual Purchase {{element.annual_purchase_value}} + + + +
+
+
+ + Purchase Item is Not Available.. + +
+ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.scss new file mode 100644 index 000000000..a464130a1 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.scss @@ -0,0 +1,30 @@ +.example-container { + max-height: 280px; + width: 100%; + overflow: auto; + margin-top: 2%; + } + + table { + width: 100%; + } + + td{ + padding-right: 2%; + padding-left: 2%; + white-space: nowrap; + } + + th { + padding-left: 2%; + padding-right: 2%; + white-space: nowrap; + } + + .mat-table-sticky:first-child { + border-right: 1px solid #e0e0e0; + } + + .mat-table-sticky:last-child { + border-left: 1px solid #e0e0e0; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.spec.ts new file mode 100644 index 000000000..cf25e93a8 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PurchaseDetailsComponent } from './purchase-details.component'; + +describe('PurchaseDetailsComponent', () => { + let component: PurchaseDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PurchaseDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PurchaseDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.ts new file mode 100644 index 000000000..bb5475978 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component.ts @@ -0,0 +1,100 @@ +import { Component, OnInit, Input, Output, Inject, DoCheck, EventEmitter } from '@angular/core'; +import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material'; +import { ManagePurchaseComponent } from './../AI-diologue/manage-purchase/manage-purchase.component'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-purchase-details', + templateUrl: './purchase-details.component.html', + styleUrls: ['./purchase-details.component.scss'] +}) +export class PurchaseDetailsComponent implements OnInit, DoCheck { + displayedColumns = ['raw_material','purchase_quantity','UOM','rate_per_unit_purchase','frequency','annual_purchase','action']; + public purchaseItemSource= new MatTableDataSource(); + activateMariginCalculation:boolean; + private notifier: NotifierService; + @Input() parentData: any; + @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any,businessIncomeList: any, pdid:number, grossProfitTypeList:any}; + @Output() loadAssessedForms = new EventEmitter(); + constructor(notifier: NotifierService,private _pd: PdTrigerService, private dialog: MatDialog) { + this.activateMariginCalculation=false; + this.notifier = notifier; + } + + ngOnInit() { + } + + // add more item details + addMoreItem():void { + let passValues: any = { + manage_status:1, + masterData: this.masterData + } + const dialogRef = this.dialog.open(ManagePurchaseComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); + +} +editPurchaseItem(value:any) { + let passValues: any = { + manage_status:2, + masterData: this.masterData, + editData:value + } + const dialogRef = this.dialog.open(ManagePurchaseComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); +} +// remove purchase item +removePurchaseItem(value: any) : void{ + + let deleteRecords: any =[{ + "fk_pd_id":this.masterData.pdid, + "purchase_id":value.purchase_id, + "isactive":false, + }]; + this._pd.saveAssessedDetails('saveAssessedIncomePurchaseDetails',deleteRecords).subscribe(data => { + this.notifier.notify('success','Removed Successfully'); + this.loadAssessedForms.next('1'); +}, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); +}); +} + +// do check component bases +ngDoCheck() { + if(this.masterData.grossProfitTypeList.length>0){ + this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==1 ? true : false; + } + this.purchaseItemSource.data = this.parentData; +} + +// detect chnges from parent +// ngOnChanges(changes: SimpleChanges) { +// if(changes.masterData){ +// if(changes.masterData.currentValue.grossProfitTypeList.length>0){ +// this.activateMariginCalculation = changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode==1 ? true : false; +// } +// } +// this.purchaseItemSource.data = changes.parentData.currentValue; +// } +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html new file mode 100644 index 000000000..9d54b4f61 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html @@ -0,0 +1,21 @@ +
+ + + + Sales Calculation + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.scss new file mode 100644 index 000000000..b559b3c47 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.scss @@ -0,0 +1,3 @@ +mat-form-field { + margin: 0 2%; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.spec.ts new file mode 100644 index 000000000..cdc8420d0 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SalesCalculationComponent } from './sales-calculation.component'; + +describe('SalesCalculationComponent', () => { + let component: SalesCalculationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SalesCalculationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SalesCalculationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts new file mode 100644 index 000000000..05e271ac8 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts @@ -0,0 +1,102 @@ +import { Component, OnInit, Input, Output, Inject, EventEmitter, DoCheck, OnChanges, SimpleChanges } from '@angular/core'; +import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; +import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-sales-calculation', + templateUrl: './sales-calculation.component.html', + styleUrls: ['./sales-calculation.component.scss'] +}) +export class SalesCalculationComponent implements OnInit, OnChanges, DoCheck { + @Input() parentData: any; + @Input() masterData: { pdid:number,grossProfitTypeList:any}; + @Output() loadAssessedForms = new EventEmitter(); + salesCalculationForm:FormGroup; + activateMariginCalculation: boolean; + private notifier: NotifierService; + constructor(notifier:NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService) { + this.activateMariginCalculation=false; + this.notifier = notifier; + } + + ngOnInit() { + } + salesCalculation(values): void { + if(values.margin_per !='' && values.sales_declared_by_customer !='') + { + this.salesCalculationForm.controls['margin_value'].setValue(values.sales_declared_by_customer * (values.margin_per/100)); + } + } + // save sales calculations details +submitDetails(records) { + if (this.salesCalculationForm.invalid) { + this.validateAllFormFields(this.salesCalculationForm); + this.notifier.notify('warning',"Please Check All Manatory Fields.."); + return; + } + this._pd.saveAssessedDetails('saveAssessedIncomeSalesDeclaredByCustomer',records).subscribe(data => { + this.notifier.notify('success', 'Saved Successfully.'); + this.loadAssessedForms.next('1'); + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.loadAssessedForms.next('1'); + }); +} + +// validate all form group and form array fields +validateAllFormFields(formGroup: any) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } else if (control instanceof FormArray) { + this.validateAllFormFields(control); + } + }); +} + +// do check component bases +ngDoCheck() { + + 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; + } + this.activateMariginCalculation===true ? this.salesCalculationForm.controls['margin_per'].setValidators([Validators.required]) : this.salesCalculationForm.controls['margin_per'].clearValidators(); + this.salesCalculationForm.controls['margin_per'].updateValueAndValidity(); + +} + + //detect chnges from parent +ngOnChanges(changes: SimpleChanges) { + 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; + } + } + if(changes.parentData){ + if(changes.parentData.currentValue.length>0){ + 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])], + fk_pd_id:[this.masterData.pdid], + margin_per:[this.activateMariginCalculation===false ? '' : changes.parentData.currentValue[changes.parentData.currentValue.length-1].margin_per,this.activateMariginCalculation===true ? Validators.required: Validators.nullValidator], + margin_value:[this.activateMariginCalculation==false ? '' : changes.parentData.currentValue[changes.parentData.currentValue.length-1].margin_value], + }); + } + else { + this.salesCalculationForm = this._fb.group({ + sdc_id:[''], + sales_declared_by_customer:['', Validators.required], + fk_pd_id:[this.masterData.pdid], + margin_per:['',this.activateMariginCalculation===true ? Validators.required: Validators.nullValidator], + margin_value:[''], + }); + } + } + + } + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.html new file mode 100644 index 000000000..bc1f00af6 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.html @@ -0,0 +1,86 @@ + + + +
+
+ Sales Calculate Item Wise +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Product/Services {{element.sales_item}} Sale Quantity {{element.sales_qty}} UOM {{element.uom_name}} Rate/Unit of Sale {{element.rate_per_unit}} Frequency {{element.frequency_name}} + Annual Sales {{element.annual_sale_value}} + Margin Percentage % {{element.margin_per}} + Margin Amount {{element.margin_per_uom}} + Final Value {{element.margin_final_value}} + + + +
+
+
+ +
+ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.scss new file mode 100644 index 000000000..f78501e65 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.scss @@ -0,0 +1,30 @@ +.example-container { + max-height: 300px; + width: 100%; + overflow: auto; + margin-top: 2%; + } + + table { + width: 100%; + } + + td{ + padding-right: 2%; + padding-left: 2%; + white-space: nowrap; + } + + th { + padding-left: 2%; + padding-right: 2%; + white-space: nowrap; + } + + .mat-table-sticky:first-child { + border-right: 1px solid #e0e0e0; + } + + .mat-table-sticky:last-child { + border-left: 1px solid #e0e0e0; + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.spec.ts new file mode 100644 index 000000000..00a6abb8a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SalesDetailsComponent } from './sales-details.component'; + +describe('SalesDetailsComponent', () => { + let component: SalesDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SalesDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SalesDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.ts new file mode 100644 index 000000000..79171bfa0 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component.ts @@ -0,0 +1,119 @@ +import { Component, OnInit, Input, Output, Inject, OnChanges,SimpleChanges, EventEmitter, DoCheck } from '@angular/core'; +import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material'; +import { ManageSalesComponent } from './../AI-diologue/manage-sales/manage-sales.component'; +import { NotifierService } from 'angular-notifier'; + +@Component({ + selector: 'app-sales-details', + templateUrl: './sales-details.component.html', + styleUrls: ['./sales-details.component.scss'] +}) +export class SalesDetailsComponent implements OnInit, DoCheck { + displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','action']; + public salesItemSource= new MatTableDataSource(); + @Input() parentData: any; + @Input() masterData: { UOMList: any; frequencyList: any;businessExpenseList:any,businessIncomeList: any, pdid:number, grossProfitTypeList:any}; + @Output() loadAssessedForms = new EventEmitter(); + activateMariginCalculation: boolean; + private notifier :NotifierService + constructor(notifier:NotifierService, private _pd: PdTrigerService, private dialog: MatDialog) { + this.activateMariginCalculation=false; + this.notifier = notifier; + } + + ngOnInit() { + } + +// add more item details +addMoreItem():void { + let passValues: any = { + manage_status:1, + masterData: this.masterData, + margin_calculation_status:this.activateMariginCalculation, + } + const dialogRef = this.dialog.open(ManageSalesComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); + +} +editSalesItem(value:any) { + let passValues: any = { + manage_status:2, + masterData: this.masterData, + editData:value, + margin_calculation_status:this.activateMariginCalculation, + + } + const dialogRef = this.dialog.open(ManageSalesComponent, { + data: passValues, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadAssessedForms.next('1'); + } + }); +} + +// remove sales item +removeSalesItem(value: any) : void{ + + let deleteRecords: any =[{ + "fk_pd_id":this.masterData.pdid, + "sci_id":value.sci_id, + "isactive":false, + }]; + this._pd.saveAssessedDetails('saveAssessedIncomeSalesCalculatedByItemwise',deleteRecords).subscribe(data => { + this.notifier.notify('success','Removed Successfully'); + this.loadAssessedForms.next('1'); +}, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); +}); +} + +// do check component bases +ngDoCheck() { + this.salesItemSource.data = this.parentData; + + 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; + if(this.activateMariginCalculation===true){ + this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','margin_percentage','margin_amount','final_value','action']; + } + else { + this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','action']; + + } + }} + +// detect chnges from parent +// ngOnChanges(changes: SimpleChanges) { +// this.salesItemSource.data = changes.parentData.currentValue; +// 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; +// if(this.activateMariginCalculation===true){ +// this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','margin_percentage','margin_amount','final_value','action']; +// } +// else { +// this.displayedColumns = ['product_services','sale_quantity','UOM','rate_per_unit_sale','frequency','annual_sales','action']; + +// } +// } +// } +// } + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index b84c413de..0d4c8b595 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -91,9 +91,23 @@ import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.compo import { SharedModule } from "app/shared/shared.module"; import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component'; import { SearchRelationPipe } from './../pd-pipes/search-relation.pipe'; +import { DeleteRecordsCountPipe } from './../pd-pipes/delete-records-count.pipe'; import { BusinessAssetsInfoComponent } from './list-pd/start-pd/forms/business-assets-info/business-assets-info.component'; import { BusinessBankingDetailsComponent } from './list-pd/start-pd/forms/business-banking-details/business-banking-details.component'; - +import { SalesDetailsComponent } from './list-pd/start-pd/forms/assessed-income/sales-details/sales-details.component'; +import { DailySalesDetailsComponent } from './list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component'; +import { SalesCalculationComponent } from './list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component'; +import { ManageSalesComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-sales/manage-sales.component'; +import { PurchaseDetailsComponent } from './list-pd/start-pd/forms/assessed-income/purchase-details/purchase-details.component'; +import { BusinessExpenseDetailsComponent } from './list-pd/start-pd/forms/assessed-income/business-expense-details/business-expense-details.component'; +import { HouseHoldDetailsComponent } from './list-pd/start-pd/forms/assessed-income/house-hold-details/house-hold-details.component'; +import { OtherBusinessIncomeDetailsComponent } from './list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component'; +import { ManagePurchaseComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-purchase/manage-purchase.component'; +import { ManageBusinesExpenseComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component'; +import { ManageHouseHoldComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-house-hold/manage-house-hold.component'; +import { ManageOtherBusinessIncomeComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component'; +import { GrossProfitCalculationComponent } from './list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component'; +import { ManageDailySalesComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component'; /** * Custom angular notifier options */ @@ -270,7 +284,7 @@ const pdCustomNotifierOptions: NotifierOptions = { // AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule, // OwlNativeDateTimeModule, // ], - declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent], + declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent], // exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent], // providers: [PdTrigerService, GetGeometricLocationService], @@ -308,13 +322,13 @@ const pdCustomNotifierOptions: NotifierOptions = { OwlNativeDateTimeModule, ], // declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent], - exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent], + exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent], providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}], entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent, - ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent], + ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent], }) export class ManagePdModule { diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.spec.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.spec.ts new file mode 100644 index 000000000..c729fa4fe --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.spec.ts @@ -0,0 +1,8 @@ +import { DeleteRecordsCountPipe } from './delete-records-count.pipe'; + +describe('DeleteRecordsCountPipe', () => { + it('create an instance', () => { + const pipe = new DeleteRecordsCountPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.ts new file mode 100644 index 000000000..c41f3c7ee --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/pd-pipes/delete-records-count.pipe.ts @@ -0,0 +1,18 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'deleteRecordsCount' +}) +export class DeleteRecordsCountPipe implements PipeTransform { + + transform(value: any): any { + if(value.length>0){ + let filterData = value.filter(val=>val.isactive===true); + return filterData.length; + } + else { + return 0; + } + } + +} diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 6ac7bb7ef..057387d01 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -557,6 +557,15 @@ export class PdTrigerService { catchError(this.handleError('role', [])) ) } + + // save assessed sales item wise + saveAssessedDetails(methodURl: string,saveData:any){ + //saveData.createdby = this._aws.getlocale(); + return this._http.post(this.apiUrl + methodURl, { "records": saveData }) + .pipe( + catchError(this.handleError('operation', [])) + ) + } } diff --git a/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts b/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts index 41ecee292..8149f4af5 100755 --- a/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts +++ b/ng6-seed/src/app/personal-discussion/personal-discussion.module.ts @@ -1,7 +1,6 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; - import { CKEditorModule } from 'ng2-ckeditor'; import { PdfViewerModule } from 'ng2-pdf-viewer'; import { diff --git a/ng6-seed/src/app/shared/numbers-only/numbers-only.directive.ts b/ng6-seed/src/app/shared/numbers-only/numbers-only.directive.ts new file mode 100644 index 000000000..cc1db71f5 --- /dev/null +++ b/ng6-seed/src/app/shared/numbers-only/numbers-only.directive.ts @@ -0,0 +1,31 @@ +import { Directive, ElementRef, HostListener, Input } from '@angular/core'; + +@Directive({ + selector: '[OnlyNumber]' +}) +export class NumbersOnlyDirective { + + // Allow decimal numbers. The \. is only allowed once to occur + private regex: RegExp = new RegExp(/^[0-9]+(\.[0-9]*){0,1}$/g); + + // Allow key codes for special events. Reflect : + // Backspace, tab, end, home + private specialKeys: Array = [ 'Backspace', 'Tab', 'End', 'Home' ]; + + constructor(private el: ElementRef) { + } + + @HostListener('keydown', [ '$event' ]) + onKeyDown(event: KeyboardEvent) { + // Allow Backspace, tab, end, and home keys + if (this.specialKeys.indexOf(event.key) !== -1) { + return; + } + + let current: string = this.el.nativeElement.value; + let next: string = current.concat(event.key); + if (next && !String(next).match(this.regex)) { + event.preventDefault(); + } + } +} \ No newline at end of file diff --git a/ng6-seed/src/app/shared/shared.module.ts b/ng6-seed/src/app/shared/shared.module.ts index cc6a4cb68..7ec2767bd 100755 --- a/ng6-seed/src/app/shared/shared.module.ts +++ b/ng6-seed/src/app/shared/shared.module.ts @@ -5,6 +5,7 @@ import { HorizontalMenuItems } from './menu-items/horizontal-menu-items'; import { AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective } from './accordion'; import { ToggleFullscreenDirective } from './fullscreen/toggle-fullscreen.directive'; import { RatingComponent} from './rating/rating.component'; +import { NumbersOnlyDirective } from './numbers-only/numbers-only.directive'; @NgModule({ declarations: [ @@ -12,14 +13,16 @@ import { RatingComponent} from './rating/rating.component'; AccordionLinkDirective, AccordionDirective, ToggleFullscreenDirective, - RatingComponent + RatingComponent, + NumbersOnlyDirective ], exports: [ AccordionAnchorDirective, AccordionLinkDirective, AccordionDirective, ToggleFullscreenDirective, - RatingComponent + RatingComponent, + NumbersOnlyDirective ], providers: [ MenuItems, HorizontalMenuItems ] }) From d0792f3482de6e0c0ce77df404469af66a1c748a Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 4 Feb 2019 18:12:03 +0530 Subject: [PATCH 4/6] merge : kms --- .../list-pd/add-pd/add-pd.component.html | 3 +- .../list-pd/add-pd/add-pd.component.ts | 22 +- .../edit-pd-applicant.component.ts | 73 ++- .../edit-pd-master.component.html | 5 + .../edit-pd-master.component.ts | 14 +- .../forms/address/address.component.html | 4 +- .../forms/address/address.component.ts | 7 +- .../assets-info/assets-info.component.html | 14 +- .../banking-details.component.html | 13 +- .../banking-details.component.ts | 16 +- .../business-assets-info.component.html | 37 +- .../business-assets-info.component.scss | 9 +- .../business-assets-info.component.spec.ts | 0 .../business-assets-info.component.ts | 32 +- .../business-banking-details.component.html | 2 +- .../business-banking-details.component.scss | 0 ...business-banking-details.component.spec.ts | 0 .../business-banking-details.component.ts | 1 + .../business-info-group.component.html | 0 .../business-info-group.component.scss | 0 .../business-info-group.component.spec.ts | 0 .../business-info-group.component.ts | 2 +- .../business-info.component.html | 210 ++++--- .../business-info/business-info.component.ts | 220 ++++++- .../client-info/client-info.component.html | 69 ++- .../client-info/client-info.component.ts | 22 +- .../current-loan/current-loan.component.html | 16 +- .../current-loan/current-loan.component.ts | 150 +++-- .../other-applicant-details.component.html | 9 +- .../other-applicant-details.component.ts | 64 +- .../family-details.component.html | 45 +- .../family-details.component.ts | 42 +- .../final-remarks.component.html | 24 +- .../final-remarks/final-remarks.component.ts | 8 + .../financial-info.component.html | 113 ++-- .../financial-info.component.ts | 570 ++++++++---------- .../general-info/general-info.component.html | 21 +- .../general-info/general-info.component.scss | 0 .../general-info.component.spec.ts | 0 .../general-info/general-info.component.ts | 38 +- .../loan-details/loan-details.component.html | 35 +- .../loan-details/loan-details.component.scss | 6 + .../loan-details/loan-details.component.ts | 52 +- .../neighbour-hood.component.html | 5 +- .../neighbour-hood.component.ts | 4 +- .../other-income/other-income.component.html | 4 +- .../rental-info/rental-info.component.html | 10 +- .../start-pd/forms/stock/stock.component.html | 276 +-------- .../start-pd/forms/stock/stock.component.ts | 474 ++++----------- .../supplier-info.component.html | 51 +- .../supplier-info/supplier-info.component.ts | 22 +- .../list-pd/start-pd/start-pd.component.html | 1 + .../list-pd/view-pd/view-pd.component.html | 4 +- .../list-pd/view-pd/view-pd.component.ts | 1 + .../pd-pipes/search-relation.pipe.spec.ts | 0 .../pd-pipes/search-relation.pipe.ts | 0 .../entity-edit-list-tat.component.html | 0 57 files changed, 1463 insertions(+), 1357 deletions(-) mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.scss mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.ts mode change 100644 => 100755 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-list-tat.component.html diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 84726cfcf..53af6fa0f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -178,7 +178,8 @@ - + + Enter Valid Pincode. diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index f69ffd8e8..25d14d8da 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -95,7 +95,7 @@ export class AddPdComponent implements OnInit, OnDestroy { fk_city: [null], fk_state: [null],   pincode : [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ - other_pincode:[null], + other_pincode:[null,Validators.compose([Validators.minLength(6),Validators.maxLength(6)])], remarks:[null],   // allocation_type: [null],   // sub_allocation_type: [null], @@ -168,6 +168,7 @@ export class AddPdComponent implements OnInit, OnDestroy { this.subProductList= this.productList.filter(item => item.product_id == productID); this.subProductList=this.subProductList[0].subproducts; + this.subProductList = this.subProductList.filter(item => item.is_others == 0); } // get city list details based on state id @@ -209,8 +210,9 @@ export class AddPdComponent implements OnInit, OnDestroy { data => { if (data.status == 200) { this.titleList=data.records.filter(val=>val.isactive==1); - let index1 = this.titleList.map(data => data.name).indexOf("Master"); - this.titleList.splice(index1, 1); + // console.log(this.titleList); + // let index1 = this.titleList.map(data => data.name).indexOf("Master"); + // this.titleList.splice(index1, 1); } }, error => this.errorMessage = error); @@ -413,7 +415,6 @@ export class AddPdComponent implements OnInit, OnDestroy { // common function for both draft and process pd submitPdDetails(formValue: any, status:string) { - if(this._PDtriggerForm.invalid) { this.validateAllFormFields(this._PDtriggerForm); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); @@ -428,12 +429,20 @@ export class AddPdComponent implements OnInit, OnDestroy { 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; } else{ concat_landline = null; } + + if(formValue.applicant_stdcode != null || formValue.applicant_landline != null){ + concat_landline1 = formValue.applicant_stdcode +'-'+formValue.applicant_landline; + } + else{ + concat_landline1 = null; + } let pd_details:any={ "fk_lender_id":formValue.fk_lender_id, @@ -450,7 +459,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "addressline1":formValue.addressline1, "fk_city":formValue.fk_city, "fk_state":formValue.fk_state, - "pincode":formValue.pincode , + "pincode":formValue.pincode, "other_pincode":formValue.other_pincode , "remarks":formValue.remarks, "pd_status": status, @@ -463,7 +472,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "applicant_title_name":formValue.applicant_title_name, "company_name":formValue.company_name, "mobile_no":formValue.mobile_no, - "landline":formValue.applicant_stdcode +'-'+formValue.applicant_landline, + "landline":concat_landline1 , "applicant_type":1, "relation":"", }); @@ -501,6 +510,7 @@ export class AddPdComponent implements OnInit, OnDestroy { if(pd_applicant_details.length>0){ pd_form.append("pd_applicant_details",JSON.stringify(pd_applicant_details)) } + pd_form.append("pd_document_titles",JSON.stringify(AllFilesObj)) if(formValue.addtional_requirements.length > 0){ pd_form.append("addtional_requirements",JSON.stringify(formValue.addtional_requirements)) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts index bc278b693..881ab4dd7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts @@ -55,9 +55,17 @@ export class EditPdApplicantComponent implements OnInit { } loadApplicantFormData() { - let stdcodesearch = this.mainApplicantData[0].landline.search("-"); - let stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch); - let landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8); + let stdcode; + let landline; + if(this.mainApplicantData[0].landline != null){ + let stdcodesearch = this.mainApplicantData[0].landline.search("-"); + stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch) ; + landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8) ; + }else{ + stdcode = ''; + landline = ''; + } + this._EditApplicantForm = this._fb.group({ fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])], @@ -79,17 +87,17 @@ export class EditPdApplicantComponent implements OnInit { } createItem(listData): FormGroup { + console.log('listData',listData); if(listData){ let stdcode; let landline; if(listData.landline != null){ - let stdcodesearch = listData.landline.search("-"); - stdcode = listData.landline.substr(0,stdcodesearch); - //console.log(stdcode); - landline = listData.landline.substr(+stdcodesearch + 1,8);} + let stdcodesearch = listData.landline.search("-"); + stdcode = listData.landline.substr(0,stdcodesearch); + landline = listData.landline.substr(+stdcodesearch + 1,8);} else{ - stdcode = null; - landline = null; + stdcode = ''; + landline = ''; } return this._fb.group({ label: ['Co Applicant'], @@ -139,22 +147,37 @@ export class EditPdApplicantComponent implements OnInit { return; } else { - if((formValue.mobile_no == '') || (formValue.stdcode == '' && formValue.landline == '')){ + if((formValue.mobile_no == '') && (formValue.stdcode == '' || formValue.landline == '')){ this.notifier.notify('warning', 'Either Mobile or Landline Need.!'); return; } else{ + let concat_landline1 + if(formValue.stdcode != null && formValue.landline != null){ + if(formValue.stdcode == '' && formValue.landline == ''){ + concat_landline1 = null; + }else { + let std = formValue.stdcode == '' ? '' : formValue.stdcode; + let landline = formValue.landline == '' ? '' : formValue.landline; + concat_landline1 = std+'-'+landline; + } + } + else if(formValue.stdcode == '' && formValue.landline == ''){ + concat_landline1 = null; + }else{ + concat_landline1 = null; + } + let pd_applicant_details : any=[{ "fk_pd_id": this.data.pdID, "pd_co_applicant_id": formValue.fk_applicant_primary_id, "applicant_name":formValue.applicant_name, "company_name":formValue.company_name, "mobile_no":formValue.mobile_no, - "landline":formValue.stdcode+'-'+formValue.landline, + "landline":concat_landline1, "applicant_type":formValue.applicant_type, "relation":formValue.relationship, "applicant_title_name": formValue.applicant_title_name, - "isactive":1 }]; formValue.coApplicantItems.forEach((itemElement, itemIndex) => { @@ -189,19 +212,19 @@ export class EditPdApplicantComponent implements OnInit { } pd_applicant_details.push(obj1) }); - - // this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => { - // if (result.status == 200) { - // this.notifier.notify('success', 'PD Details Updated.'); - // this.dialogRef.close(); - // } - // else { - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - // } - // }, error => { - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - // }); - }} + this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => { + if (result.status == 200) { + this.notifier.notify('success', 'PD Details Updated.'); + this.dialogRef.close(); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); + } + } } // get relation master details diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index 7d4ca2fbb..68612360f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -150,6 +150,11 @@ {{PL.pincode}} + + + + Enter Valid Pincode. + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index f54d1c334..30d6fbc55 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -134,6 +134,7 @@ export class EditPdMasterComponent implements OnInit { loadFormData() { console.log('this.data.record',this.data.records); + console.log('this.reocrds',this.data.records.pincode_id); let stdcode; let landline; if(this.data.records.pd_contact_landline){ @@ -149,7 +150,10 @@ export class EditPdMasterComponent implements OnInit { } this.getCityList(this.data.records.fk_state); - + // let getpincodeid = this.data.records.pincode != '' ? this.data.records.pincode != null ? (this.pincodeList.filter(data => data.pincode == this.data.records.pincode).pincode_id) + // : this.data.records.pincode + // : this.data.records.pincode; + this._EditPDtriggerForm = this._fb.group({ pd_id: [this.data.records.pd_id], fk_lender_id: [this.data.records.fk_lender_id, Validators.compose([Validators.required])], @@ -167,9 +171,10 @@ export class EditPdMasterComponent implements OnInit {   addressline1: [this.data.records.addressline1], fk_city: [this.data.records.fk_city], fk_state: [this.data.records.fk_state], -   pincode : [this.data.records.pincode],/** Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])], */ +   pincode : [this.data.records.pincode_id], + other_pincode:[this.data.records.other_pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])], remarks: [this.data.records.remarks], - }); + }); } get pdMain() { return this._EditPDtriggerForm.controls; } @@ -206,7 +211,7 @@ export class EditPdMasterComponent implements OnInit { } //trigger pd triggerPD(formValue: any, status:any){ - + console.log('triggerPD',formValue); // this._EditPDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]); // this._EditPDtriggerForm.controls['fk_lender_id'].updateValueAndValidity(); @@ -333,6 +338,7 @@ export class EditPdMasterComponent implements OnInit { "fk_city": my_array.fk_city, "fk_state": my_array.fk_state,   "pincode": my_array.pincode, + "other_pincode":my_array.other_pincode, "remarks": my_array.remarks, } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index 26d5cf659..fac93f6bc 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -25,7 +25,7 @@ - +
@@ -47,7 +47,7 @@
- + {{m_locality.locality_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts index e6af8783d..fd6681916 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts @@ -133,9 +133,8 @@ export class AddressComponent implements OnInit { this.addressForm.controls.address.setValue(data.records.address); this.addressForm.controls.pd_location.setValue(data.records.pd_location); this.addressForm.controls.address_type.setValue(data.records.address_type); - let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type); - this.selectedAddressType(selectedAddressType); - + let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type)[0]; + this.selectedAddressType(selectedAddressType.address_type); if(data.records.address_type == 1) { this.addressForm.controls.address_type_others.setValue(data.records.address_type_others); this.selectedAddressType(data.records.address_type_others); @@ -160,7 +159,7 @@ export class AddressComponent implements OnInit { // } this.addressForm.controls.other_premises_bussiness_activity.setValue(data.records.other_premises_bussiness_activity); if(data.records.other_premises_bussiness_activity != '' && data.records.other_premises_bussiness_activity !=null) { - this.addressForm.controls.bussiness_activity_remark.setValue(data.records.other_premises_bussiness_activity); + this.addressForm.controls.bussiness_activity_remark.setValue(data.records.bussiness_activity_remark); } else{ this.addressForm.controls.bussiness_activity_remark.setValue(''); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html index 6c622dc6c..5768d1121 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html @@ -260,7 +260,7 @@ - Vintage + Age of Asset in Years @@ -295,6 +295,12 @@ +
+ +
--> -
- -
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html index 1d0e0f11c..055075397 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html @@ -111,7 +111,7 @@ {{ btLen.lender_name }}
- + @@ -166,6 +166,12 @@ Add More Banking Details
+ +
+ +
-
- -
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts index 10675856c..81cfbb247 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts @@ -29,7 +29,7 @@ import {ActivatedRoute, Router} from "@angular/router"; }) export class BankingDetailsComponent implements OnInit { pdid: number; - pageTitle: string ="Banking Information"; + pageTitle: string ="Banking Details of Individuals"; public bankingForm: FormGroup; step: number; private notifier: NotifierService; @@ -91,13 +91,13 @@ export class BankingDetailsComponent implements OnInit { this.existCompanyList = data.records.filter(val =>val.is_active===true); } - 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}) - } + // 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}) + // } }); let modifyApplicantList: any=[]; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html old mode 100644 new mode 100755 index 240abb48c..3b0febd23 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html @@ -35,9 +35,9 @@
-
+
-
+
@@ -45,10 +45,18 @@ {{ prop.name | titlecase }} - - + + + + Owned + Rented + + + + +
@@ -200,12 +208,12 @@
- + {{"₹"}} {{appxMarketAmtInwords[i]}} Only - + @@ -229,11 +237,9 @@ -->
- - - + - Vintage + Approx Vintage @@ -244,9 +250,9 @@ - - - + + +
@@ -257,13 +263,12 @@
-
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss old mode 100644 new mode 100755 index 2f381258f..a1c689d8e --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss @@ -14,10 +14,15 @@ ::ng-deep .cdk-global-overlay-wrapper{ justify-content: center !important; } + +.matcard mat-form-field { + margin: 0 2%; +} - mat-form-field { +mat-form-field { margin: 0 2%; - } +} + $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; $product-bg-color-hover: rgba(103, 58, 183, 0.7); .p-list-main { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts old mode 100644 new mode 100755 index 5b66497e0..101636fbf --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -16,7 +16,7 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; }) export class BusinessAssetsInfoComponent implements OnInit { - pageTitle: string ="Business Assets"; + pageTitle: string ="Assets used for Business"; pdid:string; public _businessAssetsQuesFrom: FormGroup; @@ -36,6 +36,7 @@ export class BusinessAssetsInfoComponent implements OnInit { AssetValueInwords: any = []; // B_emiAmtInwords: any = []; public m_propertyType = []; + PropertyOwnedType : any = []; // public m_investmentType = []; // public m_freqOfPurchase = []; private notifier: NotifierService; @@ -76,6 +77,7 @@ export class BusinessAssetsInfoComponent implements OnInit { this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); this.company_id =this.pd_all_details.company_id; this.notifier = notifier; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } @@ -228,7 +230,22 @@ export class BusinessAssetsInfoComponent implements OnInit { business_emi: [''], }); } - + selectedPropertyOwnedType(e,s,i){ + + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(i).get('business_details') as FormArray ; + if(e == "owned"){ + // console.log('e o',e); + // console.log('s o',s); + // console.log('i o',i); + this.PropertyOwnedType[i] = true; + } + else{ + // console.log('e r',e); + // console.log('s r',s); + // console.log('i r',i); + this.PropertyOwnedType[i] = false; + } + } show: boolean; selectedAssetsType(e: any, i: any): void { let val = i; @@ -287,7 +304,9 @@ export class BusinessAssetsInfoComponent implements OnInit { loadProperty() { return this._formBuilder.group({ property_type: [''], - other_property_type: [''] + other_property_type: [''], + properties_ownership_type : [''], + properties_monthly_rented_amt:[''] }); } @@ -352,7 +371,9 @@ export class BusinessAssetsInfoComponent implements OnInit { loadPropertyWithData(data) { return this._formBuilder.group({ property_type: [data.property_type], - other_property_type: [data.other_property_type] + other_property_type: [data.other_property_type], + properties_ownership_type : [data.properties_ownership_type], + properties_monthly_rented_amt:[data.properties_monthly_rented_amt] //property_type:[''] }); } @@ -477,7 +498,8 @@ export class BusinessAssetsInfoComponent implements OnInit { case '2': { let business_property_datas : any; data.forEach((datas,i) => { - business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; + business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type,'properties_ownership_type':datas.properties_ownership_type,'properties_monthly_rented_amt':datas.properties_monthly_rented_amt }; + this.selectedPropertyOwnedType(datas.properties_ownership_type,i,val); }); const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; control.push(this.loadPropertyWithData(business_property_datas)); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html old mode 100644 new mode 100755 index d6a1ecfd0..e321a90e9 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html @@ -42,7 +42,7 @@ {{ btLen.lender_name }} - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.scss old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.spec.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts old mode 100644 new mode 100755 index 41f75395a..404f4f28e --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts @@ -61,6 +61,7 @@ export class BusinessBankingDetailsComponent implements OnInit { this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); this.notifier = notifier; this.company_id = this.pd_all_details.company_id; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts old mode 100644 new mode 100755 index 8fe05e19e..7080d93b6 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts @@ -38,7 +38,7 @@ export class BusinessInfoGroupComponent implements OnInit { getCompanyListForBusiness(): void{ this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ if(data.dataStatus){ - this.existCompanyList = data.records.filter(val =>val.is_active && val.is_company_applicant===true); + this.existCompanyList = data.records.filter(val =>val.is_active == 1); this.waitLoading = true; } else { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html index 68b144034..076ad7106 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html @@ -43,7 +43,7 @@ delete
-
+
@@ -57,11 +57,12 @@
-

No of Years in Current Business

-
+

No of Years in Current Business

+ +
- + {{errorMessage[i]}} @@ -69,20 +70,22 @@ + formControlName="total_business_experiance" (keypress)="keyPress($event)" (keyup)="getWorkExperience(members.value,i)" autocomplete="off" required (change)="checkWithExistTotalWorkExperience($event.target.value,i,members)"> + {{errorMessageForExistTotalWorkExperience[i]}}
-
+
-
+ +
- +
- - + +

Within India

@@ -368,8 +383,8 @@

Export

-
- +
+ Countries Where The Export Is Being Done for {{manufacturing.value.main_products}} @@ -377,8 +392,9 @@ - - + + + @@ -397,23 +413,29 @@
- + - Description of {{manufacturing.value.main_products}} + Description of {{manufacturing.value.main_products}} manufacturing process - + +
+ +
- + @@ -421,13 +443,13 @@ Retail Trading Details - + - + Within India Export Both @@ -499,9 +521,9 @@
-
+
- + Countries Where Export Is Being Done for {{retail.value.main_products}} @@ -511,8 +533,9 @@ - - + + + +
@@ -652,13 +682,13 @@ Wholesale Trade Details - + - + Within India Export Both @@ -730,9 +760,9 @@
-
+
- + Countries Where The Export Is Being Done for {{wholesale.value.main_products}} @@ -740,8 +770,9 @@ - - + + + +
- + @@ -881,13 +919,13 @@ Service Provider Details - + - + Within India Export Both @@ -1087,17 +1125,23 @@ - Description of {{serviceprovider.value.main_products}} + Description of {{serviceprovider.value.main_products}} Service Process - + +
+ +
@@ -1106,25 +1150,31 @@ Other Details - + +
+ +
- + - - + + Export Sale As a % Total Sales @@ -1206,6 +1256,7 @@ +
@@ -1218,6 +1269,13 @@ +
+ + + {{"₹"}} {{appxSalaryAmtInwords}} Only + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index 775d8015c..b435db587 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -37,6 +37,7 @@ export class BusinessInfoComponent implements OnInit { form_id: number; pageTitle: string ="About Business"; relationData: any = []; + titleData: any = []; companyRelationShipList: any =[]; //industryData: any = []; activityData: any = []; @@ -45,6 +46,7 @@ export class BusinessInfoComponent implements OnInit { relativeNames: any; applicants: any; + EntityTypeFlag : boolean = false; public businessForm: FormGroup; private notifier: NotifierService; // businessEntityTypeList: any=["Private Limited Company","Proprietorship","Partnership","Limited Liability Partnership (LLP)","One Person Company (OPC)","Hindu Undivided Family (HUF)","Society","Cooperative","Trust","Public Ltd Company","Others"] @@ -60,12 +62,15 @@ export class BusinessInfoComponent implements OnInit { maxDate:any; // InvestedAmountInWords:any; public relationSource= new MatTableDataSource(); - displayedColumns = ['family_member_name','relation','relation_to','relationship_with_company','started_business']; + displayedColumns = ['title','family_member_name','relation','relation_to','relationship_with_company','started_business']; generalExistEntityType:string; generalExistEntityType_other:string; generalExistBusinessYear:Number; generalExistBusinessMonth:Number; errorMessage: any = []; + errorMessageForExistTotalWorkExperience:any = []; + ExportFlag: boolean = false; + appxSalaryAmtInwords: any; constructor(notifier: NotifierService, private fb: FormBuilder, @@ -77,7 +82,7 @@ export class BusinessInfoComponent implements OnInit { this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.company_id = this.pd_all_details.company_id; this.company_name = this.pd_all_details.company_name; - this.pageTitle = this.pd_all_details.company_name; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; this.applicants = this.pd_all_details.pdapplicants_detials; this.form_id = 13; this.notifier = notifier; @@ -116,6 +121,7 @@ export class BusinessInfoComponent implements OnInit { this.getCountryDataList(); this.initBusinessForm(); this.getCompanyRelation(); + this.getTitle(); // const Desgn = this.businessForm.controls['designation']; // const Partnr = this.businessForm.controls['partners']; // const otherDoc = this.businessForm.controls['documents']; @@ -565,7 +571,7 @@ export class BusinessInfoComponent implements OnInit { } - public initBusinessForm(): void { + public initBusinessForm(): void { this.businessForm = this.fb.group({ pdid: this.pdid, formid: this.form_id, @@ -573,7 +579,7 @@ export class BusinessInfoComponent implements OnInit { fk_createdby: this.pdid, //industry: [''], seasonality: ['', Validators.compose([Validators.required])], - export_sale_of_total_sales:[], + export_sale_of_total_sales:[''], //month_of_business_run : [''], // peak_period_of_business : [''], //designation: this.fb.array([]), @@ -581,6 +587,7 @@ export class BusinessInfoComponent implements OnInit { employees_total: ['', Validators.compose([Validators.required])], 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_permanent: ['', Validators.compose([Validators.required])], // officer_temporary: ['', Validators.compose([Validators.required])], @@ -684,14 +691,12 @@ export class BusinessInfoComponent implements OnInit { control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required)); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([])); control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); - } else if(getDetails.value.area_of_sale=="Export"){ control.controls[getIndex].removeControl('countries_where_export_done'); control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].removeControl('pan_india_options'); control.controls[getIndex].removeControl('max_sale_state_name'); - control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); } else if(getDetails.value.area_of_sale=="Both") { @@ -786,7 +791,6 @@ export class BusinessInfoComponent implements OnInit { control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required)); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([])); control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); - } else if(getDetails.value.area_of_sale=="Export"){ control.controls[getIndex].removeControl('countries_where_export_done'); @@ -1039,6 +1043,17 @@ export class BusinessInfoComponent implements OnInit { }) }); } + // get title master + getTitle() { + let master_name = 'TITLES'; + this._pd.getAllMasterDatas(master_name).subscribe(data => { + data.records.forEach(val => { + if (val.isactive == 1) { + this.titleData.push(val); + } + }) + }); + } getCompanyRelation() { let master_name = 'COMPANYRELATIONSHIPS'; @@ -1075,8 +1090,18 @@ export class BusinessInfoComponent implements OnInit { this.businessEntityTypeList.business_entity_type_id = filterList[0].business_entity_type_id==1; this.businessEntityTypeList.business_entity_type_name = filterList[0].business_entity_type_id!=1 ? filterList[0].business_entity_type_name : this.generalExistEntityType_other; this.businessEntityTypeList.section_label = filterList[0].business_entity_type_id!=1 ? filterList[0].section_label : this.generalExistEntityType_other; - - + + // console.log(this.businessEntityTypeList.business_entity_type_id+' , '+this.businessEntityTypeList.business_entity_type_name+' , '+this.businessEntityTypeList.section_label); + // console.log(this.businessForm.controls.partners['controls']); + // console.log(this.businessForm.controls.partners['controls'].length); + // if(this.businessForm.controls.partners['controls'].length > 1) + // { + // console.log('asd'); + // } + + if(this.businessEntityTypeList.business_entity_type_name == 'OPC (One Person Company)' || this.businessEntityTypeList.business_entity_type_name == 'Sole proprietorship'){ + this.EntityTypeFlag = true; + } // data.records.forEach(val => { // this.businessEntityTypeList.push(val); // this.sourceNames[val.business_entity_type_id] = val.section_label @@ -1122,6 +1147,7 @@ export class BusinessInfoComponent implements OnInit { createPersonRelationhip(details: any):FormGroup { return this.fb.group({ other_family_relationship_id: [details.other_family_relationship_id,Validators.required], + family_member_salutation:[details.family_member_salutation], family_member_name: [details.family_member_name,Validators.required], relationship_with_company_id: [details.relationship_with_company_id,Validators.required], relation_to_id: [details.relation_to_id,Validators.required], @@ -1166,33 +1192,71 @@ export class BusinessInfoComponent implements OnInit { addMoreManufacturing() { let manufacturingControl = this.businessForm.controls['manufacturing_activity_details']; manufacturingControl.push(this.createActivity()); + } + deleteManufacturing(findex){ + let manufacturingControl = this.businessForm.controls['manufacturing_activity_details']; + manufacturingControl.removeAt(findex); } // add more retail details addMoreRetail() { let retailControl = this.businessForm.controls['retail_trading_activity_details']; retailControl.push(this.createActivity()); - } + } + + deleteRetail(index) { + let retailControl = this.businessForm.controls['retail_trading_activity_details']; + retailControl.removeAt(index); + } + // add more retail details addMoreWholesale() { let wholesaleControl = this.businessForm.controls['wholesale_trading_activity_details']; wholesaleControl.push(this.createActivity()); - } + } + + deleteWholesale(index) { + let wholesaleControl = this.businessForm.controls['wholesale_trading_activity_details']; + wholesaleControl.removeAt(index); + } + + // add more service provider details addMoreServiceprovider() { let serviceControl = this.businessForm.controls['service_provider_activity_details']; serviceControl.push(this.createServiceActivity()); } + + deleteServiceprovider(index) { + let serviceControl = this.businessForm.controls['service_provider_activity_details']; + serviceControl.removeAt(index); + } + // add more others details addMoreOthersActivity() { let othersControl = this.businessForm.controls['others_activity_details']; othersControl.push(this.createOthersActivity()); } + deleteOthersActivity(index) { + let othersControl = this.businessForm.controls['others_activity_details']; + othersControl.removeAt(index); + } + // update partner group other form control changePartnerGroup(value,key) { let control: any = this.businessForm.get('partners') as FormArray; value=='Others' ? control.controls[key].addControl('partner_other_name', new FormControl('', Validators.required)) : control.controls[key].removeControl('partner_other_name'); } + + // Out of Total Export Sales what % of Sales is done in Albania? + getPlaceHolderName(id){ + let name = this.countryDataList.filter(value=>value.country_id == id); + // console.log(name); + // console.log(name[0].country_name); + // console.log(id); + return 'Out of Total Export Sales what % of Sales is done in '+ name[0].country_name +' ?'; + // return name[0].country_name +'?'; + } // get work experience based on create form control getWorkExperience(event, key) { let current_experience = event.current_business_experiance_year=='' ? 0 : parseInt(event.current_business_experiance_year); @@ -1246,6 +1310,41 @@ export class BusinessInfoComponent implements OnInit { // let family: any = []; // console.log(this.businessForm.value); + + + if(this.EntityTypeFlag == true){ + let control: any = this.businessForm.controls['partners']; + let control2:any = control.controls[0]; + + control2.controls['shareholding'].clearValidators(); + control2.controls['shareholding'].updateValueAndValidity(); + control2.controls['shareholding'].setValue('100'); + + + // control.controls[0].removeControl('shareholding'); + // control.controls[0].removeControl('started_business'); + // control.controls[0].removeControl('current_business_experiance_year'); + // control.controls[0].removeControl('current_business_experiance_month'); + // control.controls[0].removeControl('total_business_experiance'); + + control2.controls['started_business'].setValue(''); + + control2.controls['current_business_experiance_year'].clearValidators(); + control2.controls['current_business_experiance_year'].updateValueAndValidity(); + control2.controls['current_business_experiance_year'].setValue(''); + + control2.controls['current_business_experiance_month'].setValue(''); + + control2.controls['total_business_experiance'].clearValidators(); + control2.controls['total_business_experiance'].updateValueAndValidity(); + control2.controls['total_business_experiance'].setValue(''); + // if(control2.controls['total_business_previous_experience'].value !=undefined){ + // control2.controls['total_business_previous_experience'].clearValidators(); + // control2.controls['total_business_previous_experience'].updateValueAndValidity(); + // control2.controls['total_business_previous_experience'].setValue('0'); + // } + + } if (!this.businessForm.valid) { this.notifier.notify('warning',"Please Check All Manatory Fields.."); @@ -1253,6 +1352,7 @@ export class BusinessInfoComponent implements OnInit { } // let design: any; let records = this.businessForm.value; + // console.log(records); //to check the Appx. sale validation. // this.validateAppxSales(records); @@ -1269,6 +1369,22 @@ export class BusinessInfoComponent implements OnInit { let validationFlag : number = 0; + // let shareHoldValidationFlag : number = 0; + // console.log(records.partners.length); + console.log(records.partners); + + if(records.partners.length > 0){ + let total = records.partners.map(shares => shares.shareholding).reduce((a, b) => a + +b, 0); + if(total > 100){ + this.notifier.notify('warning',"Shareholding is greater than 100%"); + return; + } + } + + // console.log('as'); +// return; + // if(if(parseInt(datas.total_business_experiance) > parseInt(datas.current_business_experiance_year)) {) + // return; //type 1: Checking manufacturing_activity_details if(records.manufacturing_activity_details.length > 0){ @@ -1280,7 +1396,7 @@ export class BusinessInfoComponent implements OnInit { }); let total = ManufacturingArray.reduce((sum, item) => sum + +item.approx_sale, 0); if(total > 100 || total < 100){ - validationFlag++; + this.notifier.notify('warning',"Approximate sales doesn't add upto 100%"); } } }); @@ -1362,7 +1478,7 @@ export class BusinessInfoComponent implements OnInit { otherFamilyMemberDialogue() { let relationControl = this.businessForm.controls['persons_with_relationships']; - let other_family_member: any= {'other_family_relationship_id':'','other_family_relationship_name':'','family_member_name':'','relationship_with_company_id':'','relationship_with_company':'','started_business':'','currently_active_status':''}; + let other_family_member: any= {'other_family_relationship_id':'','other_family_relationship_name':'','family_member_salutation':'','family_member_name':'','relationship_with_company_id':'','relationship_with_company':'','started_business':'','currently_active_status':''}; relationControl.push(this.createPersonRelationhip(other_family_member)); } @@ -1457,13 +1573,87 @@ export class BusinessInfoComponent implements OnInit { checkTotalEmployee(FormData){ this.businessForm.controls['employees_total'].setValue((+FormData.value.employees_permanent ||0)+(+FormData.value.employees_temporary||0)); } - checkWithExistBusinessYear(e,i){ - if(e > this.generalExistBusinessYear){ + checkWithExistBusinessYear(e,i,members){ + + if(+e > this.generalExistBusinessYear){ this.errorMessage[i] = "Higher than Business Vintage"; + members.controls.current_business_experiance_year.setValue(''); } else{ this.errorMessage[i] = ''; } } + checkWithExistTotalWorkExperience(e,i,members){ + + if(+members.value.current_business_experiance_year > +e){ + this.errorMessageForExistTotalWorkExperience[i] = "Total Experience is Lower Than Experience in The Current Company"; + members.controls.total_business_experiance.setValue(''); + } + else{ + this.errorMessageForExistTotalWorkExperience[i] = ''; + } + } +// flag: number = 0; +// CheckExport(e,val){ +// console.log(e); +// console.log(val); +// console.log(this.) +// if(val == 1){ +// e != "Within India" ? +// this.flag++ :this.flag--; +// } +// if(val == 2){ +// e != "Within India" ? +// this.flag++ :this.flag--; +// } +// if(val == 3){ +// e != "Within India" ? +// this.flag++ :this.flag--; +// } +// if(val == 4){ +// e != "Within India" ? +// this.flag++ :this.flag--; +// } +// if(this.flag > 0){ +// this.ExportFlag = true; +// } + +// } + + CheckExport(e,val){ + console.log(e); + console.log(val); + let flag: number = 0; + if(val == 1){ + e != "Within India" ? + flag++ :flag--; + } + if(val == 2){ + e != "Within India" ? + flag++ :flag--; + } + if(val == 3){ + e != "Within India" ? + flag++ :flag--; + } + if(val == 4){ + e != "Within India" ? + flag++ :flag--; + } + if(flag > 0){ + this.ExportFlag = true; + } + + } + + inWords(e,flag){ + switch(flag){ + case 1 : + this.appxSalaryAmtInwords = this._pd.convertNumberToWords(e.target.value); + break; + } + } + + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index cba7fb278..92808407e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -47,19 +47,25 @@ {{comrelShip.name}} - Not Applicable + + + +
+ Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
@@ -68,9 +74,18 @@ {{ pm.name }} - + +
+
+ No. of Days of Credit Given for Payment Receipt + + + + + +
@@ -134,19 +149,25 @@ {{comrelShip.name}} - Not Applicable + + + +
+ Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
@@ -156,9 +177,18 @@ {{ pm.name }} - + +
+
+ No. of Days of Credit Given for Payment Receipt + + + + + +
@@ -176,7 +206,7 @@
-
@@ -222,19 +252,25 @@ {{comrelShip.name}} - Not Applicable + + + +
+ Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
@@ -243,14 +279,23 @@ {{ pm.name }} - + +
+
+ No. of Days of Credit Given for Payment Receipt + + + + + +
- +
@@ -263,7 +308,7 @@
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts index 991802e81..e3b5abf35 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts @@ -81,6 +81,7 @@ export class ClientInfoComponent implements OnInit { this.form_id = 2; this.company_id = this.pd_all_details.company_id; this.notifier = notifier; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } public viewerOptions: any = { navbar: false, @@ -356,6 +357,7 @@ export class ClientInfoComponent implements OnInit { person_designation:[''], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[''], }) } else { return this._formBuilder.group({ @@ -369,6 +371,7 @@ export class ClientInfoComponent implements OnInit { person_designation:[records.person_designation || null], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[records.other_person_designation || null], }) } } @@ -393,11 +396,13 @@ export class ClientInfoComponent implements OnInit { trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], trade_product_payment_type: [''], trade_product_frequency_of_purchase: [''], - trade_product_credit_days: [''], + trade_product_credit_days_from: [''], + trade_product_credit_days_to: [''], person_title_name:[''], person_designation:[''], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[''], }) } else { return this._formBuilder.group({ @@ -407,11 +412,13 @@ export class ClientInfoComponent implements OnInit { trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], trade_product_payment_type: [records.trade_product_payment_type], trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase], - trade_product_credit_days: [records.trade_product_credit_days], + trade_product_credit_days_from: [records.trade_product_credit_days_from], + trade_product_credit_days_to: [records.trade_product_credit_days_to], person_title_name:[records.person_title_name || null], person_designation:[records.person_designation || null], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[records.other_person_designation || null], }) } } @@ -436,11 +443,13 @@ export class ClientInfoComponent implements OnInit { service_provider_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], service_provider_product_payment_type: [''], service_provider_product_frequency_of_purchase: [''], - service_provider_product_credit_days: [''], + service_provider_product_credit_days_from: [''], + service_provider_product_credit_days_to: [''], person_title_name:[''], person_designation:[''], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[''], }) } else { return this._formBuilder.group({ @@ -450,11 +459,13 @@ export class ClientInfoComponent implements OnInit { service_provider_product_contact_person_mobile_number: [records.service_provider_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], service_provider_product_payment_type: [records.service_provider_product_payment_type], service_provider_product_frequency_of_purchase: [records.service_provider_product_frequency_of_purchase], - service_provider_product_credit_days: [records.service_provider_product_credit_days], + service_provider_product_credit_days_from: [records.service_provider_product_credit_days_from], + service_provider_product_credit_days_to: [records.service_provider_product_credit_days_to], person_title_name:[records.person_title_name || null], person_designation:[records.person_designation || null], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[records.other_person_designation || null], }) } } @@ -528,8 +539,7 @@ export class ClientInfoComponent implements OnInit { data => { if (data.dataStatus) { if(type==1){ - this.companyRelationShipList=data.records.filter(item => item.name != 'Others'); - + this.companyRelationShipList=data.records;// .filter(item => item.name != 'Others'); } if(type==2){ this.titleList=data.records.filter(val=>val.isactive==1); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index d775926f5..b6aacf511 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -39,28 +39,28 @@ - + {{types.loan_type_name}} - + {{"₹"}} {{amtInwords[i]}} Only - + {{ btLen.lender_name }} - + - + - + - {{freq.name}} @@ -121,7 +121,7 @@
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts index da792df83..b94a14eb4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts @@ -89,79 +89,6 @@ export class CurrentLoanComponent implements OnInit { this.getMasterDetails('FREQUENCY',2); this.getMasterDetails('EXISTINGLOANTYPES',3); this.initCurrentloanForm(); - - this._pd.getAssetsWithLoanFromBusiness(this.pdid).subscribe(data=>{ - // console.log(data); - - if(data.dataStatus == true){ - // console.log(data.record); - this.dataFromAssets = data.record; - if(this.dataFromAssets.length > 0){ - let labelarray : any = []; - - this.dataFromAssets.forEach((val,index) => { - - if(val.business_assets_mode == 1){ - let data; - val.business_details.forEach((v,index) => { - - data = v.any_other_assets; - }); - labelarray[index] = val.business_name_of_the_owner +' - '+ data; - } - if(val.business_assets_mode == 2){ - let data; - val.business_details.forEach((v,index) => { - data = v.property_type_name; - }); - labelarray[index] = val.business_name_of_the_owner +' - '+ data; - } - if(val.business_assets_mode == 3){ - let data; - val.business_details.forEach((v,index) => { - data = v.manufacturer_model_vehicle; - }); - labelarray[index] = val.business_name_of_the_owner +' - '+ data; - } - if(val.business_assets_mode == 4){ - let data; - val.business_details.forEach((v,index) => { - data = v.equipment_manufacturing_description; - }); - labelarray[index] = val.business_name_of_the_owner +' - '+ data; - } - - }); - const control = this.currentLoanForm.controls['loan_details']; - this.labelArr = labelarray; - let arr : any = []; - if(this.labelArr.length > 0){ - this.currentLoanForm.controls['existing_loan'].setValue('Yes'); - this.labelArr.forEach((v,index) => { - arr = { - 'label': v, - 'loan_amount': '', - 'frequency':'', - 'other_frequency':'', - 'emi': '', - 'loan_type': '', - 'others_loan_type': '', - 'loan_taken_by':'', - 'others_loan_taken':'', - 'lender': '', - 'others_lender':'', - 'original_tenure': '', - 'current_balance_tenure': '', - 'elapsed_tenure':'' - } - control.push(this.createLoanDetail(arr)); - }); - // this.currentLoanForm.controls['existing_loan'].setValue(arr); - } - } - } - }); - this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ if(data.dataStatus){ this.existCompanyList = data.records.filter(val =>val.is_active===true); @@ -194,7 +121,7 @@ export class CurrentLoanComponent implements OnInit { // console.log('value', value); const control = this.currentLoanForm.controls['loan_details']; if (value.status == 200) { - +// console.log(value.status); this.currentLoanForm.controls['existing_loan'].setValue(value.records.existing_loan); this.currentLoanForm.controls['currentloan_remarks'].setValue(value.records.currentloan_remarks); @@ -216,9 +143,78 @@ export class CurrentLoanComponent implements OnInit { } } } else { - // console.log('overall else'); - - // control.push(this.createLoanDetail()); + console.log('else part',value.status); + this._pd.getAssetsWithLoanFromBusiness(this.pdid).subscribe(data=>{ + // console.log(data); + + if(data.dataStatus == true){ + // console.log(data.record); + this.dataFromAssets = data.record; + if(this.dataFromAssets.length > 0){ + let labelarray : any = []; + + this.dataFromAssets.forEach((val,index) => { + + if(val.business_assets_mode == 1){ + let data; + val.business_details.forEach((v,index) => { + + data = v.any_other_assets; + }); + labelarray[index] = val.business_name_of_the_owner +' - '+ data; + } + if(val.business_assets_mode == 2){ + let data; + val.business_details.forEach((v,index) => { + data = v.property_type_name; + }); + labelarray[index] = val.business_name_of_the_owner +' - '+ data; + } + if(val.business_assets_mode == 3){ + let data; + val.business_details.forEach((v,index) => { + data = v.manufacturer_model_vehicle; + }); + labelarray[index] = val.business_name_of_the_owner +' - '+ data; + } + if(val.business_assets_mode == 4){ + let data; + val.business_details.forEach((v,index) => { + data = v.equipment_manufacturing_description; + }); + labelarray[index] = val.business_name_of_the_owner +' - '+ data; + } + + }); + const control = this.currentLoanForm.controls['loan_details']; + this.labelArr = labelarray; + let arr : any = []; + if(this.labelArr.length > 0){ + this.currentLoanForm.controls['existing_loan'].setValue('Yes'); + this.labelArr.forEach((v,index) => { + arr = { + 'label': v, + 'loan_amount': '', + 'frequency':'', + 'other_frequency':'', + 'emi': '', + 'loan_type': '', + 'others_loan_type': '', + 'loan_taken_by':'', + 'others_loan_taken':'', + 'lender': '', + 'others_lender':'', + 'original_tenure': '', + 'current_balance_tenure': '', + 'elapsed_tenure':'' + } + control.push(this.createLoanDetail(arr)); + }); + // this.currentLoanForm.controls['existing_loan'].setValue(arr); + } + } + } + }); } }) } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html index 69dee7761..128a726a5 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html @@ -22,13 +22,16 @@
- + {{qual.qualification_name}} + + +
@@ -50,7 +53,7 @@ - - + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts index 21d668228..a6951b0ba 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, Input, Output, Inject } from '@angular/core'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import { bool } from 'aws-sdk/clients/signer'; @Component({ selector: 'app-other-applicant-details', @@ -11,14 +12,33 @@ import { PdTrigerService } from './../../../../../../pd-service/pd-triger.servic export class OtherApplicantDetailsComponent implements OnInit { pageTitle: string ="Add Name of Person(s) Met and Individual Loan Applicant(s) "; public _OtherForm: FormGroup; - applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false, applicant_title_name:'',age:'', qualification:''}; + applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false, applicant_title_name:'',age:'', qualification:'',course_name:''}; titleList: any=[]; qualificationList: any=[]; + EditGeneralFormData: any=[]; + EditFlag: boolean = false; - constructor(private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { } + constructor(private _fb: FormBuilder, + private _pd: PdTrigerService, + @Inject(MAT_DIALOG_DATA) public generalFormData : any, + private dialogRef: MatDialogRef) { + if(generalFormData != ''){ + this.EditGeneralFormData = generalFormData.value; + this.EditFlag = true; + } + console.log(this.EditGeneralFormData); + } ngOnInit() { - this.initFormDetails(); + + if(!this.EditFlag){ + console.log('init if',this.EditGeneralFormData); + this.initFormDetails(null); + } + else{ + console.log('init else',this.EditGeneralFormData); + this.initFormDetails(this.EditGeneralFormData); + } this.getMasterDetails('TITLES',1); this.getMasterDetails('EDUQUALIFICATION',2); } @@ -39,14 +59,25 @@ export class OtherApplicantDetailsComponent implements OnInit { } // init form - initFormDetails() { - this._OtherForm = this._fb.group({ - applicant_list: this._fb.array([this.createApplicant(this.applicantInfo)]), - }); -} + initFormDetails(data : any) { + console.log('data',data); + if(data == null){ + console.log('if data',data); + this._OtherForm = this._fb.group({ + applicant_list: this._fb.array([this.createApplicant(this.applicantInfo)]), + }); + } + else{ + console.log('else data',data); + this._OtherForm = this._fb.group({ + applicant_list: this._fb.array([this.updateApplicant(this.EditGeneralFormData)]), + }); + } + } // create applicant form array createApplicant(elementValue:any){ + console.log("create applicants",elementValue); return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], applicant_title_name: [elementValue.applicant_title_name, Validators.required], @@ -54,7 +85,22 @@ createApplicant(elementValue:any){ is_applicant:[false], is_person_met:[false], age:[''], - qualification: [''] + qualification: [''], + course_name:[''] +}); +} + +updateApplicant(elementValue:any){ + console.log("update applicants",elementValue); + return this._fb.group({ + pd_co_applicant_id: [elementValue.pd_co_applicant_id], + applicant_title_name: [elementValue.applicant_title_name, Validators.required], + applicant_name:[elementValue.applicant_name,Validators.required], + is_applicant:[elementValue.is_applicant ? true : false], + is_person_met:[elementValue.is_person_met ? true : false], + age:[elementValue.age || ''], + qualification: [elementValue.qualification || ''], + course_name:[elementValue.course_name || ''] }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index 8fd31e47b..114ea50f9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -280,7 +280,7 @@
- + {{person.applicant_name}} @@ -291,30 +291,33 @@
Residence Details
- + {{s.name}} - + {{c.city_name}} - + - + {{p.pincode}} + + + - + @@ -342,8 +345,9 @@ - - + + + {{"₹"}} {{RentAmount[i]}} Only
@@ -72,7 +73,7 @@ - + No difference in Sales in FY {{details.get('financial_year').value}} over Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} @@ -92,8 +93,7 @@
- - + Net Profit Net Loss @@ -105,7 +105,7 @@ {{"₹"}} {{FY_netProfitAmtInwords[i]}} Only - + @@ -115,14 +115,14 @@ {{"₹"}} {{FY_netLossAmtInwords[i]}} Only - +
- + No difference in Profit in FY {{details.get('financial_year').value}} over Profit in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} @@ -140,7 +140,7 @@ - + No difference in Profit sales % in FY {{details.get('financial_year').value}} over Profit sales % in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} @@ -160,7 +160,7 @@
- + @@ -176,7 +176,7 @@ - + Yes No @@ -196,31 +196,41 @@ - + + {{"₹"}} {{AV_SalesFrmInwords[i]}} Only - + + {{"₹"}} {{AV_SalesToInwords[i]}} Only - - + + {{"₹"}} {{AV_SalesInwords[i]}} Only
- + - + Net Profit Net Loss - + + + + Yes + No + + + + -
+
- + - + - - {{"₹"}} {{details.get('estimate_profit_margin').value}} ( {{AV_marginProfitAmtInwords[i]}} Only ) + + {{"₹"}} {{AV_marginProfitAmtInwords[i]}} Only ( {{"₹"}} {{details.get('estimate_profit_margin').value}} )
-
+
- + + {{"₹"}} {{AV_netProfitAmtFrmInwords[i]}} Only - + + {{"₹"}} {{AV_netProfitAmtToInwords[i]}} Only - - ( {{details.get('estimate_net_profit_percent').value }} % ) - + + {{"₹"}} {{AV_netProfitAmtInwords[i]}} Only ( {{details.get('estimate_net_profit_percent').value }} % ) +
- + - -
+ +
- + - + - - {{"₹"}} {{details.get('estimate_Loss_margin').value}} - + + {{"₹"}} {{AV_marginLossAmtInwords[i]}} Only ( {{"₹"}} {{details.get('estimate_loss_margin').value}} ) +
-
+
- + + {{"₹"}} {{AV_netLossAmtFrmInwords[i]}} Only - + + {{"₹"}} {{AV_netLossAmtToInwords[i]}} Only - - ( {{details.get('estimate_net_loss_percent').value }} % ) - + + {{"₹"}} {{AV_netLossAmtInwords[i]}} Only ( {{details.get('estimate_net_loss_percent').value }} % ) + -
+
+
+ + + +
- +
+ + + + Business Use. + Child’s Marriage. + Furniture & Finishing of House Property. + Medical Expenses. + Paying Off Existing Loans. + Others. + + + + + +
@@ -84,9 +97,9 @@ - + @@ -105,17 +118,17 @@

Details of Property being Mortgaged

- + {{ typeprop.property_name }} - + - + @@ -149,7 +162,7 @@ --> - + {{ status.name }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.scss index a2381ffbc..3bb315cf9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.scss @@ -18,6 +18,12 @@ margin: 0 2%; width:26%; } + +// ::ng-deep .mat-option{ +// word-wrap: break-word !important; +// white-space: pre-wrap !important; +// } + .address .button { float: right; width: 10px; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts index 375560841..02bbdf249 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts @@ -138,13 +138,16 @@ export class LoanDetailsComponent implements OnInit { return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; }); this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) + this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:[{id:0,name:'Not Yet Finalised',group_id:2}]}) } + 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.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1); } }) @@ -204,9 +207,14 @@ export class LoanDetailsComponent implements OnInit { if (value.records.topup_amount) { this.loanDetailsForm.controls['topup_amount'].setValue(value.records.topup_amount); this.topUpAmtInWords = this._pd.convertNumberToWords(value.records.topup_amount); + if(value.records.topup_amount > 0){ + this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup); + if (value.records.end_use_topup == 1) { + this.loanDetailsForm.controls['other_end_use_topup'].setValue(value.records.other_end_use_topup); + } + } } - - // this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup); + if (value.records.lender) { this.loanDetailsForm.controls['lender'].setValue(value.records.lender); @@ -237,10 +245,10 @@ export class LoanDetailsComponent implements OnInit { this.loanDetailsForm.controls['other_source'].setValue(value.records.other_source); } - if(value.records.personal_loan_source) { - // this.isPLSource = true; - this.loanDetailsForm.controls['personal_loan_source'].setValue(value.records.personal_loan_source); - } + // if(value.records.personal_loan_source) { + // // this.isPLSource = true; + // this.loanDetailsForm.controls['personal_loan_source'].setValue(value.records.personal_loan_source); + // } } // if (value.records.lender_name_type) { @@ -359,7 +367,8 @@ getM_sourceofamount() { } } }); - + this.m_mortageTypeProperty + // mortage_property_id">{{ typeprop.property_name console.log(this.m_mortageTypeProperty); } }, @@ -429,13 +438,14 @@ getM_sourceofamount() { //is_topup: [''], balance_transfer_amount: [''], topup_amount: [''], - // end_use_topup:[''], + end_use_topup:[''], + other_end_use_topup:[''], lender: [''], other_bt_lender : [''], own_contribution: [''], source: [''], other_source:[''], - personal_loan_source:[''], + // personal_loan_source:[''], //lender_name_type: [''], emi_level: [''], property_type: [''], @@ -465,9 +475,9 @@ getM_sourceofamount() { event.forEach(option => { // let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0]; let othersData = this.m_endUseForLoan.filter(sub=>sub.enduse_of_loan_id==option)[0]; - // console.log(othersData); + // console.log('1',othersData); OthersAvaliable = othersData.enduse_of_loan.substr(0,6).toLowerCase(); - // console.log(OthersAvaliable); + // console.log('1',OthersAvaliable); this.endUserList.push({ end_use: option }); }); @@ -488,8 +498,8 @@ getM_sourceofamount() { // this.isOtherSource = (evt.some(e => e == 4) == true) ? true : false ; // this.isPLSource = (evt.some(e => e == 3) == true) ? true : false ; - this.isOtherSource = evt.some(e => e == 4) // this return true or false Only; - this.isPLSource = evt.some(e => e == 3) // this return true or false Only; + this.isOtherSource = evt.some(e => e == 1) // this return true or false Only; + // this.isPLSource = evt.some(e => e == 3) // this return true or false Only; this.sourceList = []; @@ -565,7 +575,15 @@ getM_sourceofamount() { // if (this.loanDetailsForm.controls['is_topup'].value == 'yes') { records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value; // } - // records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value; + + if(records.topup_amount > 0){ + records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value; + if(records.end_use_topup == 1){ + records.other_end_use_topup = this.loanDetailsForm.controls['other_end_use_topup'].value; + } + } + + if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { //this.loanDetailsForm.controls['is_topup'].value == 'yes' || records.lender = this.loanDetailsForm.controls['lender'].value; @@ -603,9 +621,9 @@ getM_sourceofamount() { records.other_source = this.loanDetailsForm.controls['other_source'].value; }else{ records.other_source = ''; } - if(this.isPLSource){ - records.personal_loan_source = this.loanDetailsForm.controls['personal_loan_source'].value; - }else{ records.personal_loan_source = ''; } + // if(this.isPLSource){ + // records.personal_loan_source = this.loanDetailsForm.controls['personal_loan_source'].value; + // }else{ records.personal_loan_source = ''; } //records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html index 6a3dd6da8..017731376 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html @@ -85,7 +85,6 @@ - +91 Enter Valid STD Code. - @@ -104,7 +103,7 @@ - +

Period of Relationship

@@ -126,7 +125,7 @@
- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts index e5c4a6ffc..b12374961 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts @@ -10,12 +10,12 @@ import { parse } from 'url'; styleUrls: ['./neighbour-hood.component.scss'] }) export class NeighbourHoodComponent implements OnInit { - pageTitle: string ="Neighbourhood / Reference Check"; + pageTitle: string ="Neighbourhood Check / Reference Check"; public _neighbourhoodForm: FormGroup; pdid : string; form_id:number; private notifier: NotifierService; - check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}] + check_type:any=[{'id':0,'type_name':'Neighbourhood Check'},{'id':1,'type_name':'Reference Check'}] default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':''}; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html index ef0521e21..47c367d0e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html @@ -48,7 +48,7 @@ - + @@ -80,7 +80,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html index 7302a038e..cd69f0535 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html @@ -19,18 +19,18 @@
- + - + Applicant co-applicant Parental - + Residential/commercial other @@ -182,14 +182,14 @@
- + Yes No - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html index 44e08cbbf..76d7e814b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html @@ -20,11 +20,11 @@ -
Manufacturing Details
+
Manufacturing Stock Details
Raw Material #{{a+1}} @@ -72,18 +72,19 @@ +
+ +
-
- -
+
@@ -148,6 +149,12 @@ +
+ +
--> -
- -
- - -
-
- -
-
- - Traded Goods #{{c+1}} - - - - - - - Add Stock Details - No Stock Observed - - - - - - - - - {{uom.name}} - - - - - - - - {{"₹"}} {{M_tradedGoodsValueInWords[c]}} Only - - - - - - Yes - No - - - - Please comment on the Traded Goods stock level observed? - - - - - - - - -
- -
-
- -
@@ -252,89 +177,16 @@ -
Retail Details
+
-
-
- - Finished Goods #{{d+1}} - - - - - - - Add Stock Details - No stock observed - - - - - - - - - {{uom.name}} - - - - - - - - {{"₹"}} {{R_goodsValueInWords[d]}} Only - - - - - - Yes - No - - - - Please comment on the finished goods stock level observed? - - - - - - - -
- -
-
- -
-
-
-
-
+
+
Retail Trading Details
Traded Goods #{{e+1}} @@ -392,18 +244,18 @@ +
+ +
-
- -
@@ -418,89 +270,13 @@ -
Trading Details
+
-
-
- - Finished Goods #{{f+1}} - - - - - - - Add Stock Details - No Stock Observed - - - - - - - - - {{uom.name}} - - - - - - - - {{"₹"}} {{T_goodsValueInWords[f]}} Only - - - - - - Yes - No - - - - Please comment on the finished goods stock level observed? - - - - - - - - - -
- -
-
- -
-
-
-
-
-
+
Wholesale Trading Details
Traded Goods #{{g+1}} @@ -566,7 +342,7 @@
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts index 14dc8a6c3..4295b502b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts @@ -48,10 +48,10 @@ export class StockComponent implements OnInit { // R_financialTradedGoodsValueInWords : any = []; // T_financialTradedGoodsValueInWords : any = []; - rawMaterialAccess: boolean; - finishedGoodsAccess: boolean; - tradeConcernAccess: boolean; - + rawMaterialAccess: Boolean = false; + finishedGoodsAccess: Boolean = false; + tradeConcernAccess: Boolean = false; + serviceAccess: Boolean = false; public submitted = false; noRecordsFound: Boolean = false; serviceProviderForm: Boolean = false; @@ -68,6 +68,7 @@ export class StockComponent implements OnInit { this.form_id = 11; this.company_id = this.pd_all_details.company_id; this.notifier = notifier; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } public viewerOptions: any = { @@ -91,78 +92,12 @@ export class StockComponent implements OnInit { }; ngOnInit() { - - // this._pd.stockFormsAccess({pd_id:this.pdid}).subscribe(data => { - // if(data.status == 200){ - // this.initstockForms(data.record.type_of_activity); - // } - // }, err => { - // this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!'); - // }) - // "Manufacturing" - // products - // : - // (2) ["Rwas1", "123"] - // type_of_activity_id - // : - // 2 - //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe( - // console.log(this.pdid); - // console.log(this.company_id); - + this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => { - console.log(data); - console.log(data.record); - // return; if(data.dataStatus == true){ - let tempcount = 0; - - let datas = data.record; - let api = Object.keys(datas).map(function (key) { - return datas[key]; - }); - console.log(api); - if(api.length > 0){ - api.forEach(val => { - if (val.type_of_activity_id == 2) { - if(val.products){ - this.suppliers_raw_materials = val.products; - } - } - if (val.type_of_activity_id == 3) { - if(val.products){ - this.suppliers_finished_goods = val.products; - } - } - if (val.type_of_activity_id == 4) { - if(val.products){ - this.suppliers_trade_details = val.products; - } - } - if (val.type_of_activity_id == 5) { - if(val.products){ - this.suppliers_service_product = val.products; - } - console.log(this.suppliers_service_product); - } - tempcount++; - }); - // console.log('tempcount',tempcount); - if(tempcount>0){ - this.initstockForms(datas); - } - else{ - this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id ); - this.noRecordsFound = false; - } - - - } - else{ - this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id ); - this.noRecordsFound = false; - } - }else if(data.dataStatus == false) + this.initstockForms(data.record); + } + else if(data.dataStatus == false) { this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id ); this.noRecordsFound = false; @@ -182,20 +117,12 @@ export class StockComponent implements OnInit { } public initstockForms(record){ - // console.log(record); -// {: 2, name: "Manufacturing", products: Array(2)} -// 1 -// : -// {type_of_activity_id: 3, name: "Retail trading", products: Array(1)} -// 2 -// : -// {type_of_activity_id: 4, name: "Wholesale Trade", products: Array(1)} -// 3 -// : -// {type_of_activity_id: 5, name: "Service Provider", products: Array(1)} - - - + + let api = Object.keys(record).map(function (key) { + return record[key]; + }); + + let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = this.form_id; @@ -209,43 +136,49 @@ export class StockComponent implements OnInit { formid: [this.form_id], company_id: [this.company_id], stock_remarks: [''], - manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), - retail_details : this.fb.array([this.retailFormCreation(record)]), - trade_details: this.fb.array([this.tradingFormCreation(record)]), + manufacturing_details: this.fb.array([this.manufacturingFormCreation(api)]), + retail_details : this.fb.array([this.retailFormCreation(api)]), + trade_details: this.fb.array([this.tradingFormCreation(api)]), }); - let arr = record.filter(data => data.type_of_activity_id == 2); - if(arr.length > 0) { - let manufacturing_temparr = []; - manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; - manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; - manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods; - this.initManufacturingDetails(manufacturing_temparr); - } - - let arr1 = record.filter(data => data.type_of_activity_id == 3); - if(arr1.length > 0) { - let retail_temparr = []; - retail_temparr['retail_traded_goods'] = dataForm.retail_details[0].retail_traded_goods; - retail_temparr['retail_finished_goods'] = dataForm.retail_details[0].retail_finished_goods; - this.initRetailDetails(retail_temparr); - } - - let arr2 = record.filter(data => data.type_of_activity_id == 4); - if(arr2.length > 0) { + + if(api.length > 0){ + api.forEach(val => { + if (val.type_of_activity_id == 2) { + if(val.products){ + let manufacturing_temparr = []; + manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; + manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; + this.initManufacturingDetails(manufacturing_temparr); + } + } + if (val.type_of_activity_id == 3) { + if(val.products){ + let retail_temparr = []; + retail_temparr['retail_traded_goods'] = dataForm.retail_details[0].retail_traded_goods; + this.initRetailDetails(retail_temparr); + } + } + if (val.type_of_activity_id == 4) { + if(val.products){ let trading_temparr = []; - trading_temparr['trading_finished_goods'] = dataForm.trade_details[0].trading_finished_goods; trading_temparr['trading_traded_goods'] = dataForm.trade_details[0].trading_traded_goods; this.initTradingDetails(trading_temparr); + } + } + if (val.type_of_activity_id == 5) { + if(val.products){ + this.serviceProviderForm = true; + } + + } + + }); + this.noRecordsFound = true; } - let arr3 = record.filter(data => data.type_of_activity_id == 5); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; } else{ - // console.log('dataForm',dataForm); + this.stockForms = this.fb.group({ pdid: [this.pdid], formid: [this.form_id], @@ -255,34 +188,38 @@ export class StockComponent implements OnInit { retail_details : this.fb.array([this.retailFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]), }); - let arr = record.filter(data => data.type_of_activity_id == 2); - if(arr.length > 0) { - this.initManufacturingDetails(null); + + if(api.length > 0){ + api.forEach(val => { + if (val.type_of_activity_id == 2) { + if(val.products){ + this.suppliers_raw_materials = val.products; + this.initManufacturingDetails(null); + } } - let arr1 = record.filter(data => data.type_of_activity_id == 3); - if(arr1.length > 0) { - this.initRetailDetails(null); + if (val.type_of_activity_id == 3) { + if(val.products){ + this.suppliers_finished_goods = val.products; + this.initRetailDetails(null); + } } - let arr2 = record.filter(data => data.type_of_activity_id == 4); - if(arr2.length > 0) { + if (val.type_of_activity_id == 4) { + if(val.products){ + this.suppliers_trade_details = val.products; this.initTradingDetails(null); - // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { - // if(value.status == 200){ - // // this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; - // // this.suppliers_finished_goods - // this.suppliers_trade_details = value.records.trade_details[0].trading_products; - // this.initTradingDetails(null); - // } - // else{ - // this.initTradingDetails(null); - // } - // }); + } } - let arr3 = record.filter(data => data.type_of_activity_id == 5); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; + if (val.type_of_activity_id == 5) { + if(val.products){ + this.suppliers_service_product = val.products; + this.serviceProviderForm = true; + } + + } + + }); + this.noRecordsFound = true; + } } } else { @@ -295,59 +232,40 @@ export class StockComponent implements OnInit { retail_details : this.fb.array([this.retailFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]), }); - let arr = record.filter(data => data.type_of_activity_id == 2); - if(arr.length > 0) { - // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { - // if(value.status == 200){ - // this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; - // this.initManufacturingDetails(null); - // } - // else{ - this.initManufacturingDetails(null); - // } - // }); - } - let arr1 = record.filter(data => data.type_of_activity_id == 3); - if(arr1.length > 0) { - // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { - // if(value.status == 200){ - // this.suppliers_finished_goods = value.records.trade_details[0].trading_products; - // // value.records.manufacturing_details[0].main_raw_materials; - // this.initRetailDetails(null); - // } - // else{ - this.initRetailDetails(null); - // } - // }); - - } - let arr2 = record.filter(data => data.type_of_activity_id == 4); - if(arr2.length > 0) { - // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { - // if(value.status == 200){ - // this.suppliers_trade_details = value.records.trade_details[0].trading_products; - - // } - // else{ - this.initTradingDetails(null); - // } - - // this.initTradingDetails(null); - } - let arr3 = record.filter(data => data.type_of_activity_id == 5); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; + if(api.length > 0){ + api.forEach(val => { + if (val.type_of_activity_id == 2) { + if(val.products){ + this.suppliers_raw_materials = val.products; + this.initManufacturingDetails(null); + } + } + if (val.type_of_activity_id == 3) { + if(val.products){ + this.suppliers_finished_goods = val.products; + this.initRetailDetails(null); + } + } + if (val.type_of_activity_id == 4) { + if(val.products){ + this.suppliers_trade_details = val.products; + this.initTradingDetails(null); + } + } + if (val.type_of_activity_id == 5) { + if(val.products){ + this.suppliers_service_product = val.products; + this.serviceProviderForm = true; + } + + } + + }); + this.noRecordsFound = true; + } + this.noRecordsFound = true; } }) - - // this.stockForms = this.fb.group({ - // stock_remarks: [''], - // raw_materials: this.fb.array([]), - // finished_goods: this.fb.array([]), - // traded_goods: this.fb.array([]) - // }); } manufacturingForm: Boolean = false; @@ -358,9 +276,7 @@ export class StockComponent implements OnInit { return this.fb.group({ manufacturing_raw_materials: this.fb.array([]), manufacturing_finished_goods: this.fb.array([]), - manufacturing_traded_goods: this.fb.array([]) }) - // } } else { return; } @@ -373,7 +289,6 @@ retailFormCreation(val) { if (arr.length > 0) { this.retailForm = true; return this.fb.group({ - retail_finished_goods: this.fb.array([]), retail_traded_goods: this.fb.array([]) }) // } @@ -388,7 +303,6 @@ tradingFormCreation(val) { if (arr.length > 0) { this.tradingForm = true; return this.fb.group({ - trading_finished_goods: this.fb.array([]), trading_traded_goods: this.fb.array([]) }); } else { @@ -406,11 +320,10 @@ tradingFormCreation(val) { const rawMaterial = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; const finishedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; - const tradedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; if(datas === null){ - console.log('sdzsgfasdfasddfasdf'); - console.log(this.suppliers_raw_materials); + + if(this.suppliers_raw_materials.length > 0){ this.suppliers_raw_materials.forEach(val => { let Ref_RawMaterials : any = {'raw_name': val, @@ -446,32 +359,11 @@ tradingFormCreation(val) { finishedGoods.push(this.createGoods(null)); } - if(this.suppliers_trade_details.length > 0){ - this.suppliers_trade_details.forEach(val => { - let Ref_Trade_Goods : any = { - 'traded_goods_name': val, - 'traded_goods_observed': '', - 'traded_goods_quantity': '', - 'traded_goods_uom': '', - 'traded_goods_other_uom': '', - 'estimated_traded_goods_value': '', - 'is_sufficiant_traded_goods': '', - 'traded_goods_remarks':''}; - tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods)); - }); - } - else{ - tradedGoods.push(this.createTradedGoods(null)); - } - } else { - // console.log(305,'else') - // console.log(377,datas); - // console.log(datas.manufacturing_raw_materials); + if(datas.manufacturing_raw_materials != undefined){ for (let val of datas.manufacturing_raw_materials) { - // console.log(val); if(val.raw_value){ this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value); // this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value); @@ -484,7 +376,6 @@ tradingFormCreation(val) { } if(datas.manufacturing_finished_goods != undefined){ for (let val of datas.manufacturing_finished_goods) { - // console.log(val); if(val.goods_value){ this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); // this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value); @@ -496,28 +387,13 @@ tradingFormCreation(val) { else{ finishedGoods.push(this.createGoods(null)); } - if(datas.manufacturing_traded_goods !== undefined){ - for (let val of datas.manufacturing_traded_goods) { - // console.log(val); - if(val.estimated_traded_goods_value){ - this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); - // this.M_financialTradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value); - } - tradedGoods.push(this.createTradedGoods(val)); - - } - } - else{ - tradedGoods.push(this.createTradedGoods(null)); - } - // console.log(310,rawMaterial); } } createRawmaterial(records) { - // console.log(330,'function in'); + if(records === null) { - // console.log(331,'fif'); + return this.fb.group({ raw_name: [''], stock_observed:[''], @@ -530,7 +406,7 @@ tradingFormCreation(val) { rawmaterial_remarks:[''] }) } else { - // console.log(343,'else'); + return this.fb.group({ manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null], raw_name: [records.raw_name], @@ -548,32 +424,13 @@ tradingFormCreation(val) { initRetailDetails(datas) { - const finishedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; const tradedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; if(datas === null){ - // finishedGoods.push(this.createGoods(null)); - if(this.suppliers_finished_goods.length > 0){ - // for (let val of this.suppliers_finished_goods) { - this.suppliers_finished_goods.forEach(val => { - let Ref_Finished_Goods : any = {'goods_name': val, - 'goods_observed': '', - 'goods_quantity': '', - 'goods_uom': '', - 'goods_other_uom': '', - 'goods_value': '', - 'is_sufficiant_goods': '', - 'finishedgoods_remarks':''}; - finishedGoods.push(this.createGoods(Ref_Finished_Goods)); - }); - } - else{ - finishedGoods.push(this.createGoods(null)); - } - if(this.suppliers_trade_details.length > 0){ - console.log(this.suppliers_trade_details); + this.rawMaterialAccess = true; + this.suppliers_trade_details.forEach(val => { let Ref_Trade_Goods : any = { 'traded_goods_name': val, @@ -592,27 +449,9 @@ tradingFormCreation(val) { } } else { - //console.log(479,datas.retail_finished_goods); - if(datas.retail_finished_goods != undefined){ - for (let val of datas.retail_finished_goods) { - // console.log(val); - - if(val.goods_value){ - this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); - // this.R_financialGoodsValueInWords =this._pd.convertNumberToWords(val.finished_goods_value); - } - finishedGoods.push(this.createGoods(val)); - - } - } - else{ - finishedGoods.push(this.createGoods(null)); - } - - //console.log(495,datas.retail_traded_goods); if(datas.retail_traded_goods !== undefined){ for (let val of datas.retail_traded_goods) { - // console.log(val); + if(val.estimated_traded_goods_value){ this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); // this.R_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value); @@ -684,31 +523,9 @@ tradingFormCreation(val) { } initTradingDetails(datas) { - - const finishedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - const tradedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; - + const tradedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; if(datas === null){ - // finishedGoods.push(this.createGoods(null)); - // tradedGoods.push(this.createTradedGoods(null)); - if(this.suppliers_finished_goods.length > 0){ - // for (let val of this.suppliers_finished_goods) { - this.suppliers_finished_goods.forEach(val => { - let Ref_Finished_Goods : any = {'goods_name': val, - 'goods_observed': '', - 'goods_quantity': '', - 'goods_uom': '', - 'goods_other_uom': '', - 'goods_value': '', - 'is_sufficiant_goods': '', - 'finishedgoods_remarks':''}; - finishedGoods.push(this.createGoods(Ref_Finished_Goods)); - }); - } - else{ - finishedGoods.push(this.createGoods(null)); - } if(this.suppliers_trade_details.length > 0){ // for (let val of this.suppliers_trade_details) { @@ -730,31 +547,10 @@ tradingFormCreation(val) { } } else { - // for (let val of datas) { - - // finishedGoods.push(this.createGoods(val.trading_finished_goods)); - // tradedGoods.push(this.createTradedGoods(val.trading_traded_goods)); - - // } - if(datas.trading_finished_goods !==undefined) - { - for (let val of datas.trading_finished_goods) { - // console.log(val); - if(val.goods_value){ - this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); - // this.T_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value); - } - finishedGoods.push(this.createGoods(val)); - - } - } - else{ - finishedGoods.push(this.createGoods(null)); - } if(datas.trading_traded_goods !==undefined) { for (let val of datas.trading_traded_goods) { - // console.log(val); + if(val.estimated_traded_goods_value){ this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); // this.T_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value); @@ -827,14 +623,10 @@ tradingFormCreation(val) { break; } case 2: { - const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; - control.push(this.createGoods(null)); break; } case 3: { - const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - control.push(this.createGoods(null)); - break; + break; } default: { break; @@ -849,13 +641,9 @@ tradingFormCreation(val) { break; } case 2: { - const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; - control.removeAt(index); break; } case 3: { - const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - control.removeAt(index); break; } default: { @@ -868,16 +656,10 @@ tradingFormCreation(val) { } addTradedGoods(flag) { - // const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - // //const control = this.stockForms.controls['traded_goods']; - - // control.push(this.createTradedGoods(null)); switch(flag){ case 1: { - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - control.push(this.createTradedGoods(null)); break; - } + } case 2: { const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; control.push(this.createTradedGoods(null)); @@ -895,11 +677,9 @@ tradingFormCreation(val) { } deleteTradedGoods(index,flag) { switch(flag){ - case 1: { - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - control.removeAt(index); + case 1:{ break; - } + } case 2: { const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; control.removeAt(index); @@ -915,7 +695,6 @@ tradingFormCreation(val) { } } - //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; //const control = this.stockForms.controls['traded_goods']; } @@ -930,8 +709,7 @@ tradingFormCreation(val) { // return; // } else { var answerFormValues = this.stockForms.value; -console.log(answerFormValues); -// return; + //To Remove The "Null" With Key also Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index 6fec2b84d..57b72e300 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -42,32 +42,45 @@ {{comrelShip.name}} - Not Applicable + + + +
- + Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
- + + {{ pm.name }} - - +
+ +
+ No.of days of Credit Provided by Supplier + + -
+ + + +
@@ -126,20 +139,26 @@ {{comrelShip.name}} - Not Applicable + + + +
+ Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
@@ -148,10 +167,20 @@ {{ pm.name }} - +
+ +
+ No.of days of Credit Provided by Supplier + + + + + + +
+
@@ -168,7 +197,7 @@
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index 3a056c536..1b19f75b9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -54,6 +54,7 @@ export class SupplierInfoComponent implements OnInit { this.form_id = 1; this.company_id = this.pd_all_details.company_id this.notifier = notifier; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } public viewerOptions: any = { @@ -266,10 +267,12 @@ export class SupplierInfoComponent implements OnInit { manufacturing_supplier_name: [''], person_title_name:[''], person_designation:[''], + other_person_designation:[''], manufacturing_contact_person_name: [''], manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_payment_type: [''], - manufacturing_credit_days: [''], + manufacturing_credit_days_from: [''], + manufacturing_credit_days_to:[''], manufacturing_frequency_of_purchase: [''], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], @@ -281,10 +284,12 @@ export class SupplierInfoComponent implements OnInit { manufacturing_supplier_name: [records.manufacturing_supplier_name || null], person_title_name:[records.person_title_name || null], person_designation:[records.person_title_name || null], + other_person_designation:[records.other_person_designation || null], manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null], manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_payment_type: [records.manufacturing_payment_type || null], - manufacturing_credit_days: [records.manufacturing_credit_days || null], + manufacturing_credit_days_from: [records.manufacturing_credit_days_from || null], + manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null], manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], @@ -309,20 +314,23 @@ export class SupplierInfoComponent implements OnInit { trade_product_name: [''], trade_supplier_name: [''], person_title_name:[''], - person_designation:[], + person_designation:[''], + other_person_designation:[''], trade_product_contact_person_name: [''], trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], person_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], trade_product_payment_type: [''], trade_product_frequency_of_purchase: [''], - trade_product_credit_days: [''], + trade_product_credit_days_from: [''], + trade_product_credit_days_to: [''], }) } else { return this._formBuilder.group({ trade_product_name: [records.trade_product_name], person_title_name:[records.person_title_name], person_designation:[records.person_designation], + other_person_designation:[records.other_person_designation], trade_supplier_name: [records.trade_supplier_name], trade_product_contact_person_name: [records.trade_product_contact_person_name], trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number, Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], @@ -330,7 +338,8 @@ export class SupplierInfoComponent implements OnInit { person_landline:[records.person_landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], trade_product_payment_type: [records.trade_product_payment_type], trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase], - trade_product_credit_days: [records.trade_product_credit_days], + trade_product_credit_days_from: [records.trade_product_credit_days_from], + trade_product_credit_days_to: [records.trade_product_credit_days_to], }) } } @@ -365,7 +374,8 @@ export class SupplierInfoComponent implements OnInit { data => { if (data.dataStatus) { if(type==1){ - this.companyRelationShipList=data.records.filter(item => item.name != 'Others'); + this.companyRelationShipList=data.records; + // .filter(item => item.name != 'Others'); } if(type==2){ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index f4d24683e..d64492d12 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -33,3 +33,4 @@ + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index e64e6747a..0597ae47a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -20,7 +20,7 @@ {{master.pd_status | titlecase}} QC Completed    - +
{{master.pd_allocated_to | titlecase}} @@ -98,7 +98,7 @@
- {{master.addressline1}},
{{master.city_name}},
{{master.state_name}}-{{master.pincode}}
+ {{master.addressline1}},
{{master.city_name}},
{{master.state_name}}-{{master.pincode_id == 1 ? master.other_pincode : master.pincode }}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index 29f23fbed..ee6f765b0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -134,6 +134,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { if (data.status == 200) { let masterData: any = data.records.pd_master_details; this.pdMasterData.push(masterData[0]); + console.log('this.pdMasterData',this.pdMasterData); this.mandatoryFieldsValidations = masterData[1].mandatory_fields; this.pd_QC_Rating = Number(this.pdMasterData.qc_rating); this.pdApplicantData= data.records.applicants_details; diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.spec.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.spec.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-list-tat.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-list-tat.component.html old mode 100644 new mode 100755 From 7fa7dd14352590301c3d8b6ce768b3e1b80e502a Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 4 Feb 2019 19:08:00 +0530 Subject: [PATCH 5/6] UI Changes --- .../forms/banking-details/banking-details.component.html | 4 ++-- .../forms/banking-details/banking-details.component.ts | 2 +- .../business-assets-info/business-assets-info.component.ts | 2 +- .../start-pd/forms/client-info/client-info.component.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html index 055075397..bbf1a9622 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html @@ -123,13 +123,13 @@ - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts index 81cfbb247..3ffe3e868 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts @@ -200,7 +200,7 @@ export class BankingDetailsComponent implements OnInit { //is_main: [''], //is_main: [this.pd_cus_segment == 'SAL' ? '' : ''], //is_main:[''], - is_main: this.pd_cus_segment == 'SAL' ? [''] : [''], + // is_main: this.pd_cus_segment == 'SAL' ? [''] : [''], vintage_year: [''], vintage_month: [''], }); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts index 101636fbf..5fa3a6b26 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -27,7 +27,7 @@ export class BusinessAssetsInfoComponent implements OnInit { // businessEmiAmtFlag : boolean = false; public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"}, {'value': "no",'viewValue': "No"}, - {'value': "nan",'viewValue': "NA"}] + ] appxMarketAmtInwords : any = []; // emiAmtInwords : any = []; // PremiumPaidInwords : any = []; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index 92808407e..77c53f89d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -103,7 +103,7 @@
-
From 2538537991a3ae07237d80572bb00bdae7455ae7 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 4 Feb 2019 20:00:24 +0530 Subject: [PATCH 6/6] UI Changes --- .../app/settings/entity/entity-edit/entity.edit.component.html | 2 +- .../component/branch/branch-dialog/branch-dialog.component.html | 2 +- .../component/city/city-dialog/city-dialog.component.html | 2 +- .../comments-on-locality-dialog.component.html | 2 +- .../company/company-dialog/company-dialog.component.html | 2 +- .../customer-behaviour-dialog.component.html | 2 +- .../customer-segment-dialog.component.html | 2 +- .../designation-dialog/designation-dialog.component.html | 2 +- .../frequency/frequency-dialog/frequency-dialog.component.html | 2 +- .../industry_classification-dialog.component.html | 2 +- .../lender-hierarchy-dialog.component.html | 2 +- .../members-occupation-dialog.component.html | 2 +- .../pd-location-approach-dialog.component.html | 2 +- .../pd-type/pd-type-dialog/pd-type-dialog.component.html | 2 +- .../product/product-dialog/product-dialog.component.html | 2 +- .../question-category-dialog.component.html | 2 +- .../regions/regions-dialog/regions-dialog.component.html | 2 +- .../relation-ship-dialog/relation-ship-dialog.component.html | 2 +- .../component/states/states-dialog/states-dialog.component.html | 2 +- .../sub-product-dialog/sub-product-dialog.component.html | 2 +- .../component/title/title-dialog/title-dialog.component.html | 2 +- .../activity-dialog/activity-dialog.component.html | 2 +- .../masters/component/uom/uom-dialog/uom-dialog.component.html | 2 +- .../edit/edit-category/edit-category.component.html | 2 +- .../templates-list/edit/edit-lender/edit-lender.component.html | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html index 17b31563b..690e32c5d 100755 --- a/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html +++ b/ng6-seed/src/app/settings/entity/entity-edit/entity.edit.component.html @@ -205,7 +205,7 @@
-
diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html index da96ed323..1949a2962 100755 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.html @@ -38,7 +38,7 @@ fxLayoutAlign="center">
- + diff --git a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html index c18a1fa26..fcc9bfcc9 100755 --- a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.html @@ -56,7 +56,7 @@ fxLayoutAlign="center">
- + diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html index da88ac6b3..ebe8fc363 100755 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html @@ -41,7 +41,7 @@ fxLayoutAlign="center">
- + diff --git a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html index f0df83f71..e4ddc2e72 100755 --- a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.html @@ -82,7 +82,7 @@
- + diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html index c445f8fe6..976374cd3 100755 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html @@ -45,7 +45,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html index 98f96e5e6..b456efca9 100755 --- a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.html @@ -51,7 +51,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html index c50de886e..4dab2576c 100755 --- a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.html @@ -51,7 +51,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html index 706429f5d..044195d58 100755 --- a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.html @@ -43,7 +43,7 @@ fxLayoutAlign="center"> - +
diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html index 5cae4c53a..d7866a7b6 100755 --- a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.html @@ -42,7 +42,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html index 3fba64166..d4ec82904 100755 --- a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component.html @@ -41,7 +41,7 @@ fxLayoutAlign="center"> - +
diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html index c6ca49362..1fa866f5d 100755 --- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.html @@ -41,7 +41,7 @@ fxLayout="row"> - + diff --git a/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-dialog/pd-location-approach-dialog.component.html b/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-dialog/pd-location-approach-dialog.component.html index d65b8cde4..01325aed2 100755 --- a/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-dialog/pd-location-approach-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd-location-approach/pd-location-approach-dialog/pd-location-approach-dialog.component.html @@ -44,7 +44,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-dialog/pd-type-dialog.component.html b/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-dialog/pd-type-dialog.component.html index 643c7122a..6d848af09 100755 --- a/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-dialog/pd-type-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd-type/pd-type-dialog/pd-type-dialog.component.html @@ -44,7 +44,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html index bd8c0551a..25533d8e0 100755 --- a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.html @@ -48,7 +48,7 @@ fxLayoutAlign="center"> - +
diff --git a/ng6-seed/src/app/settings/masters/component/question-category/question-category-dialog/question-category-dialog.component.html b/ng6-seed/src/app/settings/masters/component/question-category/question-category-dialog/question-category-dialog.component.html index 770a4570f..baf7c2c7e 100755 --- a/ng6-seed/src/app/settings/masters/component/question-category/question-category-dialog/question-category-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/question-category/question-category-dialog/question-category-dialog.component.html @@ -24,7 +24,7 @@ fxLayoutAlign="center"> - +
diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html index f652efa2a..75f365b69 100755 --- a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.html @@ -44,7 +44,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html index 3cce82541..bce2dfe82 100755 --- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.html @@ -43,7 +43,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html index fe54686e3..3f9d97b0c 100755 --- a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.html @@ -68,7 +68,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html index 387c6daae..41254f91f 100755 --- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.html @@ -75,7 +75,7 @@ fxLayoutAlign="center"> - +
diff --git a/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.html b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.html index f2bd7bf94..83443b57b 100755 --- a/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.html @@ -42,7 +42,7 @@ fxLayoutAlign="center">
- + diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.html b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.html index 4a172f7d5..dd448c2ac 100755 --- a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.html @@ -43,7 +43,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.html b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.html index 1c1c11b7e..67567e5e8 100755 --- a/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.html @@ -41,7 +41,7 @@ fxLayoutAlign="center"> - + diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.html b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.html index ffcd6bdd7..fd4d127fb 100755 --- a/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.html +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-category/edit-category.component.html @@ -30,7 +30,7 @@
- +
\ No newline at end of file diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.html b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.html index 23a15f950..35eeeff6b 100755 --- a/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.html +++ b/ng6-seed/src/app/template/templates/templates-list/edit/edit-lender/edit-lender.component.html @@ -48,7 +48,7 @@
- +
\ No newline at end of file