merge : kms

This commit is contained in:
gandhimathi 2019-01-04 17:23:57 +05:30
commit 99c8283f74
11 changed files with 471 additions and 201 deletions

View File

@ -150,9 +150,13 @@ export class EditPdApplicantComponent implements OnInit {
// console.log(itemElement.coapplicant_landline); // console.log(itemElement.coapplicant_landline);
let concat_landline let concat_landline
if(itemElement.coapplicant_stdcode != null && itemElement.coapplicant_landline != null){ if(itemElement.coapplicant_stdcode != null && itemElement.coapplicant_landline != null){
let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode; if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){
let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline; concat_landline = null;
concat_landline = std+'-'+landline; }else{
let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode;
let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline;
concat_landline = std+'-'+landline;
}
}else if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){ }else if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){
concat_landline = null; concat_landline = null;
}else{ }else{

View File

@ -32,7 +32,7 @@
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field style="width: 80%;"> <mat-form-field style="width: 80%;">
<mat-select placeholder="Address Type" formControlName="address_type" required> <mat-select placeholder="Address Type" formControlName="address_type" required (selectionChange)="selectedAddressType($event.source.triggerValue)">
<mat-option value="{{m_addressType.address_type_id}}" <mat-option value="{{m_addressType.address_type_id}}"
*ngFor="let m_addressType of addressData">{{m_addressType.address_type}} *ngFor="let m_addressType of addressData">{{m_addressType.address_type}}
</mat-option> </mat-option>
@ -42,7 +42,7 @@
<div *ngIf="addressForm.controls['address_type'].value == 12" fxFlex="33"> <div *ngIf="addressForm.controls['address_type'].value == 12" fxFlex="33">
<mat-form-field style="width: 80%;"> <mat-form-field style="width: 80%;">
<input matInput placeholder="Specify Address Type" formControlName="address_type_others" autocomplete="off"> <input matInput placeholder="Specify Address Type" formControlName="address_type_others" autocomplete="off" (change)="selectedAddressType($event.target.value)">
</mat-form-field> </mat-form-field>
</div> </div>
@ -83,6 +83,12 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="addressForm.controls['comment_locality'].value == 10 " fxFlex="33">
<mat-form-field style="width: 80%;">
<input matInput placeholder="Specify Comment on Locality" formControlName="other_comment_locality" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field style="width: 80%;"> <mat-form-field style="width: 80%;">
<mat-select placeholder="Ownership" formControlName="address_ownership"> <mat-select placeholder="Ownership" formControlName="address_ownership">
@ -95,7 +101,6 @@
</div> </div>
<div *ngIf="addressForm.controls['address_ownership'].value == 4 " fxFlex="33"> <div *ngIf="addressForm.controls['address_ownership'].value == 4 " fxFlex="33">
<mat-form-field style="width: 80%;"> <mat-form-field style="width: 80%;">
<input matInput placeholder="Specify Ownership" formControlName="other_ownership" autocomplete="off"> <input matInput placeholder="Specify Ownership" formControlName="other_ownership" autocomplete="off">
</mat-form-field> </mat-form-field>
@ -103,7 +108,8 @@
<div *ngIf="addressForm.controls['address_ownership'].value == 3 " fxFlex="33"> <div *ngIf="addressForm.controls['address_ownership'].value == 3 " fxFlex="33">
<mat-form-field style="width: 80%;"> <mat-form-field style="width: 80%;">
<input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off"> <input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off" (keypress)="keyPress($event)" (keyup)="inWords($event,'')">
<mat-hint align="start" style="font-size:70%" *ngIf="addressForm.controls['rent_amt'].value != ''">{{"&#8377;"}} {{rentAmtInwords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -119,17 +125,36 @@
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear($event.target.value)"> <input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear($event.target.value)">
</mat-form-field> </mat-form-field>
</div> </div>
</div>
<div fxLayout="row wrap">
<div fxFlex="68">
<mat-form-field style="width: 95%;">
<mat-select [placeholder]="placeholderName"
formControlName="other_premises_bussiness_activity" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxFlex="32">
<mat-form-field *ngIf="addressForm.controls['other_premises_bussiness_activity'].value != ''" style="width: 80%;">
<input matInput autocomplete="off" placeholder="Remark" formControlName="bussiness_activity_remark">
</mat-form-field>
</div>
</div>
<div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">
<mat-form-field style="width: 80%;"> <mat-form-field style="width: 95%;">
<!-- <mat-select placeholder="Is there any other premises from which business activity is being run?"--> <!--placeholder="Was any business activity seen at the (Address Type) seen during PD visit?"-->
<mat-select placeholder="Was any business activity seen at the (Address Type) seen during PD visit?" <mat-select placeholder="Is there any other premises from which business activity is being run?" formControlName="bussiness_activity" required>
formControlName="bussiness_activity" required>
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -176,7 +201,7 @@
</span> </span>
<span formArrayName="additional_premises"> <span *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" formArrayName="additional_premises">
<div <div
*ngFor="let item of addressForm.controls.additional_premises['controls']; let i = index;" [formGroupName]="i"> *ngFor="let item of addressForm.controls.additional_premises['controls']; let i = index;" [formGroupName]="i">
@ -209,7 +234,8 @@
<input matInput placeholder="Specify Ownership" formControlName="premises_ownership_others" autocomplete="off"> <input matInput placeholder="Specify Ownership" formControlName="premises_ownership_others" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="item.get('premises_ownership').value == 3" style="width: 40%;"> <mat-form-field *ngIf="item.get('premises_ownership').value == 3" style="width: 40%;">
<input matInput placeholder="What is the monthly rent paid?" formControlName="premises_rent_amt" autocomplete="off"> <input matInput placeholder="What is the monthly rent paid?" formControlName="premises_rent_amt" autocomplete="off" (keypress)="keyPress($event)" (keyup)="inWords($event,i)">
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('premises_rent_amt').value != ''">{{"&#8377;"}} {{premisesRentAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 40%"> <mat-form-field style="width: 40%">
<input matInput placeholder="Remarks" <input matInput placeholder="Remarks"

View File

@ -57,7 +57,10 @@ export class AddressComponent implements OnInit {
formPremisesCityArray: any = []; formPremisesCityArray: any = [];
additional_premises: any=[]; additional_premises: any=[];
bussiness_address_type: any=[]; bussiness_address_type: any=[];
premisesRentAmtInwords:any=[];
rentAmtInwords:any;
tempArr: any[]; tempArr: any[];
placeholderName : any = 'Was any business activity seen at the Address Type during PD visit?';
//neighbourStatusData:any=["Yes","No"]; //neighbourStatusData:any=["Yes","No"];
//applicantOwnerData:any=["Yes","No","Dont Know"]; //applicantOwnerData:any=["Yes","No","Dont Know"];
@ -69,10 +72,13 @@ export class AddressComponent implements OnInit {
public locality: AbstractControl; public locality: AbstractControl;
public pdLocation: AbstractControl; public pdLocation: AbstractControl;
public commentlocality: AbstractControl; public commentlocality: AbstractControl;
public other_comment_locality: AbstractControl;
public customerBehaviour: AbstractControl; public customerBehaviour: AbstractControl;
public ownership: AbstractControl; public ownership: AbstractControl;
public other_ownership: AbstractControl; public other_ownership: AbstractControl;
public rent_amt : AbstractControl; public rent_amt : AbstractControl;
public other_premises_bussiness_activity : AbstractControl;
public bussiness_activity_remark: AbstractControl;
public bussinessActivity: AbstractControl; public bussinessActivity: AbstractControl;
public business_years: AbstractControl; public business_years: AbstractControl;
public business_month: AbstractControl; public business_month: AbstractControl;
@ -118,11 +124,15 @@ export class AddressComponent implements OnInit {
this.addressForm.controls.address.setValue(data.records.address); this.addressForm.controls.address.setValue(data.records.address);
this.addressForm.controls.pd_location.setValue(data.records.pd_location); this.addressForm.controls.pd_location.setValue(data.records.pd_location);
this.addressForm.controls.address_type.setValue(data.records.address_type); this.addressForm.controls.address_type.setValue(data.records.address_type);
this.selectedAddressType(data.records.address_type);
if(data.records.address_type == 12) { if(data.records.address_type == 12) {
this.addressForm.controls.address_type_others.setValue(data.records.address_type_others); this.addressForm.controls.address_type_others.setValue(data.records.address_type_others);
this.selectedAddressType(data.records.address_type_others);
} }
this.addressForm.controls.comment_locality.setValue(data.records.comment_locality); this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
if(data.records.comment_locality == 10){
this.addressForm.controls.other_comment_locality.setValue(data.records.other_comment_locality);
}
// this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour); // this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
this.addressForm.controls.locality.setValue(data.records.locality); this.addressForm.controls.locality.setValue(data.records.locality);
if(data.records.locality == 7 ){ if(data.records.locality == 7 ){
@ -132,6 +142,16 @@ export class AddressComponent implements OnInit {
this.addressForm.controls.address_ownership.setValue(data.records.address_ownership); this.addressForm.controls.address_ownership.setValue(data.records.address_ownership);
this.addressForm.controls.other_ownership.setValue(data.records.other_ownership); this.addressForm.controls.other_ownership.setValue(data.records.other_ownership);
this.addressForm.controls.rent_amt.setValue(data.records.rent_amt); this.addressForm.controls.rent_amt.setValue(data.records.rent_amt);
if(data.records.rent_amt != ''){
this.rentAmtInwords = this._pd.convertNumberToWords(data.records.rent_amt);
}
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);
}
else{
this.addressForm.controls.bussiness_activity_remark.setValue('');
}
this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity); this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity);
if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) { if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) {
@ -152,6 +172,12 @@ export class AddressComponent implements OnInit {
}) })
} }
this.additional_premises.forEach((item,index)=>
{
console.log(item);
console.log(index);
//this.premisesRentAmtInwords[index] = this._pd.convertNumberToWords(item.premises_rent_amt);
});
this.selectedValue(this.bussiness_address_type,this.additional_premises); this.selectedValue(this.bussiness_address_type,this.additional_premises);
if (data.records.locality_others) { if (data.records.locality_others) {
@ -181,12 +207,15 @@ export class AddressComponent implements OnInit {
locality_others: [''], locality_others: [''],
pd_location: ['', Validators.compose([Validators.required])], pd_location: ['', Validators.compose([Validators.required])],
comment_locality: ['', Validators.compose([Validators.required])], comment_locality: ['', Validators.compose([Validators.required])],
other_comment_locality : [''],
//customer_behaviour: ['', Validators.compose([Validators.required])], //customer_behaviour: ['', Validators.compose([Validators.required])],
//neighbourhood: this.fb.array([]), //neighbourhood: this.fb.array([]),
address_form_remark:[''], address_form_remark:[''],
address_ownership:[''], address_ownership:[''],
other_ownership:[''], other_ownership:[''],
rent_amt:[''], rent_amt:[''],
other_premises_bussiness_activity : [''],
bussiness_activity_remark:[''],
bussiness_activity:[''], bussiness_activity:[''],
business_years:[''], business_years:[''],
business_month:[''], business_month:[''],
@ -199,10 +228,13 @@ export class AddressComponent implements OnInit {
this.locality = this.addressForm.controls['locality']; this.locality = this.addressForm.controls['locality'];
this.pdLocation = this.addressForm.controls['pd_location']; this.pdLocation = this.addressForm.controls['pd_location'];
this.commentlocality = this.addressForm.controls['comment_locality']; this.commentlocality = this.addressForm.controls['comment_locality'];
this.other_comment_locality = this.addressForm.controls['other_comment_locality'];
//this.customerBehaviour = this.addressForm.controls['customer_behaviour']; //this.customerBehaviour = this.addressForm.controls['customer_behaviour'];
this.ownership = this.addressForm.controls['address_ownership']; this.ownership = this.addressForm.controls['address_ownership'];
this.other_ownership = this.addressForm.controls['other_ownership']; this.other_ownership = this.addressForm.controls['other_ownership'];
this.rent_amt = this.addressForm.controls['rent_amt']; this.rent_amt = this.addressForm.controls['rent_amt'];
this.other_premises_bussiness_activity = this.addressForm.controls['other_premises_bussiness_activity'],
this.bussiness_activity_remark = this.addressForm.controls['bussiness_activity_remark'],
this.bussinessActivity = this.addressForm.controls['bussiness_activity']; this.bussinessActivity = this.addressForm.controls['bussiness_activity'];
this.business_years = this.addressForm.controls['business_years']; this.business_years = this.addressForm.controls['business_years'];
this.business_month = this.addressForm.controls['business_month']; this.business_month = this.addressForm.controls['business_month'];
@ -303,12 +335,15 @@ export class AddressComponent implements OnInit {
} }
records.pd_location = this.pdLocation.value; records.pd_location = this.pdLocation.value;
records.comment_locality = this.commentlocality.value; records.comment_locality = this.commentlocality.value;
records.other_comment_locality = this.other_comment_locality.value;
//records.customer_behaviour = this.commentlocality.value; //records.customer_behaviour = this.commentlocality.value;
//records.neighbourhood = this.addressForm.controls.neighbourhood.value; //records.neighbourhood = this.addressForm.controls.neighbourhood.value;
records.address_form_remark = this.addressForm.controls.address_form_remark.value; records.address_form_remark = this.addressForm.controls.address_form_remark.value;
records.address_ownership = this.ownership.value; records.address_ownership = this.ownership.value;
records.other_ownership = this.other_ownership.value; records.other_ownership = this.other_ownership.value;
records.rent_amt = this.rent_amt.value; records.rent_amt = this.rent_amt.value;
records.other_premises_bussiness_activity = this.other_premises_bussiness_activity.value;
records.bussiness_activity_remark = this.bussiness_activity_remark.value;
records.bussiness_activity = this.bussinessActivity.value; records.bussiness_activity = this.bussinessActivity.value;
records.business_years = this.business_years.value; records.business_years = this.business_years.value;
records.business_month = this.business_month.value; records.business_month = this.business_month.value;
@ -323,7 +358,7 @@ export class AddressComponent implements OnInit {
} }
} }
console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value); // console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value);
this.addressForm.controls.additional_premises.value.forEach((val,index)=> this.addressForm.controls.additional_premises.value.forEach((val,index)=>
{ {
@ -348,7 +383,7 @@ export class AddressComponent implements OnInit {
records.formid = '5'; records.formid = '5';
// records.fk_createdby = '250'; // records.fk_createdby = '250';
console.log(JSON.stringify(records)); // console.log(JSON.stringify(records));
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
@ -364,6 +399,10 @@ export class AddressComponent implements OnInit {
// this.formPremisesCityArray.push({city: option}); // this.formPremisesCityArray.push({city: option});
// }); // });
// } // }
selectedAddressType(e: any){
// console.log(e);
this.placeholderName = 'Was any business activity seen at the '+e+' during PD visit?';
}
SelectedPremises($event){ SelectedPremises($event){
let premisesData = $event.source.value; let premisesData = $event.source.value;
@ -516,4 +555,15 @@ export class AddressComponent implements OnInit {
event.preventDefault(); event.preventDefault();
} }
} }
inWords(e,i){
console.log(e);
console.log(i);
if(i != ''){
this.premisesRentAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
}
else if(i == '' ){
this.rentAmtInwords = this._pd.convertNumberToWords(e.target.value);
}
}
} }

View File

@ -554,11 +554,10 @@ public m_investmentType = [];
}); });
} }
loadPropertyWithData(data) { loadPropertyWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
property_type: [data.property_type] property_type: [data.property_type],
other_property_type: [data.other_property_type]
//property_type:[''] //property_type:['']
}); });
} }
@ -743,28 +742,41 @@ public m_investmentType = [];
setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
let val = i; let val = i;
// var data = Object.keys(datas).map(function (key) { // let data = Object.keys(datas).map(function (key) {
// return datas[key]; // return datas[key];
// }); // });
// alert(JSON.stringify(datas)); //alert('JSON Other Asset'+JSON.stringify(datas));
let data = datas; let data = datas;
const arr = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const arr = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
arr.controls.splice(0); arr.controls.splice(0);
switch (assets_details_mode) { switch (assets_details_mode) {
case '1': { 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 = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadPropertyWithData(data)); control.push(this.loadPropertyWithData(array_data));
break; break;
} }
case '2': { case '2': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler };
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>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; break;
} }
case '3': { case '3': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler };
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>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; break;
} }
case '4': { case '4': {
@ -773,34 +785,60 @@ public m_investmentType = [];
break; break;
} }
case '5': { case '5': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'consumer_durable_description': datas.consumer_durable_description };
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadConsumerDurableDescriptionWithData(data)); control.push(this.loadConsumerDurableDescriptionWithData(array_data));
break; break;
} }
case '6': { case '6': {
let array_data : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid); this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured); 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 = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInsuranceDescriptionWithData(data)); control.push(this.loadInsuranceDescriptionWithData(array_data));
break; break;
} }
case '7': { case '7': {
let array_data : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest); 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 = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInvestDescriptionWithData(data)); control.push(this.loadInvestDescriptionWithData(array_data));
break; break;
} }
case '8': { case '8': {
let array_data : any;
data.forEach((datas,i) => { 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); this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
}); });
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.otherAssetsDescriptionWithData(data)); control.push(this.otherAssetsDescriptionWithData(array_data));
break; break;
} }
default: { default: {
@ -810,60 +848,97 @@ public m_investmentType = [];
} }
setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
console.log(datas);
let val = i; let val = i;
let data = datas; let data = datas;
const arr = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const arr = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
arr.controls.splice(0); arr.controls.splice(0);
switch (assets_details_mode) { switch (assets_details_mode) {
case '1': { 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 = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>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; break;
} }
case '2': { 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 = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>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; break;
} }
case '3': { 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 = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>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; break;
} }
case '4': { case '4': {
break; break;
} }
case '5': { case '5': {
let business_ConsumerDurableDescription_datas : any;
data.forEach((datas,i) => {
business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description };
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>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; break;
} }
case '6': { case '6': {
let business_InsuranceDescription_datas : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid); this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured); 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 = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>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; break;
} }
case '7': { case '7': {
let business_InvestDescription_datas : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest); 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 = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>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; break;
} }
case '8': { case '8': {
let array_datas : any;
data.forEach((datas,i) => { data.forEach((datas,i) => {
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value); this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt); 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 = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>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; break;
} }
default: { default: {

View File

@ -26,12 +26,12 @@
<div style="width:100%"> <div style="width:100%">
<mat-form-field style="width:35%"> <mat-form-field style="width:35%">
<mat-label>Starting Financial Year</mat-label> <mat-label>Starting Financial Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="staring_financial_year" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="staring_financial_year" (keypress)="keyPress($event)" [readonly]="isReadOnly">
<mat-error> Invalid year format</mat-error> <mat-error> Invalid year format</mat-error>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field hintLabel="Max 10 characters"> <!-- <mat-form-field hintLabel="Max 10 characters">
<input matInput #input maxlength="10" placeholder="Enter some input"> <input matInput #input maxlength="10" placeholder="Enter some input">
<mat-hint align="end">{{input.value?.length || 0}}/10</mat-hint> <mat-hint align="start" style="font-size:70%">{{input.value?.length || 0}}/10</mat-hint>
</mat-form-field> --> </mat-form-field> -->
<mat-form-field style="width:35%"> <mat-form-field style="width:35%">
@ -60,7 +60,7 @@
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:60%"> <mat-form-field style="width:60%">
<input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" formControlName="financial_annualsales_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" formControlName="financial_annualsales_variation" (keypress)="keyPress($event)">
<mat-hint align="end" *ngIf="details.get('financial_annualsales_variation').value != '' " > <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annualsales_variation').value != '' " >
<span *ngIf="details.get('financial_annualsales_variation').value == 0"> <span *ngIf="details.get('financial_annualsales_variation').value == 0">
No differents in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> No differents in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i>
</span> </span>
@ -109,7 +109,7 @@
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:65%"> <mat-form-field style="width:65%">
<input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Profit Variation from Previous Year in %" formControlName="financial_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Profit Variation from Previous Year in %" formControlName="financial_variation" (keypress)="keyPress($event)">
<mat-hint align="end" *ngIf="i != 0 && details.get('financial_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" > <mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" >
<span *ngIf="details.get('financial_variation').value == 0"> <span *ngIf="details.get('financial_variation').value == 0">
No differents in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> No differents in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i>
</span> </span>
@ -121,7 +121,7 @@
</span> </span>
</mat-hint> </mat-hint>
<!-- “Increase in Sales in FY 2017-2018 over sales in FY 2016-2017 is 11.11%” --> <!-- “Increase in Sales in FY 2017-2018 over sales in FY 2016-2017 is 11.11%” -->
<!-- <mat-hint align="end" *ngIf="i != 0" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" >{{SalesStatement[i]}}</mat-hint> --> <!-- <mat-hint align="start" style="font-size:70%" *ngIf="i != 0" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" >{{SalesStatement[i]}}</mat-hint> -->
</mat-form-field> </mat-form-field>
</span> </span>
@ -181,7 +181,7 @@
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:60%"> <mat-form-field style="width:60%">
<input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" formControlName="estimate_annualsales_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" formControlName="estimate_annualsales_variation" (keypress)="keyPress($event)">
<mat-hint align="end" *ngIf="details.get('estimate_annualsales_variation').value != '' " > <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_annualsales_variation').value != '' " >
<span *ngIf="details.get('estimate_annualsales_variation').value == 0"> <span *ngIf="details.get('estimate_annualsales_variation').value == 0">
No differents in Sales in FY <i> {{details.get('estimate_year').value}} </i> over Sales in FY <i> {{financialForm.controls.estimated_value['controls'][i-1].get('estimate_year').value}} </i> No differents in Sales in FY <i> {{details.get('estimate_year').value}} </i> over Sales in FY <i> {{financialForm.controls.estimated_value['controls'][i-1].get('estimate_year').value}} </i>
</span> </span>
@ -225,7 +225,7 @@
</div> </div>
<mat-form-field *ngIf="i != 0" style="width:65%"> <mat-form-field *ngIf="i != 0" style="width:65%">
<input matInput autocomplete="off" [ngClass]="{'highlight': details.controls['estimate_variation'].value >= 40 || details.controls['estimate_variation'].value >= -40}" placeholder="Variation from Previous Year in %" formControlName="estimate_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" [ngClass]="{'highlight': details.controls['estimate_variation'].value >= 40 || details.controls['estimate_variation'].value >= -40}" placeholder="Variation from Previous Year in %" formControlName="estimate_variation" (keypress)="keyPress($event)">
<mat-hint align="end" [ngClass]="{'highlight': (details.controls['estimate_variation'].value >= 40) || (details.controls['estimate_variation'].value < -40)}" > <mat-hint align="start" style="font-size:70%" [ngClass]="{'highlight': (details.controls['estimate_variation'].value >= 40) || (details.controls['estimate_variation'].value < -40)}" >
<span *ngIf="details.get('estimate_variation').value == 0"> <span *ngIf="details.get('estimate_variation').value == 0">
No differents in Profit in FY <i> {{details.get('estimate_year').value}} </i> over Profit in FY <i> {{financialForm.controls.estimated_value['controls'][i-1].get('estimate_year').value}} </i> No differents in Profit in FY <i> {{details.get('estimate_year').value}} </i> over Profit in FY <i> {{financialForm.controls.estimated_value['controls'][i-1].get('estimate_year').value}} </i>
</span> </span>

View File

@ -100,6 +100,7 @@ export class FinancialInfoComponent implements OnInit {
return value.records.estimated_value[key]; return value.records.estimated_value[key];
}); });
if (result.length > 0) { if (result.length > 0) {
this.customerCommentsFlag = result.length == 1 ? false : true;
result.forEach((val,index) => { result.forEach((val,index) => {
//financial_date.push(this.createDate()); //financial_date.push(this.createDate());
this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale); this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale);

View File

@ -58,7 +58,7 @@
<!-- companies start --> <!-- companies start -->
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>
<mat-card-title>Companies</mat-card-title> <mat-card-title>Company/Firm</mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<div fxLayout="row wrap" formArrayName="companies"> <div fxLayout="row wrap" formArrayName="companies">
@ -90,7 +90,7 @@
<div *ngFor="let mulRel of relation.get('multiple_relation').controls; let m = index" [formGroupName]="m"> <div *ngFor="let mulRel of relation.get('multiple_relation').controls; let m = index" [formGroupName]="m">
<div fxLayout="row nowrap"> <div fxLayout="row nowrap">
<mat-form-field style="width: 40%"> <mat-form-field style="width: 40%">
<mat-select placeholder="Relation to" formControlName="applicant_relation_to"> <mat-select placeholder="Relation to" formControlName="applicant_relation_to" (selectionChange)="selectedApplicant($event,relation.controls.applicant_name.value)">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let rel of individualsList" [value]="rel.individuals_order_id" [disabled]="relation.controls.applicant_name.value == rel.applicant_name"> <mat-option *ngFor="let rel of individualsList" [value]="rel.individuals_order_id" [disabled]="relation.controls.applicant_name.value == rel.applicant_name">
{{rel.applicant_name | titlecase}} {{rel.applicant_name | titlecase}}
@ -98,6 +98,7 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 20%"> <mat-form-field style="width: 20%">
<!--[placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' "-->
<mat-select placeholder="Relation" formControlName="relationship"> <mat-select placeholder="Relation" formControlName="relationship">
<mat-option>Select</mat-option> <mat-option>Select</mat-option>
<mat-option *ngFor="let relShip of relationShipList" [value]="relShip.relationship_id"> <mat-option *ngFor="let relShip of relationShipList" [value]="relShip.relationship_id">
@ -117,7 +118,7 @@
</div> </div>
</div> </div>
<p>Company Relationship</p> <p>Company/Firm Relationship</p>
<div formArrayName="multiple_company_relation"> <div formArrayName="multiple_company_relation">
<div fxLayout="row nowrap" *ngFor="let comRel of relation.get('multiple_company_relation').controls; let c = index" [formGroupName]="c"> <div fxLayout="row nowrap" *ngFor="let comRel of relation.get('multiple_company_relation').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width: 40%"> <mat-form-field style="width: 40%">

View File

@ -345,7 +345,24 @@ 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;
// case 2: this.placeholderName[i] = 'Daily Instalment Amount'; break;
// case 3: this.placeholderName[i] = 'Annual Instalment Amount'; break;
// case 4: this.placeholderName[i] = 'Hourly Instalment Amount'; break;
// case 5: this.placeholderName[i] = 'EMI Amount'; break;
// case 6: this.placeholderName[i] = 'Quarterly Instalment Amount'; break;
// case 7: this.placeholderName[i] = 'Halfyearly Instalment Amount'; break;
// default : this.placeholderName[i] = ''; break;
// }
// }
// validate all form group and form array fields // validate all form group and form array fields
validateAllFormFields(formGroup: any) { validateAllFormFields(formGroup: any) {

View File

@ -21,7 +21,7 @@
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field style="width: 80%"> <mat-form-field style="width: 80%">
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required autocomplete="off"> <input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="33"> <div fxFlex="33">
@ -66,7 +66,7 @@
<div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''"> <div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
<mat-form-field style="width: 60%"> <mat-form-field style="width: 60%">
<input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off"> <input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="Is there a Top Up" <mat-select placeholder="Is there a Top Up"
@ -88,7 +88,7 @@
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 60%"> <mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 60%">
<input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)" autocomplete="off"> <input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 30%"> <mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 30%">
@ -99,7 +99,7 @@
<mat-form-field style="width: 30%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)" autocomplete="off"> <input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> <mat-form-field style="width: 30%">
@ -135,7 +135,7 @@
<mat-form-field style="width: 60%"> <mat-form-field style="width: 60%">
<input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" required autocomplete="off"> <input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" required autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} {{emiAmtInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} {{emiAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> --> <!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> -->
<mat-card *ngIf="mortageCardAccess"> <mat-card *ngIf="mortageCardAccess">
@ -200,12 +200,12 @@
<mat-form-field> <mat-form-field>
<input matInput placeholder="Estimate Market Value as Per Customer" <input matInput placeholder="Estimate Market Value as Per Customer"
formControlName="emv_per_customer" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" required autocomplete="off"> formControlName="emv_per_customer" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" required autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{emvAmtInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{emvAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field> <!-- <mat-form-field>
<input matInput placeholder="Value as Per Agreement" <input matInput placeholder="Value as Per Agreement"
formControlName="value_per_agreement" (keypress)="keyPress($event)" required (keyup)="inWords($event,3)"> formControlName="value_per_agreement" (keypress)="keyPress($event)" required (keyup)="inWords($event,3)">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{valAsPerAgmtInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{valAsPerAgmtInWords}} Only</mat-hint>
</mat-form-field> --> </mat-form-field> -->
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>

View File

@ -17,27 +17,30 @@
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">
<mat-card *ngIf="manufacturingForm"> <mat-card *ngIf="manufacturingForm">
<mat-card-header> <!-- <mat-card-header>
<mat-card-title class="highlight"> Manufacturing Details </mat-card-title> <mat-card-title class="highlight"> Manufacturing Details </mat-card-title>
</mat-card-header> </mat-card-header> -->
<h5 class="highlight" style="margin: 12px;">Manufacturing Details</h5>
<div formArrayName="manufacturing_details"> <div formArrayName="manufacturing_details">
<div *ngFor="let md of stockForms.controls.manufacturing_details['controls']; let i=index" [formGroupName]="i"> <div *ngFor="let md of stockForms.controls.manufacturing_details['controls']; let i=index" [formGroupName]="i">
<div formArrayName="manufacturing_raw_materials"> <div formArrayName="manufacturing_raw_materials">
<div *ngFor="let mrm of md.controls.manufacturing_raw_materials['controls']; let a=index" [formGroupName]="a"> <div *ngFor="let mrm of md.controls.manufacturing_raw_materials['controls']; let a=index" [formGroupName]="a">
<mat-label class="highlight"> <i> <p>{{a+1}} . Raw Material </p> </i> </mat-label> <mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Raw Material #{{a+1}} </i> </mat-label>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="raw_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="raw_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Stock is Observed ?" formControlName="stock_observed" > <!-- <mat-select placeholder="is the Stock is Observed ?" formControlName="stock_observed" > -->
<mat-option value="yes" >Yes</mat-option> <mat-select placeholder="Stock" formControlName="stock_observed" >
<mat-option value="no" >No</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="mrm.get('stock_observed').value == 'no'" > <span *ngIf="mrm.get('stock_observed').value == 'yes'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="raw_quantity" > <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="raw_quantity" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement" <mat-select placeholder="Unit of Mearsurement"
@ -49,11 +52,12 @@
<input matInput autocomplete="off" placeholder="Specify Other UOM" formControlName="other_uom" > <input matInput autocomplete="off" placeholder="Specify Other UOM" formControlName="other_uom" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" (keyup)="inWords($event,1,a)" >
<mat-hint align="end" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{M_rawValueInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{M_rawValueInWords[a]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" (keyup)="inWords($event,8,a)">
<mat-hint align="start" style="font-size:70%" *ngIf="mrm.get('rawmaterial_value').value != ''">{{"&#8377;"}} {{M_financialRawValueInWords[a]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw" > <mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw" >
@ -62,45 +66,49 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="mrm.get('is_sufficiant_raw').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="mrm.get('is_sufficiant_raw').value == 'no'" appearance="outline" style="width: 90%">
<mat-label class="highlight"> <i>Please comment on the stock level observed?</i> </mat-label> <mat-label> <i>Please comment on the stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
<button type="button" mat-raised-button mat-icon-button (click)="addRawMaterials(1)" <button type="button" mat-raised-button mat-icon-button (click)="addRawMaterials(1)"
matTooltip="Add More Raw Materials" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="a==0"> matTooltip="Add More Raw Materials" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="a==0">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
</button> </button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteRawMaterials(a,1)" <button type="button" mat-raised-button mat-icon-button (click)="deleteRawMaterials(a,1)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="a>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="a>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</mat-card-content> </mat-card-content>
</mat-card>
</div> </div>
</div> </div>
<div formArrayName="manufacturing_finished_goods"> <div formArrayName="manufacturing_finished_goods">
<div *ngFor="let mfg of md.controls.manufacturing_finished_goods['controls']; let b=index" [formGroupName]="b"> <div *ngFor="let mfg of md.controls.manufacturing_finished_goods['controls']; let b=index" [formGroupName]="b">
<mat-label class="highlight"> <i> <p> {{b+1}} Finished Goods </p> </i> </mat-label> <mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{b+1}} </i> </mat-label>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" > <!-- <mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" > -->
<mat-option value="yes" >Yes</mat-option> <mat-select placeholder="Finished Goods" formControlName="goods_observed" >
<mat-option value="no" >No</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no">No Stock Observed</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="mfg.get('goods_observed').value == 'no'" > <span *ngIf="mfg.get('goods_observed').value == 'yes'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" > <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,2)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,2,b)" >
<mat-hint align="end" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{M_goodsValueInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{M_goodsValueInWords[b]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,9,b)">
<mat-hint align="start" style="font-size:70%" *ngIf="mfg.get('finished_goods_value').value != ''">{{"&#8377;"}} {{M_financialGoodsValueInWords[b]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > <mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" >
@ -122,33 +130,37 @@
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="b>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="b>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</mat-card-content> </mat-card-content>
</mat-card>
</div> </div>
</div> </div>
<div formArrayName="manufacturing_traded_goods"> <div formArrayName="manufacturing_traded_goods">
<div *ngFor="let mtg of md.controls.manufacturing_traded_goods['controls']; let c=index" [formGroupName]="c"> <div *ngFor="let mtg of md.controls.manufacturing_traded_goods['controls']; let c=index" [formGroupName]="c">
<mat-label class="highlight"> <i> <p>{{c+1}} Traded Goods </p> </i> </mat-label> <mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{c+1}} </i> </mat-label>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" > <mat-select placeholder="Traded Goods" formControlName="traded_goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no">No Stock Observed</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="mtg.get('traded_goods_observed').value == 'no'" > <span *ngIf="mtg.get('traded_goods_observed').value == 'yes'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" > <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,3)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,3,c)" >
<mat-hint align="end" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{M_tradedGoodsValueInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{M_tradedGoodsValueInWords[c]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,10,c)">
<mat-hint align="start" style="font-size:70%" *ngIf="mtg.get('traded_goods_value').value != ''">{{"&#8377;"}} {{M_financialTradedGoodsValueInWords[c]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > --> <!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > -->
@ -158,7 +170,7 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="mtg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="mtg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label class="highlight"> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label> <mat-label> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -171,7 +183,9 @@
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="c>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="c>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</mat-card-content> </mat-card-content>
</mat-card>
</div> </div>
</div> </div>
</div> </div>
@ -179,36 +193,39 @@
</mat-card> </mat-card>
<mat-card *ngIf="retailForm"> <mat-card *ngIf="retailForm">
<mat-card-header> <!-- <mat-card-header>
<mat-card-title><p>Retail Details</p></mat-card-title> <mat-card-title class="highlight"><p>Retail Details</p></mat-card-title>
</mat-card-header> </mat-card-header> -->
<h5 class="highlight" style="margin: 12px;">Retail Details</h5>
<div formArrayName="retail_details"> <div formArrayName="retail_details">
<div *ngFor="let rd of stockForms.controls.retail_details['controls']; let j=index" [formGroupName]="j"> <div *ngFor="let rd of stockForms.controls.retail_details['controls']; let j=index" [formGroupName]="j">
<div formArrayName="retail_finished_goods"> <div formArrayName="retail_finished_goods">
<div *ngFor="let retailfg of rd.controls.retail_finished_goods['controls']; let d=index" [formGroupName]="d"> <div *ngFor="let retailfg of rd.controls.retail_finished_goods['controls']; let d=index" [formGroupName]="d">
<mat-label class="highlight"> <i> <p>{{d+1}} Finished Goods </p> </i> </mat-label> <mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{d+1}} </i> </mat-label>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" > <mat-select placeholder="Finished Goods" formControlName="goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no">No stock observed</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="retailfg.get('goods_observed').value == 'no'" > <span *ngIf="retailfg.get('goods_observed').value == 'yes'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" > <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,4)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,4,d)" >
<mat-hint align="end" *ngIf="retailfg.get('goods_value').value != ''">{{"&#8377;"}} {{R_goodsValueInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="retailfg.get('goods_value').value != ''">{{"&#8377;"}} {{R_goodsValueInWords[d]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,11,d)">
<mat-hint align="start" style="font-size:70%" *ngIf="retailfg.get('finished_goods_value').value != ''">{{"&#8377;"}} {{R_financialGoodsValueInWords[d]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
@ -218,7 +235,7 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="retailfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="retailfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label class="highlight"> <i>Please comment on the finished goods stock level observed?</i> </mat-label> <mat-label> <i>Please comment on the finished goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -227,37 +244,41 @@
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="d==0"> matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="d==0">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
</button> </button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(d,2)" <button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(d,2)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="d>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="d>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</mat-card-content> </mat-card-content>
</mat-card>
</div> </div>
</div> </div>
<div formArrayName="retail_traded_goods"> <div formArrayName="retail_traded_goods">
<div *ngFor="let item of rd.controls.retail_traded_goods['controls']; let e=index" [formGroupName]="e"> <div *ngFor="let item of rd.controls.retail_traded_goods['controls']; let e=index" [formGroupName]="e">
<mat-label class="highlight"> <i> <p>{{e+1}} Traded Goods </p> </i> </mat-label> <mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{e+1}} </i> </mat-label>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" > <mat-select placeholder="Traded Goods" formControlName="traded_goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no">No Stock Observed</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="item.get('traded_goods_observed').value == 'no'" > <span *ngIf="item.get('traded_goods_observed').value == 'yes'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" > <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,5)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,5,e)" >
<mat-hint align="end" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{R_tradedGoodsValueInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{R_tradedGoodsValueInWords[e]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,12,e)">
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('traded_goods_value').value != ''">{{"&#8377;"}} {{R_financialTradedGoodsValueInWords[e]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
@ -267,7 +288,7 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="item.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="item.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label class="highlight"> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label> <mat-label> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -280,7 +301,9 @@
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="e>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="e>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</mat-card-content> </mat-card-content>
</mat-card>
</div> </div>
</div> </div>
@ -290,35 +313,38 @@
<mat-card *ngIf="tradingForm"> <mat-card *ngIf="tradingForm">
<mat-card-header> <!-- <mat-card-header>
<mat-card-title><p>Trading Details</p></mat-card-title> <mat-card-title class="highlight"><p>Trading Details</p></mat-card-title>
</mat-card-header> </mat-card-header> -->
<h5 class="highlight" style="margin: 12px;">Trading Details</h5>
<div formArrayName="trade_details"> <div formArrayName="trade_details">
<div *ngFor="let td of stockForms.controls.trade_details['controls']; let k=index" [formGroupName]="k"> <div *ngFor="let td of stockForms.controls.trade_details['controls']; let k=index" [formGroupName]="k">
<div formArrayName="trading_finished_goods"> <div formArrayName="trading_finished_goods">
<div *ngFor="let tradesubdetail of td.controls.trading_finished_goods['controls']; let f=index" [formGroupName]="f"> <div *ngFor="let tradesubdetail of td.controls.trading_finished_goods['controls']; let f=index" [formGroupName]="f">
<mat-label class="highlight"> <i> <p>{{f+1}} Finished Goods </p> </i> </mat-label> <mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Finished Goods #{{f+1}} </i> </mat-label>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" > <mat-select placeholder="Finished Goods" formControlName="goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no">No Stock Observed</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="tradesubdetail.get('goods_observed').value == 'no'" > <span *ngIf="tradesubdetail.get('goods_observed').value == 'yes'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" > <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,6,f)" >
<mat-hint align="end" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"&#8377;"}} {{T_goodsValueInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"&#8377;"}} {{T_goodsValueInWords[f]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,13,f)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradesubdetail.get('finished_goods_value').value != ''">{{"&#8377;"}} {{T_financialGoodsValueInWords[f]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
@ -328,11 +354,12 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="tradesubdetail.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="tradesubdetail.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label class="highlight"> <i>Please comment on the finished goods stock level observed?</i> </mat-label> <mat-label> <i>Please comment on the finished goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
<button type="button" mat-raised-button mat-icon-button (click)="addGoods(3)" <button type="button" mat-raised-button mat-icon-button (click)="addGoods(3)"
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="f==0"> matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="f==0">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
@ -341,34 +368,38 @@
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="f>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="f>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</mat-card-content>
</mat-card-content>
</mat-card>
</div> </div>
</div> </div>
<div formArrayName="trading_traded_goods"> <div formArrayName="trading_traded_goods">
<div *ngFor="let tradetg of td.controls.trading_traded_goods['controls']; let g=index" [formGroupName]="g"> <div *ngFor="let tradetg of td.controls.trading_traded_goods['controls']; let g=index" [formGroupName]="g">
<mat-label class="highlight"> <i> <p>{{g+1}} Traded Goods </p> </i> </mat-label> <mat-card style="margin: 12px;">
<mat-label class="highlight"> <i>Traded Goods #{{g+1}} </i> </mat-label>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" > <input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" > <mat-select placeholder="Traded Goods" formControlName="traded_goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes">Add Stock Details</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no">No stock observed</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="tradetg.get('traded_goods_observed').value == 'no'" > <span *ngIf="tradetg.get('traded_goods_observed').value == 'yes'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" > <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" > <input matInput autocomplete="off" placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,7,g)">
<mat-hint align="end" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{T_tradedGoodsValueInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{T_tradedGoodsValueInWords[g]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,14,g)">
<mat-hint align="start" style="font-size:70%" *ngIf="tradetg.get('traded_goods_value').value != ''">{{"&#8377;"}} {{T_financialTradedGoodsValueInWords[g]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > --> <!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > -->
@ -378,21 +409,22 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="tradetg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="tradetg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label class="highlight"> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label> <mat-label> <i>Please comment on the Traded Goods stock level observed?</i> </mat-label>
<textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
<button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(3)" <button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods(3)"
matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="g==0"> matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="g==0">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
</button> </button>
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,3)" <button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(g,3)"
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="g>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="g>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
</mat-card-content>
</mat-card-content>
</mat-card>
</div> </div>
</div> </div>
</div> </div>
@ -401,9 +433,10 @@
</mat-card> </mat-card>
<mat-card *ngIf="serviceProviderForm"> <mat-card *ngIf="serviceProviderForm">
<mat-card-header> <!-- <mat-card-header>
<p>Service Provider</p> <p>Service Provider</p>
</mat-card-header> </mat-card-header> -->
<h5 class="highlight" style="margin: 12px;">Service Provider</h5>
<div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div> <div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div>
</mat-card> </mat-card>

View File

@ -29,15 +29,24 @@ export class StockComponent implements OnInit {
rawmaterial : any; rawmaterial : any;
M_rawValueInWords : any; M_rawValueInWords : any = [];
M_financialRawValueInWords : any = [];
M_goodsValueInWords : any; M_goodsValueInWords : any = [];
R_goodsValueInWords : any; R_goodsValueInWords : any = [];
T_goodsValueInWords : any; T_goodsValueInWords : any = [];
M_tradedGoodsValueInWords : any; M_financialGoodsValueInWords : any = [];
R_tradedGoodsValueInWords : any; R_financialGoodsValueInWords : any = [];
T_tradedGoodsValueInWords : any; T_financialGoodsValueInWords : any = [];
M_tradedGoodsValueInWords : any = [];
R_tradedGoodsValueInWords : any = [];
T_tradedGoodsValueInWords : any = [];
M_financialTradedGoodsValueInWords : any = [];
R_financialTradedGoodsValueInWords : any = [];
T_financialTradedGoodsValueInWords : any = [];
rawMaterialAccess: boolean; rawMaterialAccess: boolean;
finishedGoodsAccess: boolean; finishedGoodsAccess: boolean;
@ -45,6 +54,7 @@ export class StockComponent implements OnInit {
public submitted = false; public submitted = false;
noRecordsFound: Boolean = false; noRecordsFound: Boolean = false;
serviceProviderForm: Boolean = false; serviceProviderForm: Boolean = false;
suppliers_raw_materials : any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
@ -118,8 +128,6 @@ export class StockComponent implements OnInit {
this._pd.retriveForm(params).subscribe(value => { this._pd.retriveForm(params).subscribe(value => {
if (value.status == 200) { if (value.status == 200) {
let dataForm = value.records; let dataForm = value.records;
if(dataForm !== undefined) { if(dataForm !== undefined) {
this.stockForms = this.fb.group({ this.stockForms = this.fb.group({
pdid: [this.pdid], pdid: [this.pdid],
@ -133,6 +141,24 @@ export class StockComponent implements OnInit {
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) { if(arr.length > 0) {
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
console.log('136',value);
if(value.status == 200){
this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials;
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);
}
else{
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);
}
});
// console.log(1,dataForm); // console.log(1,dataForm);
// console.log(164,dataForm.manufacturing_details); // console.log(164,dataForm.manufacturing_details);
// console.log(2,dataForm.retail_details); // console.log(2,dataForm.retail_details);
@ -170,13 +196,6 @@ export class StockComponent implements OnInit {
// console.log(164,dataForm.manufacturing_details[0]); // console.log(164,dataForm.manufacturing_details[0]);
// console.log(164,dataForm.manufacturing_details[0].manufacturing_raw_materials); // console.log(164,dataForm.manufacturing_details[0].manufacturing_raw_materials);
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);
//this.initManufacturingDetails(dataForm); //this.initManufacturingDetails(dataForm);
} }
@ -265,7 +284,16 @@ export class StockComponent implements OnInit {
}); });
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) { if(arr.length > 0) {
this.initManufacturingDetails(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.initManufacturingDetails(null);
}
else{
this.initManufacturingDetails(null);
}
});
// this.initManufacturingDetails(null);
} }
let arr1 = record.filter(data => data.type_of_activity_id == 2); let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) { if(arr1.length > 0) {
@ -293,7 +321,16 @@ export class StockComponent implements OnInit {
}); });
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) { if(arr.length > 0) {
this.initManufacturingDetails(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.initManufacturingDetails(null);
}
else{
this.initManufacturingDetails(null);
}
});
} }
let arr1 = record.filter(data => data.type_of_activity_id == 2); let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) { if(arr1.length > 0) {
@ -377,13 +414,26 @@ tradingFormCreation(val) {
const finishedGoods = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; const finishedGoods = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
const tradedGoods = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; const tradedGoods = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if(datas === null){ if(datas === null){
// console.log(299,'if'); if(this.suppliers_raw_materials.length > 0){
for (let val of this.suppliers_raw_materials) {
let Ref_RawMaterials : any = {'raw_name': val.manufacturing_raw_material_name,
'stock_observed':'',
'raw_quantity': '',
'raw_uom': '',
'other_uom': '',
'raw_value': '',
'rawmaterial_value': '',
'is_sufficiant_raw': '',
'rawmaterial_remarks':''};
rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
}
}
else{
rawMaterial.push(this.createRawmaterial(null)); rawMaterial.push(this.createRawmaterial(null));
}
finishedGoods.push(this.createGoods(null)); finishedGoods.push(this.createGoods(null));
tradedGoods.push(this.createTradedGoods(null)); tradedGoods.push(this.createTradedGoods(null));
} else { } else {
// console.log(305,'else') // console.log(305,'else')
// console.log(377,datas); // console.log(377,datas);
@ -393,6 +443,7 @@ tradingFormCreation(val) {
// console.log(val); // console.log(val);
if(val.raw_value){ if(val.raw_value){
this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value); this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value);
this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value);
} }
rawMaterial.push(this.createRawmaterial(val)); rawMaterial.push(this.createRawmaterial(val));
} }
@ -405,6 +456,7 @@ tradingFormCreation(val) {
// console.log(val); // console.log(val);
if(val.goods_value){ if(val.goods_value){
this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
} }
finishedGoods.push(this.createGoods(val)); finishedGoods.push(this.createGoods(val));
@ -418,6 +470,7 @@ tradingFormCreation(val) {
// console.log(val); // console.log(val);
if(val.estimated_traded_goods_value){ if(val.estimated_traded_goods_value){
this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(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)); tradedGoods.push(this.createTradedGoods(val));
@ -430,21 +483,6 @@ tradingFormCreation(val) {
} }
} }
createRawmaterial2() {
return this.fb.group({
raw_name: ['', Validators.compose([Validators.required])],
stock_observed:['', Validators.compose([Validators.required])],
raw_quantity: [''],
raw_uom: [''],
other_uom : [''],
raw_value: [''],
rawmaterial_value: [''],
is_sufficiant_raw: [''],
rawmaterial_remarks:['']
});
}
createRawmaterial(records) { createRawmaterial(records) {
// console.log(330,'function in'); // console.log(330,'function in');
if(records === null) { if(records === null) {
@ -495,6 +533,7 @@ tradingFormCreation(val) {
if(val.goods_value){ if(val.goods_value){
this.R_goodsValueInWords = this._pd.convertNumberToWords(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)); finishedGoods.push(this.createGoods(val));
@ -510,6 +549,7 @@ tradingFormCreation(val) {
// console.log(val); // console.log(val);
if(val.estimated_traded_goods_value){ if(val.estimated_traded_goods_value){
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(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);
} }
tradedGoods.push(this.createTradedGoods(val)); tradedGoods.push(this.createTradedGoods(val));
@ -594,6 +634,7 @@ tradingFormCreation(val) {
// console.log(val); // console.log(val);
if(val.goods_value){ if(val.goods_value){
this.T_goodsValueInWords = this._pd.convertNumberToWords(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)); finishedGoods.push(this.createGoods(val));
@ -608,6 +649,7 @@ tradingFormCreation(val) {
// console.log(val); // console.log(val);
if(val.estimated_traded_goods_value){ if(val.estimated_traded_goods_value){
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(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);
} }
tradedGoods.push(this.createTradedGoods(val)); tradedGoods.push(this.createTradedGoods(val));
} }
@ -831,29 +873,50 @@ tradingFormCreation(val) {
} }
/** To Convert Amount into Words */ /** To Convert Amount into Words */
inWords(e,flag:number){ inWords(e,flag:number,i){
switch(flag){ switch(flag){
case 1 : case 1 :
this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value); this.M_rawValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break; break;
case 2 : case 2 :
this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); this.M_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break; break;
case 3 : case 3 :
this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); this.M_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break; break;
case 4 : case 4 :
this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); this.R_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break; break;
case 5 : case 5 :
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); this.R_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break; break;
case 6 : case 6 :
this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); this.T_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break; break;
case 7 : case 7 :
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); this.T_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 8 :
this.M_financialRawValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 9 :
this.M_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 10 :
this.M_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 11 :
this.R_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 12 :
this.R_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 13 :
this.T_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 14 :
this.T_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break; break;
default: default:
break; break;