- {{ prop.name }}
+ {{ prop.name | titlecase }}
@@ -386,7 +391,7 @@
- {{ freqn.name }}
+ {{ freqn.name | titlecase }}
@@ -418,7 +423,7 @@
- {{ ins_type.name }}
+ {{ ins_type.name | titlecase }}
@@ -457,7 +462,7 @@
- {{owner.applicant_name}}
+ {{owner.applicant_name | titlecase}}
@@ -470,7 +475,7 @@
- {{relations.name}}
+ {{relations.name | titlecase}}
@@ -487,7 +492,7 @@
- {{data.viewValue}}
+ {{data.viewValue | titlecase}}
@@ -512,7 +517,7 @@
- {{owner.applicant_name}}
+ {{owner.applicant_name | titlecase}}
@@ -525,7 +530,7 @@
- {{relations.name}}
+ {{relations.name | titlecase}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
index 40db78e79..d5b07223c 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
@@ -31,7 +31,7 @@ export class AssetsInfoComponent implements OnInit {
pageTitle: string ="Assets Details";
//@Input() pdid: number;
pdid:string;
- businessProfessionName :string;
+ //businessProfessionName :string;
public _assetsQuesFrom: FormGroup;
public submitted = false;
@@ -183,6 +183,7 @@ public m_investmentType = [];
// ]
private notifier: NotifierService;
+ existCompanyList: any =[];
constructor(
notifier: NotifierService,
private _formBuilder: FormBuilder,
@@ -216,9 +217,14 @@ public m_investmentType = [];
ngOnInit() {
- this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
- this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
- });
+ // this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
+ // this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
+ // });
+ this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
+ if(data.dataStatus){
+ this.existCompanyList = data.records.filter(val =>val.is_active);
+ }
+ })
this.getPdSupplierFormDetails();
this.getM_Assets_Type();
@@ -348,7 +354,7 @@ public m_investmentType = [];
this.initDetails(),
]),
business_assets_details : this._formBuilder.array([
- this.initBusinessDetails(this.businessProfessionName),
+ this.initBusinessDetails(),
]),
assets_form_remark:['']
});
@@ -382,12 +388,12 @@ public m_investmentType = [];
});
}
- initBusinessDetails(data) {
+ initBusinessDetails() {
return this._formBuilder.group({
business_assets_mode: [''],
business_details: this._formBuilder.array([]),
business_approximate_market_value: [''],
- business_name_of_the_owner: [data],
+ business_name_of_the_owner: [],
//other_owner:[''],
//relation:[''],
//purchase_year: [''],
@@ -402,9 +408,6 @@ public m_investmentType = [];
show: boolean;
selectedAssetsType(e: any, i: any,flag : any): void {
- console.log(e);
- console.log(i);
- console.log(flag);
let val = i;
if(flag == 1){
const arr = (
this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
@@ -551,11 +554,10 @@ public m_investmentType = [];
});
}
-
-
- loadPropertyWithData(data) {
+ loadPropertyWithData(data) {
return this._formBuilder.group({
- property_type: [data.property_type]
+ property_type: [data.property_type],
+ other_property_type: [data.other_property_type]
//property_type:['']
});
}
@@ -740,28 +742,41 @@ public m_investmentType = [];
setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
let val = i;
- // var data = Object.keys(datas).map(function (key) {
+ // let data = Object.keys(datas).map(function (key) {
// return datas[key];
// });
- // alert(JSON.stringify(datas));
+ //alert('JSON Other Asset'+JSON.stringify(datas));
let data = datas;
+
const arr = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
arr.controls.splice(0);
switch (assets_details_mode) {
case '1': {
+ let array_data : any;
+ data.forEach((datas,i) => {
+ array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type };
+ });
const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
- control.push(this.loadPropertyWithData(data));
+ control.push(this.loadPropertyWithData(array_data));
break;
}
case '2': {
+ let array_data : any;
+ data.forEach((datas,i) => {
+ array_data = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler };
+ });
const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
- control.push(this.load_Four_WeelerWithData(data));
+ control.push(this.load_Four_WeelerWithData(array_data));
break;
}
case '3': {
+ let array_data : any;
+ data.forEach((datas,i) => {
+ array_data = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler };
+ });
const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
- control.push(this.load_Two_WeelerWithData(data));
+ control.push(this.load_Two_WeelerWithData(array_data));
break;
}
case '4': {
@@ -770,34 +785,60 @@ public m_investmentType = [];
break;
}
case '5': {
+ let array_data : any;
+ data.forEach((datas,i) => {
+ array_data = { 'consumer_durable_description': datas.consumer_durable_description };
+ });
const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
- control.push(this.loadConsumerDurableDescriptionWithData(data));
+ control.push(this.loadConsumerDurableDescriptionWithData(array_data));
break;
}
case '6': {
+ let array_data : any;
data.forEach((datas,i) => {
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
+ array_data = {
+ 'premium_paid': datas.premium_paid,
+ 'frequency_mode': datas.frequency_mode,
+ 'other_frequency_mode':datas.other_frequency_mode,
+ 'sum_assured': datas.sum_assured,
+ 'members_coverd': datas.members_coverd
+ };
});
const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
- control.push(this.loadInsuranceDescriptionWithData(data));
+ control.push(this.loadInsuranceDescriptionWithData(array_data));
break;
}
case '7': {
+ let array_data : any;
data.forEach((datas,i) => {
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
+ array_data = { 'investments_type': datas.investments_type,
+ 'other_investments_type' : datas.other_investments_type,
+ 'amount_of_invest': datas.amount_of_invest,
+ 'bank_name': datas.bank_name };
});
const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
- control.push(this.loadInvestDescriptionWithData(data));
+ control.push(this.loadInvestDescriptionWithData(array_data));
break;
}
case '8': {
+ let array_data : any;
data.forEach((datas,i) => {
- this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
+ array_data = { 'any_other_assets': datas.any_other_assets,
+ 'name_of_the_owner':datas.name_of_the_owner,
+ 'other_owner':datas.other_owner,
+ 'relation':datas.relation,
+ 'any_other_asset_value' : datas.any_other_asset_value,
+ 'any_other_asset_loan' : datas.any_other_asset_loan,
+ 'other_asset_emi_amt' : datas.other_asset_emi_amt
+ };
+ this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value);
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
});
const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
- control.push(this.otherAssetsDescriptionWithData(data));
+ control.push(this.otherAssetsDescriptionWithData(array_data));
break;
}
default: {
@@ -807,60 +848,97 @@ public m_investmentType = [];
}
setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
- console.log(datas);
+
let val = i;
let data = datas;
+
const arr = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
arr.controls.splice(0);
switch (assets_details_mode) {
case '1': {
+ let business_property_datas : any;
+ data.forEach((datas,i) => {
+ business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type };
+ });
const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
- control.push(this.loadPropertyWithData(data));
+ control.push(this.loadPropertyWithData(business_property_datas));
break;
}
case '2': {
+ let business_Four_Weeler_datas : any;
+ data.forEach((datas,i) => {
+ business_Four_Weeler_datas = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler };
+ });
const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
- control.push(this.load_Four_WeelerWithData(data));
+ control.push(this.load_Four_WeelerWithData(business_Four_Weeler_datas));
break;
}
case '3': {
+ let business_Two_Weeler_datas : any;
+ data.forEach((datas,i) => {
+ business_Two_Weeler_datas = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler };
+ });
const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
- control.push(this.load_Two_WeelerWithData(data));
+ control.push(this.load_Two_WeelerWithData(business_Two_Weeler_datas));
break;
}
case '4': {
break;
}
case '5': {
+ let business_ConsumerDurableDescription_datas : any;
+ data.forEach((datas,i) => {
+ business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description };
+ });
const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
- control.push(this.loadConsumerDurableDescriptionWithData(data));
+ control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas));
break;
}
case '6': {
+ let business_InsuranceDescription_datas : any;
data.forEach((datas,i) => {
this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
+ business_InsuranceDescription_datas = {
+ 'premium_paid': datas.premium_paid,
+ 'frequency_mode': datas.frequency_mode,
+ 'other_frequency_mode':datas.other_frequency_mode,
+ 'sum_assured': datas.sum_assured,
+ 'members_coverd': datas.members_coverd
+ };
});
const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
- control.push(this.loadInsuranceDescriptionWithData(data));
+ control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas));
break;
}
case '7': {
+ let business_InvestDescription_datas : any;
data.forEach((datas,i) => {
this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
+ business_InvestDescription_datas = { 'investments_type': datas.investments_type,
+ 'other_investments_type' : datas.other_investments_type,
+ 'amount_of_invest': datas.amount_of_invest,
+ 'bank_name': datas.bank_name };
});
const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
- control.push(this.loadInvestDescriptionWithData(data));
+ control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas));
break;
}
case '8': {
+ let array_datas : any;
data.forEach((datas,i) => {
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
+ array_datas = {
+ 'any_other_assets': datas.any_other_assets,
+ 'any_other_asset_value' : datas.any_other_asset_value,
+ 'any_other_asset_loan' : datas.any_other_asset_loan,
+ 'other_asset_emi_amt' : datas.other_asset_emi_amt
+ };
});
const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
- control.push(this.otherBusinessAssetsDescriptionWithData(data));
+ control.push(this.otherBusinessAssetsDescriptionWithData(array_datas));
break;
}
default: {
@@ -878,7 +956,7 @@ public m_investmentType = [];
control.push(this.initDetails());
}else if(flag == 2){
const control = this._assetsQuesFrom.controls['business_assets_details'];
- control.push(this.initBusinessDetails(this.businessProfessionName));
+ control.push(this.initBusinessDetails());
}
}
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
new file mode 100644
index 000000000..a5a1581a8
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html
@@ -0,0 +1,29 @@
+
+
{{pageTitle}}
+
+
+
+
+
+
+
+
+
+ {{companyList.company_name | titlecase}}
+
+
+
+
+
+
+
+ {{ formButton.form_name }}
+
+
+
+
+
+
+
+
+
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
new file mode 100644
index 000000000..eb88eeecc
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss
@@ -0,0 +1,33 @@
+.paragraph_change {
+ color: #fff !important;
+ background-color: #e00201 !important;
+ }
+
+ .p-text {
+ color:#e00201 !important;
+ font-weight: bold;
+ }
+ ::ng-deep .mat-card-header-text{
+ margin:0px !important;
+}
+.mat-purple{
+ background-color: gray !important;
+}
+ .cdk-global-overlay-wrapper{
+ justify-content: center !important;
+}
+
+ $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
+mat-card .child_mat_card > mat-card {
+ border-radius: 0px 0px 0px 15px;
+ box-shadow: $base-card-box-shadow;
+ transform: scale(0.95);
+ transition: box-shadow 0.5s, transform 0.5s;
+ &:hover {
+ cursor: pointer;
+ // background-color: #e00201 !important;
+ transform: scale(1);
+ box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
+ }
+
+ }
\ No newline at end of file
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
new file mode 100644
index 000000000..ee3eb698a
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { BusinessInfoGroupComponent } from './business-info-group.component';
+
+describe('BusinessInfoGroupComponent', () => {
+ let component: BusinessInfoGroupComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ BusinessInfoGroupComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(BusinessInfoGroupComponent);
+ 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/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
new file mode 100644
index 000000000..8e3afd45b
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts
@@ -0,0 +1,110 @@
+import { Component,OnInit,Inject,Input} from '@angular/core';
+import { NotifierService } from 'angular-notifier';
+import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
+/** Service */
+import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
+import {ActivatedRoute, Router} from "@angular/router";
+import {SupplierInfoComponent} from './../../forms/supplier-info/supplier-info.component';
+import {ClientInfoComponent} from './../../forms/client-info/client-info.component';
+import {StockComponent} from './../../forms/stock/stock.component';
+import {FinancialInfoComponent} from './../../forms/financial-info/financial-info.component';
+import {BusinessInfoComponent} from './../../forms/business-info/business-info.component';
+
+@Component({
+ selector: 'app-business-info-group',
+ templateUrl: './business-info-group.component.html',
+ styleUrls: ['./business-info-group.component.scss']
+})
+export class BusinessInfoGroupComponent implements OnInit {
+ pageTitle: string ="Business Informations";
+ existCompanyList: any = [];
+ pdid: number;
+ form_id: number;
+ constructor(notifier: NotifierService,
+ private route: ActivatedRoute,
+ private router: Router,
+ private _pd: PdTrigerService,
+ @Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) {
+ this.pdid = this.pd_all_details.pdmaster_details.pd_id;
+ this.form_id = 13;
+ }
+
+ ngOnInit() {
+ this.getCompanyListForBusiness();
+ }
+ getCompanyListForBusiness(): void{
+ this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
+ if(data.dataStatus){
+ this.existCompanyList = data.records.filter(val =>val.is_active);
+ }
+ })
+ }
+
+ // direct form based questions
+ OnSelectBusinessGroupForms(details: any, company: any) {
+ this.pd_all_details.company_id =company.company_order_id;
+ this.pd_all_details.company_name =company.company_name;
+ if(details.form_id==1){
+ const dialogRef = this.dialog.open(SupplierInfoComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+ else if(details.form_id==2){
+ const dialogRef = this.dialog.open(ClientInfoComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+ else if(details.form_id==11){
+ const dialogRef = this.dialog.open(StockComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+ else if(details.form_id==13){
+ const dialogRef = this.dialog.open(BusinessInfoComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+ else if(details.form_id==14){
+ const dialogRef = this.dialog.open(FinancialInfoComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+
+}
+
+}
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 5ce935af8..eb4f59014 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
@@ -26,8 +26,8 @@
- {{company | titlecase}}
- Others
+ {{company.company_name | titlecase}}
+
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 3bb8344ef..c83451042 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
@@ -32,8 +32,10 @@ import {DatePipe } from '@angular/common';
export class BusinessInfoComponent implements OnInit {
pipe = new DatePipe('en-US');
pdid: number;
+ company_id: String;
+ company_name: String;
form_id: number;
- pageTitle: string ="Business Details";
+ pageTitle: string ="Business Information";
relationData: any = [];
companyRelationShipList: any =[];
//industryData: any = [];
@@ -60,6 +62,8 @@ export class BusinessInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) {
//this.adapter.setLocale('fr');
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.applicants = this.pd_all_details.pdapplicants_detials;
this.form_id = 13;
this.notifier = notifier;
@@ -101,6 +105,7 @@ export class BusinessInfoComponent implements OnInit {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
this._pd.retriveForm(params).subscribe(data => {
let businessVal = data.records;
let constVal: any;
@@ -163,6 +168,7 @@ export class BusinessInfoComponent implements OnInit {
businessVal.pdid = this.pdid;
businessVal.formid = this.form_id;
+ businessVal.company_id = this.company_id;
businessVal.fk_createdby = this.pdid;
//businessVal.designation = DesgnArray;
businessVal.partners = PartnrArray;
@@ -562,8 +568,9 @@ export class BusinessInfoComponent implements OnInit {
this.businessForm = this.fb.group({
pdid: this.pdid,
formid: this.form_id,
+ company_id: this.company_id,
fk_createdby: this.pdid,
- profession_name: ['', Validators.compose([Validators.required])],
+ profession_name: [this.company_name, Validators.compose([Validators.required])],
business_entity_type: ['', Validators.compose([Validators.required])],
business_years: ['', Validators.compose([Validators.required])],
business_month: ['', Validators.compose([Validators.required])],
@@ -1266,7 +1273,7 @@ export class BusinessInfoComponent implements OnInit {
getCompanyListForBusiness(): void{
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
- this.existCompanyList = data.records;
+ this.existCompanyList = data.records.filter(val =>val.is_active && val.company_order_id==this.company_id);
}
})
}
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 913f9c583..e8fc68ee6 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
@@ -35,7 +35,7 @@ export class ClientInfoComponent implements OnInit {
//@Input() pdid: number;
pdid: string;
form_id: number;
-
+ company_id: string;
public _supplierQuesFrom: FormGroup;
public submitted = false;
@@ -78,6 +78,7 @@ export class ClientInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 2;
+ this.company_id = this.pd_all_details.company_id;
this.notifier = notifier;
}
public viewerOptions: any = {
@@ -103,8 +104,7 @@ export class ClientInfoComponent implements OnInit {
noRecordsFound: Boolean = false;
errorMessage: any = '';
ngOnInit() {
-
- this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
+ this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,this.company_id).subscribe(data => {
if(data.dataStatus){
// let datas = {
// "profession_name": "Others",
@@ -151,7 +151,11 @@ export class ClientInfoComponent implements OnInit {
retaildTradingForm: Boolean = false;
initFormLoadDetails(record) {
- this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '2').subscribe(
+ let params: any = {};
+ params.pd_id = this.pdid;
+ params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
+ this.pdTrigerService.retriveForm(params).subscribe(
data => {
if (data.dataStatus) {
let dataForm = data.records;
@@ -159,6 +163,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['2'],
+ company_id:[this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
@@ -244,6 +249,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['2'],
+ company_id:[this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
index 9c08883a6..0904b395e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
@@ -33,6 +33,7 @@ export class FinancialInfoComponent implements OnInit {
pageTitle: string ="Financial Information";
pdid: string;
form_id: number;
+ company_id: string;
public financialForm: FormGroup;
private notifier: NotifierService;
SalesStatement : any = [];
@@ -57,6 +58,7 @@ export class FinancialInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 14;
+ this.company_id =this.pd_all_details.company_id;
this.notifier = notifier;
}
public viewerOptions: any = {
@@ -84,6 +86,7 @@ export class FinancialInfoComponent implements OnInit {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
this._pd.retriveForm(params).subscribe(value => {
const financial_date = this.financialForm.controls['date_per_financial'];
const estimated_val = this.financialForm.controls['estimated_value'];
@@ -111,7 +114,6 @@ export class FinancialInfoComponent implements OnInit {
financial_date.push(this.createDate(''));
}
if (result_val.length > 0) {
- console.log(result_val);
result_val.forEach((val,index) => {
//console.log('dedrf',val.estimate_annual_sale);
this.AV_annualSalesInwords[index] = this._pd.convertNumberToWords(val.estimate_annual_sale);
@@ -125,6 +127,7 @@ export class FinancialInfoComponent implements OnInit {
}
retriveData.pdid = this.pdid;
retriveData.formid = this.form_id;
+ retriveData.company_id = this.company_id;
retriveData.fk_createdby = this.pdid;
this.financialForm.setValue(retriveData);
} else {
@@ -137,6 +140,7 @@ export class FinancialInfoComponent implements OnInit {
this.financialForm = this.fb.group({
pdid: this.pdid,
formid: this.form_id,
+ company_id: this.company_id,
fk_createdby: this.pdid,
financial_remarks: [''],
staring_financial_year : ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
@@ -248,7 +252,6 @@ export class FinancialInfoComponent implements OnInit {
}
selectedType(e: any): void {
- console.log(e);
if(e.value == 'yes'){
let startingYear = this.financialForm.controls['staring_financial_year'].value;
let totalFinYear = this.financialForm.controls['total_financial_year'].value;
@@ -261,7 +264,6 @@ export class FinancialInfoComponent implements OnInit {
}
if(array.length > 0 ){
- console.log(array.length);
array.value.forEach((val,index)=>{
let vals = {
@@ -326,32 +328,23 @@ export class FinancialInfoComponent implements OnInit {
// }
// }
calFinAnnualSale(index,detail){
- //alert('FIn Annual Sales Data');
- console.log(index);
- console.log()
let annual_sale = detail.value.financial_annual_sale;
if (index != 0) {
let array = this.financialForm.controls['date_per_financial'];
let prev_annual_sale = array.value[index-1].financial_annual_sale;
let annual_sale_variation = (( annual_sale - prev_annual_sale)/prev_annual_sale) * 100 ;
detail.controls.financial_annualsales_variation.setValue(annual_sale_variation.toFixed(2));
- console.log('annual sales variation in %',annual_sale_variation);
}
}
calculateEstimationAnnualSale(index,detail){
//alert('Function Inside');
- console.log(detail);
let annual_sale = detail.value.estimate_annual_sale;
- console.log(annual_sale);
- console.log(index);
- // console.log(annual_sale);
if (index != 0) {
let array = this.financialForm.controls['estimated_value'];
let prev_annual_sale = array.value[index-1].estimate_annual_sale;
let annual_sale_variation = (( annual_sale - prev_annual_sale)/prev_annual_sale) * 100 ;
detail.controls.estimate_annualsales_variation.setValue(annual_sale_variation.toFixed(2));
- console.log('estimate annual sales variation in %',annual_sale_variation);
}
}
@@ -363,25 +356,16 @@ export class FinancialInfoComponent implements OnInit {
if ( (profit != '' || loss != '') && index != 0) {
let array = this.financialForm.controls['date_per_financial'];
-
- console.log('Profit',profit);
- console.log(Math.abs(profit));
+
let prev_profit = array.value[index - 1].financial_net_profit != '' ? array.value[index - 1].financial_net_profit : 0;
- console.log('Profitpre',prev_profit);
let prev_loss = array.value[index - 1].financial_net_loss !='' ? array.value[index - 1].financial_net_loss : 0 ;
let prev_year = array.value[index - 1].financial_year;
let prev_annual_sale = array.value[index-1].financial_annual_sale;
- console.log('loss',loss);
loss = loss != 0 ? loss * (-1) : loss;
- console.log('-1 loss',loss);
- console.log('pre_loss',prev_loss);
prev_loss = prev_loss != 0 ? prev_loss * (-1) : prev_loss ;
- console.log('-1 pre loss',prev_loss);
- console.log(Math.abs(profit));
//let variation2 = ((()))
let variation = (((profit != '' ? profit : loss ) - (prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100;
//console.log('console.log(Math.abs(profit));',Math.abs(variation));
- console.log(variation);
// let variation ;
// if(profit != ''){
// variation = (((profit != '' ? profit : loss ) - ( prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? prev_profit : prev_loss)) * 100 * (profit != '' ? (1) : (-1)) ;
@@ -396,7 +380,6 @@ export class FinancialInfoComponent implements OnInit {
detail.controls.financial_variation.setValue(variation.toFixed(2));
//Increase in Sales in FY 2017-18 over sales in FY 2016-17 is 11.11%
- console.log('variation in %',variation);
// this.SalesStatement[index] = ( variation <= 0 ? 'Decreases ' : 'Increases ' ) + 'in Sales in FY ' + curr_year + ' Over Sales in FY '+ prev_year + ' is ' + variation.toFixed(2) + '%';
// console.log('this.SlesStatement',this.SalesStatement);
@@ -438,7 +421,6 @@ export class FinancialInfoComponent implements OnInit {
// }
calMargin(index, detail) {
- console.log('detail', detail);
// let array = this.financialForm.controls['date_per_financial'];
let salary = detail.value.financial_annual_sale;
// let prev_annual_sale = array.value[index-1].financial_annual_sale;
@@ -500,7 +482,6 @@ export class FinancialInfoComponent implements OnInit {
if ( (profit != '' || loss != '') && index != 0) {
let array = this.financialForm.controls['estimated_value'];
- console.log(array.value[index - 1].financial_net_profit);
let prev_profit = array.value[index - 1].estimate_net_profit != '' ? array.value[index - 1].estimate_net_profit : 1;
let prev_loss = array.value[index - 1].estimate_net_loss !='' ? array.value[index - 1].estimate_net_loss : 1;
@@ -522,9 +503,7 @@ export class FinancialInfoComponent implements OnInit {
}
calMarginVal(index, detail) {
- console.log('Margin Estimate VAR',detail);
let salary = detail.value.estimate_annual_sale;
- console.log('Margin Estimate Vsalary',salary);
// if (salary != '' && profit != '') {
// let margin = profit / salary * 100;
@@ -535,23 +514,16 @@ export class FinancialInfoComponent implements OnInit {
if(detail.value.estimate_profit_or_loss == 1){
let profit = detail.value.estimate_net_profit;
- console.log('if Margin Profit',profit);
if (salary != '' && profit != '') {
- console.log('if if Margin Estimate salary',salary);
- console.log('if if Margin Profit',profit);
let margin = profit / salary * 100;
- console.log('margin',margin);
detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
}
}
else if (detail.value.estimate_profit_or_loss == 2){
let loss = detail.value.estimate_net_loss;
- console.log('else if Margin loss',loss);
if (salary != '' && loss != '') {
- console.log('elseif if Margin Estimate salary',salary);
- console.log('alseif if Margin loss',loss);
let margin = (loss / salary) * 100 * (-1);
detail.controls.estimate_margin_of_loss.setValue(margin.toFixed(2));
@@ -589,7 +561,6 @@ export class FinancialInfoComponent implements OnInit {
// }
calProfitAndLossVal( i, detail) {
- console.log(detail);
let salary = detail.value.estimate_annual_sale;
if(detail.value.estimate_profit_or_loss == 1){
let margin_profit = detail.value.estimate_margin_of_profit;
@@ -683,9 +654,7 @@ export class FinancialInfoComponent implements OnInit {
// return;
// }
let records = this.financialForm.value;
- console.log('data', records);
this._pd.saveForm(records).subscribe(data => {
- console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.');
//this.dialogRef.close();
}, error => {
@@ -716,10 +685,6 @@ export class FinancialInfoComponent implements OnInit {
/** To Convert Amount into Words */
inWords(e,i,flag:number){
-
- // console.log(e);
- // console.log(i);
- // console.log(flag);
switch(flag){
case 1 :
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html
old mode 100755
new mode 100644
index 1f2a2a3d3..e6e6f6e03
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html
@@ -77,8 +77,125 @@
+
+
+
+
+ Person Relationship
+
+
+ 0" formArrayName="persons_with_relationships">
+
+ Name
+
+
+ {{details.value.applicant_name | titlecase}}
+
+
+
+ Relation
+
+
+
+ Select
+ {{member.name + ' of' | titlecase}}
+ Not Applicable
+
+
+
+
+
+ Relationship To
+
+
+
+ Select
+ {{appc.applicant_name | titlecase}}
+ Not Applicable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Company/Firm Relationship
+
+
+
+
+
+ 0" formArrayName="company_with_relationships">
+
+
+ Applicant
+
+
+
+ {{appc.applicant_name | titlecase}}
+
+
+
+
+
+ Relation
+
+
+ Select
+
+ {{comrelShip.name + ' of' | titlecase}}
+
+ Not Applicable
+
+
+
+
+
+ Company
+
+
+
+ Select
+
+ {{comp.company_name | titlecase}}
+
+ Not Applicable
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss
old mode 100755
new mode 100644
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.spec.ts
old mode 100755
new mode 100644
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts
old mode 100755
new mode 100644
index 4461cf6b4..59f119594
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts
@@ -15,10 +15,16 @@ export class GeneralInfoComponent implements OnInit {
pageTitle: string ="General Information";
pdid : string;
form_id:number;
+ is_new : boolean;
+ count : number = 1;
private notifier: NotifierService;
public _generalForm: FormGroup;
displayedColumns = ['applicant_name','is_person_met','is_applicant'];
public individualsSource= new MatTableDataSource();
+ public relationSource= new MatTableDataSource();
+ public CompanySource = new MatTableDataSource();
+ secondDisplayedColumns = ['applicant_name','relation','relation_to'];
+ thridDisplayedColumns = ['applicant_name','company_relationship','relation_to_company'];
public pd_applicants_details: any;
relationShipList:any=[];
companyRelationShipList:any=[];
@@ -51,6 +57,19 @@ export class GeneralInfoComponent implements OnInit {
let control = this._generalForm.controls['companies'];
this.companyList = control.value.filter(element =>element.company_name && element.is_active);
});
+
+ this._generalForm.controls['persons_with_relationships'].valueChanges.subscribe(val=>{
+ let control = this._generalForm.controls['persons_with_relationships'];
+ this.relationSource.data =control.controls;
+ //this.individualsList = control.value.filter(element =>element.is_applicant===true);
+ });
+
+ // change relation with businees update dat sorce table
+ this._generalForm.controls['company_with_relationships'].valueChanges.subscribe(val=>{
+ let ComapnyControl = this._generalForm.controls['company_with_relationships'];
+ this.CompanySource .data =ComapnyControl.controls;
+ });
+
}
// init form
@@ -58,11 +77,13 @@ export class GeneralInfoComponent implements OnInit {
this._generalForm = this._fb.group({
pdid:this.pdid,
formid:this.form_id,
- applicant_relation: this._fb.array([]),
+ //applicant_relation: this._fb.array([]),
individuals: this._fb.array([]),
companies: this._fb.array([]),
+ persons_with_relationships: this._fb.array([]),
+ company_with_relationships: this._fb.array([]),
general_remark:''
- });
+ })
this.loadFormData();
}
// get all master details
@@ -72,10 +93,12 @@ export class GeneralInfoComponent implements OnInit {
if (data.status == 200) {
if(type==1){
this.relationShipList=data.records.filter(item => item.isactive == 1);
- this.relationShipList.push({'relationship_id':"0",'name':'Others'});
+
+ //this.relationShipList.push({'relationship_id':"0",'name':'Not Applicable'});
}
if(type==2){
this.companyRelationShipList=data.records.filter(item => item.isactive == 1);
+ this.companyRelationShipList=data.records.filter(item => item.name != 'Others');
}
}
@@ -89,13 +112,18 @@ export class GeneralInfoComponent implements OnInit {
params.pd_form_id = '18';
let individualsControl = this._generalForm.controls['individuals'];
let companyControl = this._generalForm.get('companies') as FormArray;
- let relationControl = this._generalForm.controls['applicant_relation'];
+ //let relationControl = this._generalForm.controls['applicant_relation'];
+ let personsWithRelationshipsControl = this._generalForm.controls['persons_with_relationships'];
+ let companyWithRelationshipsControl = this._generalForm.controls['company_with_relationships'];
individualsControl.controls = [];
- relationControl.controls = [];
+ //relationControl.controls = [];
companyControl.controls = [];
+ personsWithRelationshipsControl.controls = [];
let exist_individuals:any;
let exist_companies:any;
let exist_relation:any;
+ let exist_personsWithRelationships:any;
+ let exist_companyWithRelationships:any;
this._pd.retriveForm(params).subscribe(data => {
if(data.dataStatus) {
this._generalForm.controls['general_remark'].setValue(data.records.general_remark ? data.records.general_remark : '');
@@ -110,6 +138,30 @@ export class GeneralInfoComponent implements OnInit {
individualsControl.push(this.createIndividulas(element))
});
}
+
+ // create persons with relationships
+ exist_personsWithRelationships=Object.keys(data.records.persons_with_relationships).map(function(key) {
+ return data.records.persons_with_relationships[key];
+ });
+
+ if(exist_personsWithRelationships.length>0){
+ exist_personsWithRelationships.forEach(element => {
+ //individualsControl.push(this.createIndividulas(element))
+ personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element));
+ });
+ }
+
+ exist_companyWithRelationships=Object.keys(data.records.company_with_relationships).map(function(key) {
+ return data.records.company_with_relationships[key];
+ });
+
+ if(exist_companyWithRelationships.length>0){
+ exist_companyWithRelationships.forEach(element => {
+ //individualsControl.push(this.createIndividulas(element))
+ companyWithRelationshipsControl.push(this.createCompaniesRelationshipWithData(element));
+ });
+ }
+
// create companies
exist_companies = Object.keys(data.records.companies).map(function(key) {
return data.records.companies[key];
@@ -127,37 +179,39 @@ export class GeneralInfoComponent implements OnInit {
}
// create relations
- exist_relation = Object.keys(data.records.applicant_relation).map(function(key) {
- return data.records.applicant_relation[key];
- });
- if(exist_relation.length>0){
- exist_relation.forEach((element,index) => {
- relationControl.push(this.createApplicantRelation(element));
- let innerrelControl:any = relationControl.controls[index].get('multiple_relation') as FormArray;
- element.multiple_relation.forEach((innereElement) => {
- innerrelControl.push(this.createMultipleRelation(innereElement));
- });
- let innercomrelControl:any = relationControl.controls[index].get('multiple_company_relation') as FormArray;
- element.multiple_company_relation.forEach((innerecomElement) => {
- innercomrelControl.push(this.createMultipleCompanyRelation(innerecomElement));
- });
- });
- }
+ // exist_relation = Object.keys(data.records.applicant_relation).map(function(key) {
+ // return data.records.applicant_relation[key];
+ // });
+ // if(exist_relation.length>0){
+ // exist_relation.forEach((element,index) => {
+ // relationControl.push(this.createApplicantRelation(element));
+ // let innerrelControl:any = relationControl.controls[index].get('multiple_relation') as FormArray;
+ // element.multiple_relation.forEach((innereElement) => {
+ // innerrelControl.push(this.createMultipleRelation(innereElement));
+ // });
+ // let innercomrelControl:any = relationControl.controls[index].get('multiple_company_relation') as FormArray;
+ // element.multiple_company_relation.forEach((innerecomElement) => {
+ // innercomrelControl.push(this.createMultipleCompanyRelation(innerecomElement));
+ // });
+ // });
+ // }
}
else {
this.pd_applicants_details.forEach((element,key) => {
element.is_applicant=true;
element.is_person_met=false;
+ element.is_new=false;
element.individuals_order_id = key+1
individualsControl.push(this.createIndividulas(element));
- let relationControl = this._generalForm.controls['applicant_relation'];
- let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1};
- relationControl.push(this.createApplicantRelation(applicant_details));
- let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
- mulRelationControl.push(this.createMultipleRelation(applicant_details))
- let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
- mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
+ personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element));
+ //let relationControl = this._generalForm.controls['applicant_relation'];
+ // let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1};
+ // relationControl.push(this.createApplicantRelation(applicant_details));
+ // let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
+ // mulRelationControl.push(this.createMultipleRelation(applicant_details))
+ // let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
+ // mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
// create companies
if(element.company_name!='' && element.company_name!=null){
@@ -182,9 +236,17 @@ export class GeneralInfoComponent implements OnInit {
applicant_name: [elementValue.applicant_name],
is_applicant:[elementValue.is_applicant],
is_person_met:[elementValue.is_person_met],
+ is_new:[elementValue.is_new],
individuals_order_id: [elementValue.individuals_order_id],
});
}
+ createPersonsWithRelationships(elementValue:any){
+ return this._fb.group({
+ applicant_name: [elementValue.applicant_name],
+ relationship:[elementValue.relationship],
+ relation_to:[elementValue.relation_to],
+ });
+ }
// create companies
createCompanies(elementValue:any) {
return this._fb.group({
@@ -194,6 +256,46 @@ export class GeneralInfoComponent implements OnInit {
});
}
+ // createCompaniesRelationship(elementValue:any) {
+ // return this._fb.group({
+ // applicant_name:[elementValue.applicant_name],
+ // company_relationship:[elementValue.company_relationship],
+ // relation_to_company:[elementValue.relation_to_company]
+ // });
+ // }
+
+ createCompaniesRelationship() {
+ return this._fb.group({
+ applicant_name:[''],
+ company_relationship:[''],
+ relation_to_company:['']
+ });
+ }
+
+ createCompaniesRelationshipWithData(elementValue:any) {
+ return this._fb.group({
+ applicant_name:[elementValue.applicant_name],
+ company_relationship:[elementValue.company_relationship],
+ relation_to_company:[elementValue.relation_to_company]
+ });
+ }
+
+ // open other family family member details
+ addCompanyRelationshipDialogue() {
+ let control: any = this._generalForm.get('company_with_relationships') as FormArray;
+ //let setValues: any = { applicant_name:'', company_relationship:'',relation_to_company:''};
+ control.push(this.createCompaniesRelationship())
+ }
+
+ // remove other famil membre
+ removeCompanyRelationship(indexValues){
+ let control: any = this._generalForm.get('company_with_relationships') as FormArray;
+ control.removeAt(indexValues);
+ // control.controls[indexValues].controls.company_name.clearValidators();
+ // control.controls[indexValues].controls.company_name.updateValueAndValidity();
+ //control.removeAt(indexValues);
+ }
+
// add more companies
addMoreCompanies() {
let control: any = this._generalForm.get('companies') as FormArray;
@@ -203,6 +305,8 @@ export class GeneralInfoComponent implements OnInit {
// remove companies
removeCompanies(indexValues) {
+ this.count = this.count-1;
+ console.log('removed Count',this.count);
let control: any = this._generalForm.get('companies') as FormArray;
control.controls[indexValues].controls.is_active.setValue(false);
control.controls[indexValues].controls.company_name.clearValidators();
@@ -279,6 +383,7 @@ export class GeneralInfoComponent implements OnInit {
// add more individuals details
addMoreIndividuals() {
+ console.log('Initial Count',this.count);
const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, {
data: '',
width:'40%',
@@ -287,17 +392,27 @@ export class GeneralInfoComponent implements OnInit {
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.data.length>0){
- dataresult.data.forEach(element => {
+ dataresult.data.forEach((element,index) => {
+ console.log('Foreach Entry Count',this.count);
let individualsControl = this._generalForm.controls['individuals'];
+ element.pd_co_applicant_id = this.count;
+ this.count = this.count+1;
element.individuals_order_id = individualsControl.controls.length+1;
+ element.is_new=true;
individualsControl.push(this.createIndividulas(element));
- let relationControl = this._generalForm.controls['applicant_relation'];
- let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','other_relation':'','company_name':'','company_relation':'','company_other_relation':'','individuals_order_id':element.individuals_order_id};
- relationControl.push(this.createApplicantRelation(applicant_details));
- let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
- mulRelationControl.push(this.createMultipleRelation(applicant_details))
- let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
- mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
+ console.log('Foreach Entry Count with Incremented',this.count);
+ console.log('Final Count',this.count);
+ let relationControl = this._generalForm.controls['persons_with_relationships'];
+ let applicant_details: any= {'applicant_name':element.applicant_name,'relationship':'','relation_to':''};
+ relationControl.push(this.createPersonsWithRelationships(applicant_details));
+
+ // let relationControl2 = this._generalForm.controls['applicant_relation'];
+ // let applicant_details2: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','other_relation':'','company_name':'','company_relation':'','company_other_relation':'','individuals_order_id':element.individuals_order_id};
+ // relationControl2.push(this.createApplicantRelation(applicant_details2));
+ // let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
+ // mulRelationControl.push(this.createMultipleRelation(applicant_details))
+ // let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
+ // mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
});
}
@@ -314,21 +429,26 @@ export class GeneralInfoComponent implements OnInit {
// submit form details
submitGeneralForm(formData:any) {
if (this._generalForm.invalid) {
+ console.log('if',this._generalForm.value);
this.validateAllFormFields(this._generalForm);
return;
}
- else if(formData.applicant_relation.length==0){
- this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
-
- }
+ // else if(formData.applicant_relation.length==0){
+ // console.log('else if',this._generalForm.value);
+ // this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
+ // }
else{
+ console.log('else',this._generalForm.value);
let saveRecords:any = {}
saveRecords.pdid=formData.pdid;
saveRecords.formid=formData.formid;
saveRecords.individuals=formData.individuals;
saveRecords.companies=formData.companies;
- saveRecords.applicant_relation=formData.applicant_relation;
+ saveRecords.persons_with_relationships=formData.persons_with_relationships;
+ saveRecords.company_with_relationships=formData.company_with_relationships;
+ //saveRecords.applicant_relation=formData.applicant_relation;
saveRecords.general_remark=formData.general_remark;
+ //console.log(saveRecords);
this._pd.savePDFormDetailsWithID(saveRecords).subscribe(
dataresult => {
if (dataresult.status == 200) {
@@ -345,12 +465,7 @@ export class GeneralInfoComponent implements OnInit {
});
}
}
- selectedApplicant(e,applicant_name){
- console.log(e);
- console.log(e.value);
- console.log(e.viewValue);
- console.log(applicant_name);
- }
+
// selectedfrequency(e,i){
// switch(+e){
// case 1: this.placeholderName[i] = 'Weekly Instalment Amount'; break;
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html
index 6002270aa..be93ee4b2 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html
@@ -139,7 +139,7 @@
- Mortgage
+ Details of Property being Mortgaged
@@ -185,10 +185,10 @@
-
+
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 cab80971e..a21ee4ad0 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
@@ -22,6 +22,7 @@ export class StockComponent implements OnInit {
pageTitle: string ="Stock Details";
pdid: number;
form_id: number;
+ company_id: string;
public stockForms: FormGroup;
private notifier: NotifierService;
public uomData : any = [];
@@ -60,6 +61,7 @@ export class StockComponent implements OnInit {
private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 11;
+ this.company_id = this.pd_all_details.company_id
this.notifier = notifier;
}
public viewerOptions: any = {
@@ -92,7 +94,7 @@ export class StockComponent implements OnInit {
// })
//this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(
- this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => {
+ this._pd.stockFormAccess({pd_id:this.pdid,company_id:this.company_id}).subscribe(data => {
if(data.dataStatus == true){
let datas = data.records;
@@ -119,18 +121,18 @@ export class StockComponent implements OnInit {
}
public initstockForms(record){
- console.log(record);
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
this._pd.retriveForm(params).subscribe(value => {
if (value.status == 200) {
let dataForm = value.records;
if(dataForm !== undefined) {
- console.log(dataForm);
this.stockForms = this.fb.group({
pdid: [this.pdid],
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)]),
@@ -138,7 +140,6 @@ export class StockComponent implements OnInit {
});
let arr = record.filter(data => data.type_of_activity_id == 1);
- console.log(133,arr.length);
if(arr.length > 0) {
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
console.log('136',value);
@@ -275,6 +276,7 @@ export class StockComponent implements OnInit {
this.stockForms = this.fb.group({
pdid: [this.pdid],
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)]),
@@ -356,11 +358,8 @@ export class StockComponent implements OnInit {
manufacturingForm: Boolean = false;
manufacturingFormCreation(record) {
- console.log(record);
let arr = record.filter(data => data.type_of_activity_id == 1);
- console.log(arr);
if (arr.length > 0) {
- console.log(arr.length);
this.manufacturingForm = true;
return this.fb.group({
manufacturing_raw_materials: this.fb.array([]),
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 4b328836f..62520e33b 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
@@ -37,7 +37,7 @@ export class SupplierInfoComponent implements OnInit {
//@Input() pdid: number;
pdid: string;
form_id: number;
-
+ company_id: string;
public _supplierQuesFrom: FormGroup;
public submitted = false;
@@ -51,6 +51,7 @@ export class SupplierInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 1;
+ this.company_id = this.pd_all_details.company_id
this.notifier = notifier;
}
public viewerOptions: any = {
@@ -76,7 +77,7 @@ export class SupplierInfoComponent implements OnInit {
noRecordsFound: Boolean = false;
errorMessage: any = '';
ngOnInit() {
- this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
+ this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => {
if(data.dataStatus){
// let datas = {
// "profession_name": "Others",
@@ -116,8 +117,12 @@ export class SupplierInfoComponent implements OnInit {
serviceProviderForm: Boolean = false;
initFormLoadDetails(record) {
+ let params: any = {};
+ params.pd_id = this.pdid;
+ params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
// alert(JSON.stringify(record));
- this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe(
+ this.pdTrigerService.retriveForm(params).subscribe(
data => {
if(data.dataStatus){
let dataForm = data.records;
@@ -125,6 +130,7 @@ export class SupplierInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
+ company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
@@ -154,6 +160,7 @@ export class SupplierInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
+ company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
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 17292f75b..5210ebc7e 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
@@ -26,7 +26,7 @@
-->
-
+