-
- {{errorMessage[i]}}
+
+ {{yearErrorMessage[i]}}
-
+
+ {{monthErrorMessage[i]}}
- Countries Where Max Sales Done for {{manufacturing.value.main_products}}
+ Cities Where Max Sales Done for {{manufacturing.value.main_products}}
{{MCL.city_name}}
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 b435db587..98eec7056 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
@@ -67,10 +67,13 @@ export class BusinessInfoComponent implements OnInit {
generalExistEntityType_other:string;
generalExistBusinessYear:Number;
generalExistBusinessMonth:Number;
- errorMessage: any = [];
+ yearErrorMessage: any = [];
+ monthErrorMessage: any = [];
errorMessageForExistTotalWorkExperience:any = [];
ExportFlag: boolean = false;
appxSalaryAmtInwords: any;
+ isreadonlyyear:any = [];
+ isreadonlymonth:any = [];
constructor(notifier: NotifierService,
private fb: FormBuilder,
@@ -89,7 +92,7 @@ export class BusinessInfoComponent implements OnInit {
this.generalExistEntityType = this.pd_all_details.business_entity_type;
this.generalExistEntityType_other = this.pd_all_details.business_entity_type_other;
this.generalExistBusinessYear = this.pd_all_details.business_years;
-
+ this.generalExistBusinessMonth = this.pd_all_details.business_month;
}
public viewerOptions: any = {
navbar: false,
@@ -200,6 +203,9 @@ export class BusinessInfoComponent implements OnInit {
businessVal.formid = this.form_id;
businessVal.company_id = this.company_id;
businessVal.fk_createdby = this.pdid;
+ if(businessVal.employees_appx_salary){
+ this.appxSalaryAmtInwords = this._pd.convertNumberToWords(businessVal.employees_appx_salary);
+ }
//businessVal.designation = DesgnArray;
businessVal.partners = PartnrArray;
businessVal.documents = DocArray;
@@ -1282,15 +1288,38 @@ export class BusinessInfoComponent implements OnInit {
}
/** To Convert Month into Year */
- ConvertMonthintoYear(itemrow,e){
+ ConvertMonthintoYear(itemrow,e,i){
let year = itemrow.controls.current_business_experiance_year.value;
let converted_month : number = e%12;
let converted_year : number = e/12;
- itemrow.controls.current_business_experiance_year.setValue(+year + +Math.floor(converted_year));
- itemrow.controls.current_business_experiance_month.setValue(Math.floor(converted_month));
+ let Year = +year + +Math.floor(converted_year);
+
+ if(Year > this.generalExistBusinessYear){
+ this.yearErrorMessage[i] = "Higher than Business Vintage";
+ itemrow.controls.current_business_experiance_year.setValue('');
+ itemrow.controls.current_business_experiance_month.setValue('');
+
+ }
+ else{
+ if(Year == this.generalExistBusinessYear && +converted_month > this.generalExistBusinessMonth)
+ {
+ this.monthErrorMessage[i] = "Higher than Business Vintage";
+ itemrow.controls.current_business_experiance_year.setValue('');
+ itemrow.controls.current_business_experiance_month.setValue('');
+
+ }else{
+ this.monthErrorMessage[i] = '';
+ this.yearErrorMessage[i] = '';
+ itemrow.controls.current_business_experiance_year.setValue(Year);
+ itemrow.controls.current_business_experiance_month.setValue(Math.floor(converted_month));
+ }
+ }
+
+ // itemrow.controls.current_business_experiance_year.setValue(+year + +Math.floor(converted_year));
+ // itemrow.controls.current_business_experiance_month.setValue(Math.floor(converted_month));
}
@@ -1573,14 +1602,29 @@ export class BusinessInfoComponent implements OnInit {
checkTotalEmployee(FormData){
this.businessForm.controls['employees_total'].setValue((+FormData.value.employees_permanent ||0)+(+FormData.value.employees_temporary||0));
}
+
+ changeOfStartedBusiness(members,i,e){
+ if(e == 'yes'){
+ members.controls.current_business_experiance_year.setValue(this.generalExistBusinessYear);
+ this.isreadonlyyear[i] = this.generalExistBusinessYear != undefined ? true : false;
+ members.controls.current_business_experiance_month.setValue(this.generalExistBusinessMonth);
+ this.isreadonlymonth[i] = this.generalExistBusinessMonth != undefined ? true : false;
+ }
+ else{
+ this.isreadonlyyear[i] =false;
+ this.isreadonlymonth[i] = false;
+ }
+ }
+
+
checkWithExistBusinessYear(e,i,members){
if(+e > this.generalExistBusinessYear){
- this.errorMessage[i] = "Higher than Business Vintage";
+ this.yearErrorMessage[i] = "Higher than Business Vintage";
members.controls.current_business_experiance_year.setValue('');
}
else{
- this.errorMessage[i] = '';
+ this.yearErrorMessage[i] = '';
}
}
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 128a726a5..6088e72cc 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
@@ -30,7 +30,7 @@
-
+
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 114ea50f9..51370aed4 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
@@ -290,7 +290,7 @@
-
Residence Details
+
Residence Details of {{FamilyMemberAsLabel[ix]}}
@@ -361,6 +361,7 @@
+ Address Details of {{FamilyMemberAsLabel[ix]}}
@@ -373,7 +374,7 @@
-
+
@@ -419,7 +420,7 @@
-
+
@@ -429,15 +430,15 @@
-
-
- Add More Family Members
+ Add More Family Members Of {{FamilyMemberAsLabel[ix]}}
@@ -567,15 +568,23 @@
+
Remarks
+
- add
+
+
+ Add Family Details of Other Applicant
+
save
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts
index b71343363..426cc6e6c 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts
@@ -297,10 +297,12 @@ import { ActivatedRoute, Router } from "@angular/router";
export class FamilyDetailsComponent implements OnInit {
IncomePerMonth: any =[];
RentAmount: any = [];
+ FamilyMemberAsLabel: any = [];
//@Input() pdid: number;
pageTitle: string = "Family Details";
pdid: string;
form_id: number;
+ isReadOnly:any = [];
private notifier: NotifierService;
public familyForm: FormGroup;
@@ -377,6 +379,7 @@ export class FamilyDetailsComponent implements OnInit {
name:element.applicant_name,
relationship:element.relationship,
relation_to:element.relation_to,
+ age:'',
data_gets_from:'GeneralForm'};
});
// console.log('familyMembersGeneralForm',familyMembersGeneralForm);
@@ -393,6 +396,7 @@ export class FamilyDetailsComponent implements OnInit {
name:element.family_member_name,
relationship:element.other_family_relationship_id,
relation_to:element.relation_to_id,
+ age:'',
data_gets_from:'BusinessForm'};
});
// console.log('familyMembersGeneralForm',familyMembersBusinessForm);
@@ -623,24 +627,30 @@ export class FamilyDetailsComponent implements OnInit {
addMoreApplicantFamilyDetails(e): void {
e.stopPropagation();
- this.initFamilyForm('chck');
+ this.initFamilyForm(null);
}
selectedPerson(e,inx){
- // console.log(e);
- // console.log(this.apiFamilyMembers);
- // return;
-
+
+
+ this.FamilyMemberAsLabel[inx] = this.selectPerson.filter(item => item.pd_co_applicant_id == e)[0].applicant_name;
+
const control = this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
if(this.apiFamilyMembers.length>0){
let arraydata : any;
let data = this.apiFamilyMembers.filter(item => item.relation_to == e);
+
if(data.length > 0){
- data.forEach(val => {
+ data.forEach((val,inx) => {
+ if(val.age){
+ this.isReadOnly[inx] = true;
+ }else{
+ this.isReadOnly[inx] = false;
+ }
arraydata = {
'family_member_name' : val.name,
'family_member_relationship' : val.relationship,
- 'family_member_age' : '',
+ 'family_member_age' : val.age,
'family_member_earning_status': '',
'earning_segment': '',
'earning_gross_income_per_month': '',
@@ -654,7 +664,7 @@ export class FamilyDetailsComponent implements OnInit {
}
});
- control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
+ control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
}
else{
control.push(this.generateFamilyMembersDetailsGet());
@@ -665,15 +675,16 @@ export class FamilyDetailsComponent implements OnInit {
}
}
-addFamilyMembers(inx) {
- console.log(inx);
- const control = this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
- control.push(this.generateFamilyMembersDetailsGet());
+addFamilyMembers(inx,i) {
+ let mainControl = this.familyForm.get('family_details') as FormArray;
+ let control = mainControl.controls[inx].get('family_members_details') as FormArray;
+ control.push(this.generateFamilyMembersDetailsGet());
}
-removeFamilyMembers(index) {
- const control = this.familyForm.controls['family_details']['controls'][index].controls.family_members_details;
- control.removeAt(index);
+removeFamilyMembers(inx,i) {
+ let mainControl = this.familyForm.get('family_details') as FormArray;
+ let control = mainControl.controls[inx].get('family_members_details') as FormArray;
+ control.removeAt(i);
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html
index 8cf81bdfd..897029a2f 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html
@@ -139,8 +139,8 @@
- 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" placeholder="Variation of Profit % over sales" formControlName="financial_profit_to_sale_variation" (keypress)="keyPress($event)">
- 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" readonly>
+ 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" placeholder="Variation of Profit % over sales" formControlName="financial_profit_to_sale_variation" (keypress)="keyPress($event)" readonly>
+ 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}">
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}}
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 561c98fe8..8eebd8b22 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
@@ -501,7 +501,7 @@ export class FinancialInfoComponent implements OnInit {
if (salary != '' && profit != '') {
if(+profit>+salary){
alert("profit is greater than salary");
- detail.controls.financial_net_profit.setValue('');
+ detail.controls.financial_net_profit.setValue(0);
detail.controls.financial_margin_of_profit.setValue('');
detail.controls.financial_profit_to_sale_variation.setValue('');
detail.controls.financial_variation.setValue('');
@@ -521,7 +521,7 @@ export class FinancialInfoComponent implements OnInit {
if (salary != '' && loss != '') {
if(+loss>+salary){
alert("Loss is greater than salary");
- detail.controls.financial_net_loss.setValue('');
+ detail.controls.financial_net_loss.setValue(0);
detail.controls.financial_margin_of_loss.setValue('');
detail.controls.financial_profit_to_sale_variation.setValue('');
detail.controls.financial_variation.setValue('');
@@ -535,29 +535,28 @@ export class FinancialInfoComponent implements OnInit {
}
- if (((profit_margin != '' || profit_margin !== undefined) || (loss_margin != '' || loss_margin !== undefined) ) && index != 0) {
+ if ((profit_margin != '' || loss_margin != '') && index != 0) {
- console.log('Current profit_margin',profit_margin);
-
+
let array = this.financialForm.controls['date_per_financial'];
let prev_profit_margin = array.value[index - 1].financial__margin_of_profit != '' ? array.value[index - 1].financial_margin_of_profit : 0;
let prev_loss_margin = array.value[index - 1].financial__margin_of_loss !='' ? array.value[index - 1].financial_margin_of_loss : 0 ;
+
+ loss_margin = loss_margin !== undefined ? loss_margin : 0;
+ prev_loss_margin = prev_loss_margin !== undefined ? prev_loss_margin : 0 ;
- console.log('pre profit_margin',prev_profit_margin);
+ profit_margin = profit_margin !== undefined ? profit_margin:0;
+ prev_profit_margin = prev_profit_margin !== undefined ? prev_profit_margin : 0 ;
+
+ let variation_percent : any ;
+ variation_percent = (((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100;
- loss_margin = loss_margin != 0 ? loss_margin : loss_margin;
- prev_loss_margin = prev_loss_margin != 0 ? prev_loss_margin : prev_loss_margin ;
+ // console.log((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ));
+ // console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))));
+ // console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100);
- console.log('Current loss_margin',loss_margin);
-
- console.log('pre loss_margin',prev_loss_margin);
-
- let variation_percent = (((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100;
- console.log((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ));
- console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))));
- console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100);
- detail.controls.financial_profit_to_sale_variation.setValue(variation_percent.toFixed(2));
+ detail.controls.financial_profit_to_sale_variation.setValue(variation_percent != Infinity ? variation_percent.toFixed(2) : 0);
}
}
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
index 1e9f55740..1dac6787f 100755
--- 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
@@ -55,7 +55,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 4295b502b..b182a3342 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
@@ -55,8 +55,9 @@ export class StockComponent implements OnInit {
public submitted = false;
noRecordsFound: Boolean = false;
serviceProviderForm: Boolean = false;
- suppliers_raw_materials : any = [];
- suppliers_trade_details : any = [];
+ // suppliers_raw_materials : any = [];
+ suppliers_retail_trade_details : any = [];
+ suppliers_wholesale_trade_details : any = [];
suppliers_finished_goods : any =[];
suppliers_service_product : any = [];
@@ -193,19 +194,19 @@ export class StockComponent implements OnInit {
api.forEach(val => {
if (val.type_of_activity_id == 2) {
if(val.products){
- this.suppliers_raw_materials = val.products;
+ this.suppliers_finished_goods = val.products;
this.initManufacturingDetails(null);
}
}
if (val.type_of_activity_id == 3) {
if(val.products){
- this.suppliers_finished_goods = val.products;
+ this.suppliers_retail_trade_details = val.products;
this.initRetailDetails(null);
}
}
if (val.type_of_activity_id == 4) {
if(val.products){
- this.suppliers_trade_details = val.products;
+ this.suppliers_wholesale_trade_details =val.products;
this.initTradingDetails(null);
}
}
@@ -236,19 +237,19 @@ export class StockComponent implements OnInit {
api.forEach(val => {
if (val.type_of_activity_id == 2) {
if(val.products){
- this.suppliers_raw_materials = val.products;
+ this.suppliers_finished_goods = val.products;
this.initManufacturingDetails(null);
}
}
if (val.type_of_activity_id == 3) {
if(val.products){
- this.suppliers_finished_goods = val.products;
+ this.suppliers_retail_trade_details= val.products;
this.initRetailDetails(null);
}
}
if (val.type_of_activity_id == 4) {
if(val.products){
- this.suppliers_trade_details = val.products;
+ this.suppliers_wholesale_trade_details = val.products;
this.initTradingDetails(null);
}
}
@@ -324,22 +325,22 @@ tradingFormCreation(val) {
if(datas === null){
- if(this.suppliers_raw_materials.length > 0){
- this.suppliers_raw_materials.forEach(val => {
- let Ref_RawMaterials : any = {'raw_name': val,
- 'stock_observed':'',
- 'raw_quantity': '',
- 'raw_uom': '',
- 'other_uom': '',
- 'raw_value': '',
- 'is_sufficiant_raw': '',
- 'rawmaterial_remarks':''};
- rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
- });
- }
- else{
+ // if(this.suppliers_raw_materials.length > 0){
+ // this.suppliers_raw_materials.forEach(val => {
+ // let Ref_RawMaterials : any = {'raw_name': val,
+ // 'stock_observed':'',
+ // 'raw_quantity': '',
+ // 'raw_uom': '',
+ // 'other_uom': '',
+ // 'raw_value': '',
+ // 'is_sufficiant_raw': '',
+ // 'rawmaterial_remarks':''};
+ // rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
+ // });
+ // }
+ // else{ }
rawMaterial.push(this.createRawmaterial(null));
- }
+
if(this.suppliers_finished_goods.length > 0){
// for (let val of this.suppliers_finished_goods) {
this.suppliers_finished_goods.forEach(val => {
@@ -428,10 +429,10 @@ tradingFormCreation(val) {
if(datas === null){
- if(this.suppliers_trade_details.length > 0){
+ if(this.suppliers_retail_trade_details.length > 0){
this.rawMaterialAccess = true;
- this.suppliers_trade_details.forEach(val => {
+ this.suppliers_retail_trade_details.forEach(val => {
let Ref_Trade_Goods : any = {
'traded_goods_name': val,
'traded_goods_observed': '',
@@ -527,9 +528,9 @@ tradingFormCreation(val) {
if(datas === null){
- if(this.suppliers_trade_details.length > 0){
+ if(this.suppliers_wholesale_trade_details.length > 0){
// for (let val of this.suppliers_trade_details) {
- this.suppliers_trade_details.forEach(val => {
+ this.suppliers_wholesale_trade_details.forEach(val => {
let Ref_Trade_Goods : any = {
'traded_goods_name': val,
'traded_goods_observed': '',