address,asset,stock : ps
This commit is contained in:
parent
7df70eb364
commit
3db4eb664e
@ -102,19 +102,25 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<!-- <mat-form-field *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 100%">
|
<!-- <mat-form-field *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 100%"> -->
|
||||||
<!-- <mat-select placeholder="Bussiness Type" formControlName="bussiness_address_type">
|
<!-- <mat-select placeholder="Bussiness Type" formControlName="bussiness_address_type">
|
||||||
<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>
|
||||||
</mat-select> -->
|
</mat-select> -->
|
||||||
<!-- --<mat-select placeholder="Type of Premises" formControlName="bussiness_address_type" multiple>
|
<!-- <mat-select placeholder="Type of Premises" formControlName="bussiness_address_type" multiple>
|
||||||
<mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id" (onSelectionChange)="SelectedPremises($event)" > {{m_addressType.address_type}} </mat-option>
|
<mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id" (onSelectionChange)="SelectedPremises($event)" > {{m_addressType.address_type}} </mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field> -->
|
</mat-form-field> -->
|
||||||
|
<p>Type of Premises</p>
|
||||||
|
<div fxLayout="row wrap" class="example-section" *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'">
|
||||||
|
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25" *ngFor="let at of addressData;let i = index;"> <!---- [formGroupName]="i"> -->
|
||||||
|
<mat-checkbox class="example-margin" color="primary" [value]="at.address_type_id" (change)="SelectedPremises($event)" [checked]="at.status==1 ? true:false">{{at.address_type}}</mat-checkbox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<mat-form-field *ngIf="PremisesOtherFlag == true" style="width: 40%">
|
<mat-form-field *ngIf="PremisesOtherFlag == true" style="width: 40%">
|
||||||
<input matInput placeholder="Specify Other Premises Type" formControlName="bussiness_address_type_others" autocomplete="off">
|
<input matInput placeholder="Specify Other Premises Type" formControlName="bussiness_address_type_others" (change)="otherValueset()" autocomplete="off">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<span formArrayName="additional_premises">
|
<span formArrayName="additional_premises">
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -54,6 +54,9 @@ export class AddressComponent implements OnInit {
|
|||||||
|
|
||||||
formPremisesArray: any = [];
|
formPremisesArray: any = [];
|
||||||
formPremisesCityArray: any = [];
|
formPremisesCityArray: any = [];
|
||||||
|
additional_premises: any=[];
|
||||||
|
bussiness_address_type: any=[];
|
||||||
|
tempArr: any[];
|
||||||
//neighbourStatusData:any=["Yes","No"];
|
//neighbourStatusData:any=["Yes","No"];
|
||||||
//applicantOwnerData:any=["Yes","No","Dont Know"];
|
//applicantOwnerData:any=["Yes","No","Dont Know"];
|
||||||
|
|
||||||
@ -124,90 +127,78 @@ export class AddressComponent implements OnInit {
|
|||||||
this.addressForm.controls.rent_amt.setValue(data.records.rent_amt);
|
this.addressForm.controls.rent_amt.setValue(data.records.rent_amt);
|
||||||
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') {
|
// if(data.records.bussiness_activity == 'yes') {
|
||||||
let selectedPremisesDBData = Object.keys(data.records.bussiness_address_type).map(function (key) {
|
|
||||||
return data.records.bussiness_address_type[key];
|
|
||||||
});
|
|
||||||
|
|
||||||
let enduse: any = [];
|
// this.bussiness_address_type = [];
|
||||||
let existPremises: any =[];
|
|
||||||
|
|
||||||
selectedPremisesDBData.forEach(val => {
|
// this.bussiness_address_type = (Object.keys(data.records.bussiness_address_type).map(function(key)
|
||||||
enduse.push(val.premises_types);
|
// {
|
||||||
existPremises.push(val);
|
// return data.records.bussiness_address_type[key].premises_types;
|
||||||
});
|
// }))
|
||||||
|
|
||||||
this.formPremisesArray = existPremises;
|
// // console.log(bussiness_address_type);
|
||||||
|
|
||||||
this.addressForm.controls.bussiness_address_type.setValue(enduse);
|
|
||||||
|
|
||||||
var additionalPremisesResult = Object.keys(data.records.additional_premises).map(function (key) {
|
// let selectedPremisesDBData = Object.keys(data.records.bussiness_address_type).map(function (key) {
|
||||||
return data.records.additional_premises[key];
|
// return data.records.bussiness_address_type[key];
|
||||||
});
|
|
||||||
|
|
||||||
// let cityenduse: any = [];
|
|
||||||
// let existcity: any =[];
|
|
||||||
|
|
||||||
// additionalPremisesResult.forEach(val => {
|
|
||||||
// cityenduse.push(val.premises_types);
|
|
||||||
// existcity.push(val);
|
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// this.formPremisesCityArray = existcity;
|
// let enduse: any = [];
|
||||||
|
// let existPremises: any =[];
|
||||||
|
|
||||||
additionalPremisesResult.forEach((val,index)=>
|
// selectedPremisesDBData.forEach(val => {
|
||||||
|
// enduse.push(val.premises_types);
|
||||||
|
// existPremises.push(val);
|
||||||
|
// });
|
||||||
|
|
||||||
|
// this.formPremisesArray = existPremises;
|
||||||
|
|
||||||
|
|
||||||
|
// this.addressForm.controls.bussiness_address_type.setValue(enduse);
|
||||||
|
|
||||||
|
// var additionalPremisesResult = Object.keys(data.records.additional_premises).map(function (key) {
|
||||||
|
// return data.records.additional_premises[key];
|
||||||
|
// });
|
||||||
|
|
||||||
|
// this.additional_premises = additionalPremisesResult;
|
||||||
|
|
||||||
|
// if (additionalPremisesResult.length == 0) {
|
||||||
|
// additionalPremisesControl.push(this.createPremises());
|
||||||
|
// } else {
|
||||||
|
// additionalPremisesResult.forEach(datas => {
|
||||||
|
// additionalPremisesControl.push(this.createPremises());
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// if(data.records.bussiness_address_type == 12) {
|
||||||
|
// this.addressForm.controls.bussiness_address_type_others.setValue(data.records.bussiness_address_type_others);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) {
|
||||||
|
let that = this;
|
||||||
|
this.bussiness_address_type = [];
|
||||||
|
|
||||||
|
this.bussiness_address_type = (Object.keys(data.records.bussiness_address_type).map(function(key)
|
||||||
{
|
{
|
||||||
console.log(val);
|
return data.records.bussiness_address_type[key].premises_types;
|
||||||
let cityenduse: any = [];
|
}))
|
||||||
let existcity: any =[];
|
|
||||||
|
|
||||||
if(val.premises_city != ''){
|
this.additional_premises = Object.keys(data.records.additional_premises).map(function(key)
|
||||||
this.formPremisesCityArray = [];
|
{
|
||||||
val.premises_city.forEach(option => {
|
return data.records.additional_premises[key];
|
||||||
// cityenduse.push(option);
|
})
|
||||||
// existcity.push(val);
|
|
||||||
//this.formPremisesCityArray.push({additional_premises_city: option});
|
|
||||||
//this.addressForm.controls.additional_premises.value[index].premises_city = cityenduse;
|
|
||||||
console.log(option);
|
|
||||||
});
|
|
||||||
//console.log(cityenduse);
|
|
||||||
//this.formPremisesCityArray = existcity;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
if (additionalPremisesResult.length == 0) {
|
|
||||||
additionalPremisesControl.push(this.createPremises());
|
|
||||||
} else {
|
|
||||||
let cityenduse: any = [];
|
|
||||||
let existcity: any =[];
|
|
||||||
|
|
||||||
additionalPremisesResult.forEach(datas => {
|
|
||||||
if(datas.premises_city != ''){
|
|
||||||
cityenduse.push(datas.additional_premises_city);
|
|
||||||
existcity.push(datas);
|
|
||||||
}
|
|
||||||
additionalPremisesControl.push(this.createPremises());
|
|
||||||
});
|
|
||||||
|
|
||||||
this.formPremisesCityArray = existcity;
|
|
||||||
console.log(cityenduse);
|
|
||||||
console.log(existcity);
|
|
||||||
|
|
||||||
this.addressForm.controls['additional_premises'].setValue(additionalPremisesResult);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
console.log(this.bussiness_address_type);
|
||||||
|
console.log(this.additional_premises);
|
||||||
|
|
||||||
|
this.selectedValue(this.bussiness_address_type,this.additional_premises);
|
||||||
if(data.records.bussiness_address_type == 12) {
|
|
||||||
this.addressForm.controls.bussiness_address_type_others.setValue(data.records.bussiness_address_type_others);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (data.records.locality_others) {
|
if (data.records.locality_others) {
|
||||||
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
|
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (result.length == 0) {
|
// if (result.length == 0) {
|
||||||
// control.push(this.createNeighbour());
|
// control.push(this.createNeighbour());
|
||||||
// } else {
|
// } else {
|
||||||
@ -221,6 +212,7 @@ export class AddressComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public initAddressForm(): void {
|
public initAddressForm(): void {
|
||||||
this.addressForm = this.fb.group({
|
this.addressForm = this.fb.group({
|
||||||
address: ['', Validators.compose([Validators.required])],
|
address: ['', Validators.compose([Validators.required])],
|
||||||
@ -357,8 +349,12 @@ export class AddressComponent implements OnInit {
|
|||||||
// console.log(val);
|
// console.log(val);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
this.formPremisesCityArray = [];
|
||||||
|
|
||||||
|
this.addressForm.controls.additional_premises.value[index].premises_city = null;
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
records.additional_premises = this.addressForm.controls.additional_premises.value;
|
records.additional_premises = this.addressForm.controls.additional_premises.value;
|
||||||
@ -383,14 +379,12 @@ export class AddressComponent implements OnInit {
|
|||||||
// this.formPremisesCityArray.push({city: option});
|
// this.formPremisesCityArray.push({city: option});
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
SelectedPremises($event){
|
SelectedPremises($event){
|
||||||
console.log('event',$event);
|
|
||||||
|
|
||||||
let premisesData = $event.source.value;
|
let premisesData = $event.source.value;
|
||||||
|
console.log(premisesData);
|
||||||
|
|
||||||
|
if($event.checked === true ){
|
||||||
if($event.source._selected === true ){
|
|
||||||
|
|
||||||
//this.formPremisesArray.push({member: $event.source.value});
|
//this.formPremisesArray.push({member: $event.source.value});
|
||||||
//this.selectedSegmentDatas.push(CustomerSegmentName.name);
|
//this.selectedSegmentDatas.push(CustomerSegmentName.name);
|
||||||
@ -400,44 +394,181 @@ export class AddressComponent implements OnInit {
|
|||||||
|
|
||||||
this.formPremisesArray.push({premises_types: $event.source.value});
|
this.formPremisesArray.push({premises_types: $event.source.value});
|
||||||
|
|
||||||
//console.log(this.formPremisesArray);
|
console.log(this.formPremisesArray);
|
||||||
|
const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||||
let array = this.addressData.filter(data => data.address_type_id == premisesData);
|
let array = this.addressData.filter(data => data.address_type_id == premisesData)[0];
|
||||||
|
console.log(array);
|
||||||
if(premisesData == 12){
|
if(premisesData == 12){
|
||||||
this.PremisesOtherFlag = true;
|
this.PremisesOtherFlag = true;
|
||||||
this.PremisesLabel[this.z] = this.addressForm.get('bussiness_address_type_others').value;
|
// this.PremisesLabel[this.z] = this.pdQuestionAddress.get('bussiness_address_type_others').value;
|
||||||
|
control.push(this.createPremises());
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.PremisesLabel[this.z] = array[0].address_type;
|
this.PremisesLabel[this.z] = array.address_type;
|
||||||
|
control.push(this.createPremises());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
console.log(this.PremisesLabel);
|
||||||
this.z++;
|
this.z++;
|
||||||
|
|
||||||
|
|
||||||
const control = <FormArray>this.addressForm.controls['additional_premises'];
|
|
||||||
control.push(this.createPremises());
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if($event.source._selected === false ){
|
else if($event.checked === false ){
|
||||||
|
|
||||||
console.log('false',premisesData);
|
|
||||||
|
|
||||||
|
|
||||||
if(premisesData == 12){
|
if(premisesData == 12){
|
||||||
this.PremisesOtherFlag = false;
|
this.PremisesOtherFlag = false;
|
||||||
}
|
}
|
||||||
|
console.log(this.formPremisesArray);
|
||||||
|
let index = this.formPremisesArray.findIndex(form=>form.premises_types== $event.source.value);
|
||||||
|
console.log(index);
|
||||||
const control = <FormArray>this.addressForm.controls['additional_premises'];
|
const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||||
control.removeAt(this.z);
|
control.removeAt(index);
|
||||||
|
this.PremisesLabel.splice(index,1);
|
||||||
|
console.log(this.z);
|
||||||
this.z--;
|
this.z--;
|
||||||
//let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name);
|
|
||||||
//this.selectedSegmentDatas.splice(index,1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCity(e)
|
||||||
|
{
|
||||||
|
this.cityData = [];
|
||||||
|
e.forEach(val=>
|
||||||
|
{
|
||||||
|
this.cityData.push({additional_premises_city:val});
|
||||||
|
});
|
||||||
|
console.log(this.cityData);
|
||||||
|
}
|
||||||
|
otherValueset()
|
||||||
|
{
|
||||||
|
let z = this.z;
|
||||||
|
this.PremisesLabel[z-1] = this.addressForm.get('bussiness_address_type_others').value;
|
||||||
|
}
|
||||||
|
// checkaddress(value)
|
||||||
|
// {
|
||||||
|
// // console.log(value);
|
||||||
|
// if(value=="OTHERS")
|
||||||
|
// {
|
||||||
|
// this.addressRemarksAccess = true;
|
||||||
|
// }else
|
||||||
|
// {
|
||||||
|
// this.addressRemarksAccess = false;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// SelectedPremises($event){
|
||||||
|
// console.log('event',$event);
|
||||||
|
|
||||||
|
// let premisesData = $event.source.value;
|
||||||
|
|
||||||
|
|
||||||
|
// if($event.source._selected === true ){
|
||||||
|
|
||||||
|
// //this.formPremisesArray.push({member: $event.source.value});
|
||||||
|
// //this.selectedSegmentDatas.push(CustomerSegmentName.name);
|
||||||
|
// //console.log('true',premisesData);
|
||||||
|
|
||||||
|
// //console.log(this.formPremisesArray);
|
||||||
|
|
||||||
|
// this.formPremisesArray.push({premises_types: $event.source.value});
|
||||||
|
|
||||||
|
// //console.log(this.formPremisesArray);
|
||||||
|
|
||||||
|
// let array = this.addressData.filter(data => data.address_type_id == premisesData);
|
||||||
|
|
||||||
|
// if(premisesData == 12){
|
||||||
|
// this.PremisesOtherFlag = true;
|
||||||
|
// this.PremisesLabel[this.z] = this.addressForm.get('bussiness_address_type_others').value;
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// this.PremisesLabel[this.z] = array[0].address_type;
|
||||||
|
// }
|
||||||
|
// this.z++;
|
||||||
|
|
||||||
|
|
||||||
|
// const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||||
|
// control.push(this.createPremises());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else if($event.source._selected === false ){
|
||||||
|
|
||||||
|
// console.log('false',premisesData);
|
||||||
|
|
||||||
|
|
||||||
|
// if(premisesData == 12){
|
||||||
|
// this.PremisesOtherFlag = false;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||||
|
// control.removeAt(this.z);
|
||||||
|
// this.z--;
|
||||||
|
// //let index = this.selectedSegmentDatas.indexOf(CustomerSegmentName.name);
|
||||||
|
// //this.selectedSegmentDatas.splice(index,1);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
selectedValue(e,data)
|
||||||
|
{
|
||||||
|
console.log('501 function',);
|
||||||
|
console.log('inside function in bussiness_address_type,',e);
|
||||||
|
console.log('inside function in this.additional_premises,',data);
|
||||||
|
|
||||||
|
let premisesData = e ;
|
||||||
|
this.tempArr = [];
|
||||||
|
let that = this;
|
||||||
|
this.addressData = Object.keys(this.addressData).map(function(key)
|
||||||
|
{
|
||||||
|
that.addressData[key].status = 0;
|
||||||
|
return that.addressData[key];
|
||||||
|
})
|
||||||
|
console.log(this.addressData);
|
||||||
|
premisesData.forEach((val,index)=>
|
||||||
|
{
|
||||||
|
console.log(val);
|
||||||
|
this.z++;
|
||||||
|
// console.log(this.addressTypes);
|
||||||
|
this.formPremisesArray.push({premises_types: val});
|
||||||
|
|
||||||
|
this.tempArr.push(this.addressData.filter(add=>add.address_type_id==val)[0]);
|
||||||
|
|
||||||
|
this.PremisesLabel[index] = this.tempArr[index].address_type;
|
||||||
|
|
||||||
|
if(data[index] !==undefined && data[index].premises_ownership < 2 ){
|
||||||
|
data[index].premises_city = Object.keys(data[index].premises_city).map(function(key)
|
||||||
|
{
|
||||||
|
return data[index].premises_city[key].additional_premises_city;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.addressData.forEach(data=>
|
||||||
|
{
|
||||||
|
if(data.address_type_id == val)
|
||||||
|
{
|
||||||
|
data.status = 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
const control = <FormArray>this.addressForm.controls['additional_premises'] as FormArray;
|
||||||
|
|
||||||
|
// control.removeAt(0);
|
||||||
|
this.tempArr.forEach((item,index)=>
|
||||||
|
{
|
||||||
|
control.push(this.createPremises());
|
||||||
|
});
|
||||||
|
|
||||||
|
this.addressForm.controls['additional_premises'].setValue(data);
|
||||||
|
}
|
||||||
|
|
||||||
validateAllFormFields(formGroup: FormGroup) {
|
validateAllFormFields(formGroup: FormGroup) {
|
||||||
Object.keys(formGroup.controls).forEach(field => {
|
Object.keys(formGroup.controls).forEach(field => {
|
||||||
const control = formGroup.get(field);
|
const control = formGroup.get(field);
|
||||||
|
|||||||
@ -14,6 +14,306 @@
|
|||||||
|
|
||||||
|
|
||||||
<mat-tab-group>
|
<mat-tab-group>
|
||||||
|
<mat-tab label="Business Asset Questions">
|
||||||
|
<ng-template matTabContent>
|
||||||
|
<div fxLayout="row wrap">
|
||||||
|
<div fxFlex="100">
|
||||||
|
<mat-card style="min-height: 550px;">
|
||||||
|
<mat-card-content>
|
||||||
|
<div fxLayout="row" fxLayoutAlign="start none">
|
||||||
|
<div formArrayName="business_assets_details" fxFill>
|
||||||
|
<div *ngFor="let sup of _assetsQuesFrom.controls.business_assets_details['controls']; let i=index">
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-content>
|
||||||
|
<div [formGroupName]="i">
|
||||||
|
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
|
||||||
|
<mat-form-field style="width:100%">
|
||||||
|
<mat-select (selectionChange)="selectedAssetsType($event, i,2)" placeholder="Assets Type" formControlName="business_assets_mode" requried>
|
||||||
|
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<!--Desction Dynamic details: START-->
|
||||||
|
<div formArrayName="business_details" class="example-full-width">
|
||||||
|
<!--Property-->
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 1 ">
|
||||||
|
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||||
|
<div [formGroupName]="s">
|
||||||
|
<div>
|
||||||
|
<mat-form-field style="width:100%">
|
||||||
|
<mat-select placeholder="Property Type" formControlName="property_type" required>
|
||||||
|
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<mat-form-field *ngIf="detail.get('property_type').value == 5">
|
||||||
|
<input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--Four Wheeler-->
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 2">
|
||||||
|
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||||
|
<div [formGroupName]="s">
|
||||||
|
<div>
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" required autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--Two Wheeler-->
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 3">
|
||||||
|
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||||
|
<div [formGroupName]="s">
|
||||||
|
<div>
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" required autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--Consumer Durable-->
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 5">
|
||||||
|
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||||
|
<div [formGroupName]="s">
|
||||||
|
<div>
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Description" formControlName="consumer_durable_description" required>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--Insurance-->
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 6">
|
||||||
|
<div fxFill>
|
||||||
|
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||||
|
<div [formGroupName]="s">
|
||||||
|
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Premium Paid" formControlName="premium_paid" required (keypress)="keyPress($event)" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Frequency" formControlName="frequency_mode" required>
|
||||||
|
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Sum Assured" formControlName="sum_assured" required (keypress)="keyPress($event)" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Members Covered" formControlName="members_coverd" required autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--Investments-->
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 7">
|
||||||
|
<div>
|
||||||
|
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||||
|
<div [formGroupName]="s">
|
||||||
|
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Type" formControlName="investments_type" required>
|
||||||
|
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<!-- <div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 "> -->
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Specify Other Type" formControlName="other_investments_type" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
<!-- </div> -->
|
||||||
|
<div fxFlex="33" >
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" required (keypress)="keyPress($event)" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Bank Name" formControlName="bank_name" required autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--other assets-->
|
||||||
|
<!-- <div *ngIf="sup.get('assets_mode').value == 8"> -->
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 8">
|
||||||
|
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
||||||
|
<div [formGroupName]="s">
|
||||||
|
<div>
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" required autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" required autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
<!-- <mat-form-field class="ml-xs example-full-width"> -->
|
||||||
|
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" required> -->
|
||||||
|
<!-- </mat-form-field> -->
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" required>
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
<mat-option value="nan">NAN</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off">
|
||||||
|
<!-- <span matSuffix>.00</span> -->
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!--Desction Dynamic details : END -->
|
||||||
|
<!-- {{sup.get('business_assets_mode').value}} -->
|
||||||
|
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 4">
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" (keypress)="keyPress($event)" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5">
|
||||||
|
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Name of the Owner" formControlName="business_name_of_the_owner" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div fxFlex="33">
|
||||||
|
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<mat-select placeholder="Name of the Owner"
|
||||||
|
formControlName="business_name_of_the_owner" required>
|
||||||
|
|
||||||
|
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||||
|
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width" *ngIf="sup.get('business_name_of_the_owner').value == 0">
|
||||||
|
<input matInput placeholder="Specify Other Owner Name"
|
||||||
|
formControlName="other_owner" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<mat-select placeholder="Relation" formControlName="relation" required>
|
||||||
|
<mat-option value="{{relations.relationship_id}}"
|
||||||
|
*ngFor="let relations of m_relation">
|
||||||
|
{{relations.name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5">
|
||||||
|
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width" style="width:95%">
|
||||||
|
<mat-select placeholder="Is there a loan existing against this asset?" formControlName="business_emi">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width" style="width:95%">
|
||||||
|
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="business_emi_paid" (keypress)="keyPress($event)" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width" style="width:95%">
|
||||||
|
<input matInput placeholder="Original Loan Tenure in Months" formControlName="business_original_loan_tenure" autocomplete="off" (change)="loanCalc(sup,2)">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33" style="width:95%">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Balance Tenure in Months" formControlName="business_balance_tenure" autocomplete="off" (change)="loanCalc(sup,2)">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="sup.get('business_emi').value === 'yes' && sup.get('business_original_loan_tenure').value != '' && sup.get('business_balance_tenure').value != '' " fxFlex="33" style="width:95%">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<input matInput placeholder="Elapsed Tenure in Months" formControlName="business_elapsed_tenure" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
<!-- <p>Elapsed tenure is {{elapsed_tenure}}</p> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
|
||||||
|
<div fxFlex="20">
|
||||||
|
<span *ngIf="_assetsQuesFrom.controls.business_assets_details.controls.length > 1" (click)="removeLanguage(i,2)">
|
||||||
|
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row" style="text-align:right;">
|
||||||
|
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Business Asset Details" matTooltipPosition="above"
|
||||||
|
class="mr-1 mb-1 hover-icon" (click)="addSupplierDetails($event,2); false"><mat-icon>add</mat-icon></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</mat-card-content>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
</mat-tab>
|
||||||
<mat-tab label="Other Asset Questions">
|
<mat-tab label="Other Asset Questions">
|
||||||
<ng-template matTabContent>
|
<ng-template matTabContent>
|
||||||
<div fxLayout="row wrap">
|
<div fxLayout="row wrap">
|
||||||
@ -233,10 +533,36 @@
|
|||||||
</div>
|
</div>
|
||||||
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5">
|
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5">
|
||||||
|
|
||||||
<div fxFlex="33">
|
<!-- <div fxFlex="33">
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
<input matInput placeholder="Name of the Owner" formControlName="name_of_the_owner" autocomplete="off">
|
<input matInput placeholder="Name of the Owner" formControlName="name_of_the_owner" autocomplete="off">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
</div> -->
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<mat-select placeholder="Name of the Owner"
|
||||||
|
formControlName="name_of_the_owner" required>
|
||||||
|
|
||||||
|
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||||
|
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width" *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''">
|
||||||
|
<input matInput placeholder="Specify Other Owner Name"
|
||||||
|
formControlName="other_owner" autocomplete="off">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div fxFlex="33">
|
||||||
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
|
<mat-select placeholder="Relation" formControlName="relation" required>
|
||||||
|
<mat-option value="{{relations.relationship_id}}"
|
||||||
|
*ngFor="let relations of m_relation">
|
||||||
|
{{relations.name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -268,12 +594,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
|
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
|
||||||
<mat-form-field class="ml-xs example-full-width" style="width:95%">
|
<mat-form-field class="ml-xs example-full-width" style="width:95%">
|
||||||
<input matInput placeholder="Original Loan Tenure in Months" formControlName="original_loan_tenure" (change)="loanCalc(sup)" autocomplete="off">
|
<input matInput placeholder="Original Loan Tenure in Months" formControlName="original_loan_tenure" (change)="loanCalc(sup,1)" autocomplete="off">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33" style="width:95%">
|
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33" style="width:95%">
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
<mat-form-field class="ml-xs example-full-width">
|
||||||
<input matInput placeholder="Balance Tenure in Months" formControlName="balance_tenure" (change)="loanCalc(sup)" autocomplete="off">
|
<input matInput placeholder="Balance Tenure in Months" formControlName="balance_tenure" (change)="loanCalc(sup,1)" autocomplete="off">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="sup.get('emi').value === 'yes' && sup.get('original_loan_tenure').value != '' && sup.get('balance_tenure').value != '' " fxFlex="33" style="width:95%">
|
<div *ngIf="sup.get('emi').value === 'yes' && sup.get('original_loan_tenure').value != '' && sup.get('balance_tenure').value != '' " fxFlex="33" style="width:95%">
|
||||||
@ -307,276 +633,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mat-card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
</mat-tab>
|
|
||||||
<mat-tab label="Bussiness Asset Questions">
|
|
||||||
<ng-template matTabContent>
|
|
||||||
<div fxLayout="row wrap">
|
|
||||||
<div fxFlex="100">
|
|
||||||
<mat-card style="min-height: 550px;">
|
|
||||||
<mat-card-content>
|
|
||||||
<div fxLayout="row" fxLayoutAlign="start none">
|
|
||||||
<div formArrayName="business_assets_details" fxFill>
|
|
||||||
<div *ngFor="let sup of _assetsQuesFrom.controls.business_assets_details['controls']; let i=index">
|
|
||||||
<mat-card>
|
|
||||||
<mat-card-content>
|
|
||||||
<div [formGroupName]="i">
|
|
||||||
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
|
|
||||||
<mat-form-field style="width:100%">
|
|
||||||
<mat-select (selectionChange)="selectedAssetsType($event, i,2)" placeholder="Assets Type" formControlName="business_assets_mode" requried>
|
|
||||||
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<!--Desction Dynamic details: START-->
|
|
||||||
<div formArrayName="business_details" class="example-full-width">
|
|
||||||
<!--Property-->
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 1 ">
|
|
||||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
|
||||||
<div [formGroupName]="s">
|
|
||||||
<div>
|
|
||||||
<mat-form-field style="width:100%">
|
|
||||||
<mat-select placeholder="Property Type" formControlName="property_type" required>
|
|
||||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<mat-form-field *ngIf="detail.get('property_type').value == 5">
|
|
||||||
<input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--Four Wheeler-->
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 2">
|
|
||||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
|
||||||
<div [formGroupName]="s">
|
|
||||||
<div>
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" required autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--Two Wheeler-->
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 3">
|
|
||||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
|
||||||
<div [formGroupName]="s">
|
|
||||||
<div>
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" required autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--Consumer Durable-->
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 5">
|
|
||||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
|
||||||
<div [formGroupName]="s">
|
|
||||||
<div>
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Description" formControlName="consumer_durable_description" required>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--Insurance-->
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 6">
|
|
||||||
<div fxFill>
|
|
||||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
|
||||||
<div [formGroupName]="s">
|
|
||||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Premium Paid" formControlName="premium_paid" required (keypress)="keyPress($event)" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field>
|
|
||||||
<mat-select placeholder="Frequency" formControlName="frequency_mode" required>
|
|
||||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Sum Assured" formControlName="sum_assured" required (keypress)="keyPress($event)" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Members Covered" formControlName="members_coverd" required autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--Investments-->
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 7">
|
|
||||||
<div>
|
|
||||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
|
||||||
<div [formGroupName]="s">
|
|
||||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field>
|
|
||||||
<mat-select placeholder="Type" formControlName="investments_type" required>
|
|
||||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<!-- <div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 "> -->
|
|
||||||
<mat-form-field>
|
|
||||||
<input matInput placeholder="Specify Other Type" formControlName="other_investments_type" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
<!-- </div> -->
|
|
||||||
<div fxFlex="33" >
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" required (keypress)="keyPress($event)" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Bank Name" formControlName="bank_name" required autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--other assets-->
|
|
||||||
<!-- <div *ngIf="sup.get('assets_mode').value == 8"> -->
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 8">
|
|
||||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
|
|
||||||
<div [formGroupName]="s">
|
|
||||||
<div>
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" required autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" required autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
<!-- <mat-form-field class="ml-xs example-full-width"> -->
|
|
||||||
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" required> -->
|
|
||||||
<!-- </mat-form-field> -->
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" required>
|
|
||||||
<mat-option value="yes">Yes</mat-option>
|
|
||||||
<mat-option value="no">No</mat-option>
|
|
||||||
<mat-option value="nan">NAN</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off">
|
|
||||||
<!-- <span matSuffix>.00</span> -->
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!--Desction Dynamic details : END -->
|
|
||||||
<!-- {{sup.get('business_assets_mode').value}} -->
|
|
||||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 4">
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" (keypress)="keyPress($event)" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5">
|
|
||||||
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Name of the Owner" formControlName="business_name_of_the_owner" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5">
|
|
||||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
|
||||||
<div fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width" style="width:95%">
|
|
||||||
<mat-select placeholder="Is there a loan existing against this asset?" formControlName="business_emi">
|
|
||||||
<mat-option value="yes">Yes</mat-option>
|
|
||||||
<mat-option value="no">No</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width" style="width:95%">
|
|
||||||
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="business_emi_paid" (keypress)="keyPress($event)" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33">
|
|
||||||
<mat-form-field class="ml-xs example-full-width" style="width:95%">
|
|
||||||
<input matInput placeholder="Original Loan Tenure in Months" formControlName="business_original_loan_tenure" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33" style="width:95%">
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Balance Tenure in Months" formControlName="business_balance_tenure" autocomplete="off">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<!-- <div *ngIf="sup.get('emi').value === 'yes' && sup.get('original_loan_tenure').value != '' && sup.get('balance_tenure').value != '' " fxFlex="33" style="width:95%">
|
|
||||||
<mat-form-field class="ml-xs example-full-width">
|
|
||||||
<input matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off">
|
|
||||||
</mat-form-field> -->
|
|
||||||
<!-- <p>Elapsed tenure is {{elapsed_tenure}}</p> -->
|
|
||||||
<!-- </div> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
|
|
||||||
<div fxFlex="20">
|
|
||||||
<span *ngIf="_assetsQuesFrom.controls.business_assets_details.controls.length > 1" (click)="removeLanguage(i,2)">
|
|
||||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</mat-card-content>
|
|
||||||
</mat-card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row" style="text-align:right;">
|
|
||||||
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Business Asset Details" matTooltipPosition="above"
|
|
||||||
class="mr-1 mb-1 hover-icon" (click)="addSupplierDetails($event,2); false"><mat-icon>add</mat-icon></button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</mat-card-content>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -35,6 +35,8 @@ export class AssetsInfoComponent implements OnInit {
|
|||||||
public _assetsQuesFrom: FormGroup;
|
public _assetsQuesFrom: FormGroup;
|
||||||
public submitted = false;
|
public submitted = false;
|
||||||
public m_assets_type = [];
|
public m_assets_type = [];
|
||||||
|
public m_relation = [];
|
||||||
|
public applicants: any;
|
||||||
|
|
||||||
// public m_assets_type = [
|
// public m_assets_type = [
|
||||||
// {
|
// {
|
||||||
@ -168,6 +170,8 @@ public m_investmentType = [];
|
|||||||
private pdTrigerService: PdTrigerService,
|
private pdTrigerService: PdTrigerService,
|
||||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||||
|
this.applicants = this.pd_all_details.pdapplicants_detials;
|
||||||
|
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
|
||||||
this.notifier = notifier;
|
this.notifier = notifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,6 +185,7 @@ public m_investmentType = [];
|
|||||||
this.getM_PropertyType();
|
this.getM_PropertyType();
|
||||||
this.getM_InvestmentType();
|
this.getM_InvestmentType();
|
||||||
this.getM_FreqOfPurchase();
|
this.getM_FreqOfPurchase();
|
||||||
|
this.getM_Relation();
|
||||||
//this.getM_InsuranceType();
|
//this.getM_InsuranceType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,6 +227,17 @@ public m_investmentType = [];
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getM_Relation() {
|
||||||
|
this.pdTrigerService.getAllMasterDatas('RELATIONSHIPS').subscribe(
|
||||||
|
data => {
|
||||||
|
this.m_relation = data.records.filter(data => data.isactive == 1);
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
this.notifier.notify('warning', 'No Category Records Found.!');
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
getM_FreqOfPurchase() {
|
getM_FreqOfPurchase() {
|
||||||
this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe(
|
this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe(
|
||||||
data => {
|
data => {
|
||||||
@ -279,7 +295,7 @@ public m_investmentType = [];
|
|||||||
assets_form_remark:[value.assets_form_remark || 'check']
|
assets_form_remark:[value.assets_form_remark || 'check']
|
||||||
});
|
});
|
||||||
this.addAssetsDetailsWithData(value.assets_details);
|
this.addAssetsDetailsWithData(value.assets_details);
|
||||||
this.addAssetsDetailsWithData2(value.business_assets_details);
|
this.addBusinessAssetsDetailsWithData(value.business_assets_details);
|
||||||
} else {
|
} else {
|
||||||
this._assetsQuesFrom = this._formBuilder.group({
|
this._assetsQuesFrom = this._formBuilder.group({
|
||||||
pdid: [this.pdid],
|
pdid: [this.pdid],
|
||||||
@ -288,7 +304,7 @@ public m_investmentType = [];
|
|||||||
this.initDetails(),
|
this.initDetails(),
|
||||||
]),
|
]),
|
||||||
business_assets_details : this._formBuilder.array([
|
business_assets_details : this._formBuilder.array([
|
||||||
this.initnewDetails(),
|
this.initBusinessDetails(),
|
||||||
]),
|
]),
|
||||||
assets_form_remark:['']
|
assets_form_remark:['']
|
||||||
});
|
});
|
||||||
@ -310,6 +326,8 @@ public m_investmentType = [];
|
|||||||
details: this._formBuilder.array([]),
|
details: this._formBuilder.array([]),
|
||||||
approximate_market_value: ['', Validators.compose([])],
|
approximate_market_value: ['', Validators.compose([])],
|
||||||
name_of_the_owner: ['', Validators.compose([])],
|
name_of_the_owner: ['', Validators.compose([])],
|
||||||
|
other_owner:[''],
|
||||||
|
relation: [''],
|
||||||
// purchase_year: ['', Validators.compose([])],
|
// purchase_year: ['', Validators.compose([])],
|
||||||
//purchase_month: ['', Validators.compose([])],
|
//purchase_month: ['', Validators.compose([])],
|
||||||
emi: [''],
|
emi: [''],
|
||||||
@ -320,12 +338,14 @@ public m_investmentType = [];
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
initnewDetails() {
|
initBusinessDetails() {
|
||||||
return this._formBuilder.group({
|
return this._formBuilder.group({
|
||||||
business_assets_mode: ['', Validators.compose([Validators.required])],
|
business_assets_mode: ['', Validators.compose([Validators.required])],
|
||||||
business_details: this._formBuilder.array([]),
|
business_details: this._formBuilder.array([]),
|
||||||
business_approximate_market_value: ['', Validators.compose([])],
|
business_approximate_market_value: ['', Validators.compose([])],
|
||||||
business_name_of_the_owner: ['', Validators.compose([])],
|
business_name_of_the_owner: ['', Validators.compose([])],
|
||||||
|
// other_owner:[''],
|
||||||
|
// relation:[''],
|
||||||
// purchase_year: ['', Validators.compose([])],
|
// purchase_year: ['', Validators.compose([])],
|
||||||
//purchase_month: ['', Validators.compose([])],
|
//purchase_month: ['', Validators.compose([])],
|
||||||
business_emi: [''],
|
business_emi: [''],
|
||||||
@ -544,6 +564,8 @@ public m_investmentType = [];
|
|||||||
details: this._formBuilder.array([]),
|
details: this._formBuilder.array([]),
|
||||||
approximate_market_value: [data.approximate_market_value, Validators.compose([])],
|
approximate_market_value: [data.approximate_market_value, Validators.compose([])],
|
||||||
name_of_the_owner: [data.name_of_the_owner, Validators.compose([])],
|
name_of_the_owner: [data.name_of_the_owner, Validators.compose([])],
|
||||||
|
other_owner:[data.other_owner || ''],
|
||||||
|
relation: [data.relation || ''],
|
||||||
// purchase_year: [data.purchase_year, Validators.compose([])],
|
// purchase_year: [data.purchase_year, Validators.compose([])],
|
||||||
// purchase_month: [data.purchase_month, Validators.compose([])],
|
// purchase_month: [data.purchase_month, Validators.compose([])],
|
||||||
emi: [data.emi || 0],
|
emi: [data.emi || 0],
|
||||||
@ -553,12 +575,14 @@ public m_investmentType = [];
|
|||||||
elapsed_tenure: [data.elapsed_tenure || '']
|
elapsed_tenure: [data.elapsed_tenure || '']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initnewDetailsWithdata(data) {
|
initBusinessDetailsWithdata(data) {
|
||||||
return this._formBuilder.group({
|
return this._formBuilder.group({
|
||||||
business_assets_mode: [data.business_assets_mode, Validators.compose([Validators.required])],
|
business_assets_mode: [data.business_assets_mode, Validators.compose([Validators.required])],
|
||||||
business_details: this._formBuilder.array([]),
|
business_details: this._formBuilder.array([]),
|
||||||
business_approximate_market_value: [data.business_approximate_market_value, Validators.compose([])],
|
business_approximate_market_value: [data.business_approximate_market_value, Validators.compose([])],
|
||||||
business_name_of_the_owner: [data.business_name_of_the_owner, Validators.compose([])],
|
business_name_of_the_owner: [data.business_name_of_the_owner, Validators.compose([])],
|
||||||
|
// other_owner:[data.other_owner || ''],
|
||||||
|
// relation: [data.relation || ''],
|
||||||
// purchase_year: [data.purchase_year, Validators.compose([])],
|
// purchase_year: [data.purchase_year, Validators.compose([])],
|
||||||
// purchase_month: [data.purchase_month, Validators.compose([])],
|
// purchase_month: [data.purchase_month, Validators.compose([])],
|
||||||
business_emi: [data.business_emi || 0],
|
business_emi: [data.business_emi || 0],
|
||||||
@ -580,6 +604,8 @@ public m_investmentType = [];
|
|||||||
assets_mode: val.assets_mode,
|
assets_mode: val.assets_mode,
|
||||||
approximate_market_value: val.approximate_market_value,
|
approximate_market_value: val.approximate_market_value,
|
||||||
name_of_the_owner: val.name_of_the_owner,
|
name_of_the_owner: val.name_of_the_owner,
|
||||||
|
other_owner:val.other_owner,
|
||||||
|
relation: val.relation,
|
||||||
// purchase_year: val.purchase_year,
|
// purchase_year: val.purchase_year,
|
||||||
// purchase_month: val.purchase_month,
|
// purchase_month: val.purchase_month,
|
||||||
emi: val.emi,
|
emi: val.emi,
|
||||||
@ -596,7 +622,7 @@ public m_investmentType = [];
|
|||||||
this.loadDetails = true;
|
this.loadDetails = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
addAssetsDetailsWithData2(supp_data) {
|
addBusinessAssetsDetailsWithData(supp_data) {
|
||||||
|
|
||||||
console.log(supp_data);
|
console.log(supp_data);
|
||||||
|
|
||||||
@ -609,6 +635,8 @@ public m_investmentType = [];
|
|||||||
business_assets_mode: val.business_assets_mode,
|
business_assets_mode: val.business_assets_mode,
|
||||||
business_approximate_market_value: val.business_approximate_market_value,
|
business_approximate_market_value: val.business_approximate_market_value,
|
||||||
business_name_of_the_owner: val.business_name_of_the_owner,
|
business_name_of_the_owner: val.business_name_of_the_owner,
|
||||||
|
// other_owner: val.other_owner,
|
||||||
|
// relation : val.relation,
|
||||||
// purchase_year: val.purchase_year,
|
// purchase_year: val.purchase_year,
|
||||||
// purchase_month: val.purchase_month,
|
// purchase_month: val.purchase_month,
|
||||||
business_emi: val.business_emi,
|
business_emi: val.business_emi,
|
||||||
@ -622,7 +650,7 @@ public m_investmentType = [];
|
|||||||
// this.setAssetsDetailsWithData(vals.business_assets_mode, val.details, control.length - 1)
|
// this.setAssetsDetailsWithData(vals.business_assets_mode, val.details, control.length - 1)
|
||||||
|
|
||||||
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
|
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
|
||||||
control.push(this.initnewDetailsWithdata(vals));
|
control.push(this.initBusinessDetailsWithdata(vals));
|
||||||
this.setAssetsDetailsWithData2(vals.business_assets_mode, val.business_details, control.length - 1)
|
this.setAssetsDetailsWithData2(vals.business_assets_mode, val.business_details, control.length - 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -745,7 +773,7 @@ public m_investmentType = [];
|
|||||||
control.push(this.initDetails());
|
control.push(this.initDetails());
|
||||||
}else if(flag == 2){
|
}else if(flag == 2){
|
||||||
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
|
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
|
||||||
control.push(this.initnewDetails());
|
control.push(this.initBusinessDetails());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
removeLanguage(i: number,flag) {
|
removeLanguage(i: number,flag) {
|
||||||
@ -839,8 +867,9 @@ public m_investmentType = [];
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loanCalc(details)
|
loanCalc(details ,flag)
|
||||||
{
|
{
|
||||||
|
if(flag == 1){
|
||||||
//console.log(details.value);
|
//console.log(details.value);
|
||||||
let ElapsedValues;
|
let ElapsedValues;
|
||||||
|
|
||||||
@ -848,6 +877,15 @@ public m_investmentType = [];
|
|||||||
ElapsedValues = details.value.original_loan_tenure - details.value.balance_tenure ;
|
ElapsedValues = details.value.original_loan_tenure - details.value.balance_tenure ;
|
||||||
details.controls['elapsed_tenure'].setValue(ElapsedValues);
|
details.controls['elapsed_tenure'].setValue(ElapsedValues);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if(flag == 2){
|
||||||
|
let BusinessElapsedValues;
|
||||||
|
|
||||||
|
if(details.value.business_original_loan_tenure != null && details.value.business_original_loan_tenure != '' && details.value.business_balance_tenure != null && details.value.business_balance_tenure != ''){
|
||||||
|
BusinessElapsedValues = details.value.business_original_loan_tenure - details.value.business_balance_tenure ;
|
||||||
|
details.controls['business_elapsed_tenure'].setValue(BusinessElapsedValues);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
<div fxLayout="row wrap">
|
<div fxLayout="row wrap">
|
||||||
<div fxFlex="100">
|
<div fxFlex="100">
|
||||||
<!-- start main applicant -->
|
<!-- start main applicant -->
|
||||||
<mat-card>
|
<mat-card *ngIf="rawMaterialAccess">
|
||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
<p>Raw Materials<p>
|
<p>Raw Materials<p>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
@ -26,39 +26,50 @@
|
|||||||
<div *ngFor="let details of stockForm.controls.raw_materials['controls']; let i=index"
|
<div *ngFor="let details of stockForm.controls.raw_materials['controls']; let i=index"
|
||||||
[formGroupName]="i">
|
[formGroupName]="i">
|
||||||
<mat-card-content class="matcard">
|
<mat-card-content class="matcard">
|
||||||
<mat-form-field>
|
<mat-form-field style="width:30%">
|
||||||
<input matInput placeholder="Name" formControlName="raw_name" required>
|
<input matInput placeholder="Name" formControlName="raw_name" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field style="width:30%">
|
||||||
<mat-select placeholder="is the Stock is Observed ?"
|
<mat-select placeholder="is the Stock is Observed ?"
|
||||||
formControlName="stock_observed" required>
|
formControlName="stock_observed" required
|
||||||
|
(selectionChange)="RawMaterialValidation($event)">
|
||||||
<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 *ngIf="details.get('stock_observed').value == 'no'" >
|
<span *ngIf="details.get('stock_observed').value == 'no'" >
|
||||||
<mat-form-field>
|
<mat-form-field style="width:30%">
|
||||||
<input matInput placeholder="Estimated Quantity" formControlName="raw_quantity" required>
|
<input matInput placeholder="Estimated Quantity" formControlName="raw_quantity" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field style="width:30%">
|
||||||
<mat-select placeholder="Unit of Mearsurement"
|
<mat-select placeholder="Unit of Mearsurement"
|
||||||
formControlName="raw_uom" required>
|
formControlName="raw_uom" required>
|
||||||
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
|
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field *ngIf="details.get('raw_uom').value == 61" >
|
<mat-form-field *ngIf="details.get('raw_uom').value == 61" style="width:30%">
|
||||||
<input matInput placeholder="Specify Other UOM" formControlName="other_uom" required>
|
<input matInput placeholder="Specify Other UOM" formControlName="other_uom" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field style="width:76%">
|
||||||
<input matInput placeholder="Value" formControlName="raw_value" (keypress)="keyPress($event)" required>
|
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required>
|
||||||
|
<mat-hint align="end" *ngIf="details.get('raw_value').value != ''">{{"₹"}} {{rawValueInWords}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:76%">
|
<mat-form-field style="width:76%">
|
||||||
<input matInput placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" required>
|
<input matInput placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:76%">
|
<mat-form-field style="width:90%">
|
||||||
<input matInput placeholder="Is the stock of raw materials observed ?" formControlName="is_sufficiant_raw" required>
|
<!-- <input matInput placeholder="Is the stock of raw materials observed ?" formControlName="is_sufficiant_raw" required> -->
|
||||||
|
<mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw" required>
|
||||||
|
<mat-option value="yes" >Yes</mat-option>
|
||||||
|
<mat-option value="no" >No</mat-option>
|
||||||
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
<mat-form-field *ngIf="details.get('is_sufficiant_raw').value == 'no'" appearance="outline" style="width: 90%">
|
||||||
|
<mat-label>Please comment on the stock level observed?</mat-label>
|
||||||
|
<textarea matInput placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
|
||||||
<button type="button" mat-raised-button mat-icon-button (click)="addRawMaterials()"
|
<button type="button" mat-raised-button mat-icon-button (click)="addRawMaterials()"
|
||||||
matTooltip="Add More Raw Materials" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0">
|
matTooltip="Add More Raw Materials" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0">
|
||||||
@ -79,7 +90,7 @@
|
|||||||
<div fxLayout="row wrap">
|
<div fxLayout="row wrap">
|
||||||
<div fxFlex="100">
|
<div fxFlex="100">
|
||||||
<!-- start co applicant form details -->
|
<!-- start co applicant form details -->
|
||||||
<mat-card>
|
<mat-card *ngIf="finishedGoodsAccess">
|
||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
<p>Finished Goods<p>
|
<p>Finished Goods<p>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
@ -87,21 +98,40 @@
|
|||||||
<div *ngFor="let details of stockForm.controls.finished_goods['controls']; let i=index"
|
<div *ngFor="let details of stockForm.controls.finished_goods['controls']; let i=index"
|
||||||
[formGroupName]="i">
|
[formGroupName]="i">
|
||||||
<mat-card-content class="matcard">
|
<mat-card-content class="matcard">
|
||||||
<mat-form-field>
|
<mat-form-field style="width:30%">
|
||||||
<input matInput placeholder="Name" formControlName="goods_name" required>
|
<input matInput placeholder="Name" formControlName="goods_name" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field style="width:30%">
|
||||||
|
<mat-select placeholder="is the Goods is Observed ?"
|
||||||
|
formControlName="goods_observed" required
|
||||||
|
(selectionChange)="GoodsValidation($event)">
|
||||||
|
<mat-option value="yes" >Yes</mat-option>
|
||||||
|
<mat-option value="no" >No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<span *ngIf="details.get('goods_observed').value == 'no'" >
|
||||||
|
<mat-form-field style="width:30%">
|
||||||
<input matInput placeholder="Estimated Quantity" formControlName="goods_quantity" required>
|
<input matInput placeholder="Estimated Quantity" formControlName="goods_quantity" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field style="width:76%">
|
||||||
<input matInput placeholder="Value" formControlName="goods_value" (keypress)="keyPress($event)" required>
|
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,2)" required>
|
||||||
|
<mat-hint align="end" *ngIf="details.get('goods_value').value != ''">{{"₹"}} {{goodsValueInWords}} Only</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:76%">
|
<mat-form-field style="width:76%">
|
||||||
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required>
|
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field style="width:76%">
|
<mat-form-field style="width:90%">
|
||||||
<input matInput placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required>
|
<!-- <input matInput placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required> -->
|
||||||
|
<mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required>
|
||||||
|
<mat-option value="yes" >Yes</mat-option>
|
||||||
|
<mat-option value="no" >No</mat-option>
|
||||||
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="details.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
|
||||||
|
<mat-label>Please comment on the finished goods stock level observed?</mat-label>
|
||||||
|
<textarea matInput placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
</span>
|
||||||
|
|
||||||
<button type="button" mat-raised-button mat-icon-button (click)="addGoods()"
|
<button type="button" mat-raised-button mat-icon-button (click)="addGoods()"
|
||||||
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0">
|
matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0">
|
||||||
@ -117,6 +147,68 @@
|
|||||||
</mat-card>
|
</mat-card>
|
||||||
<!-- end co apllicant -->
|
<!-- end co apllicant -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div fxLayout="row wrap">
|
||||||
|
<div fxFlex="100">
|
||||||
|
<mat-card *ngIf="tradeConcernAccess">
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Stock of Goods Traded<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="traded_goods">
|
||||||
|
<div *ngFor="let details of stockForm.controls.traded_goods['controls']; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field style="width:30%">
|
||||||
|
<input matInput placeholder="Name" formControlName="traded_goods_name" required>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width:30%">
|
||||||
|
<mat-select placeholder="is the Traded Goods is Observed ?"
|
||||||
|
formControlName="traded_goods_observed" required
|
||||||
|
(selectionChange)="TradedGoodsValidation($event)">
|
||||||
|
<mat-option value="yes" >Yes</mat-option>
|
||||||
|
<mat-option value="no" >No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<span *ngIf="details.get('traded_goods_observed').value == 'no'" >
|
||||||
|
<mat-form-field style="width:30%">
|
||||||
|
<input matInput placeholder="Estimated Quantity" formControlName="traded_goods_quantity" required>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width:76%">
|
||||||
|
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,3)" required>
|
||||||
|
<mat-hint align="end" *ngIf="details.get('estimated_traded_goods_value').value != ''">{{"₹"}} {{tradedGoodsValueInWords}} Only</mat-hint>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width:76%">
|
||||||
|
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field style="width:90%">
|
||||||
|
<!-- <input matInput placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required> -->
|
||||||
|
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" required>
|
||||||
|
<mat-option value="yes" >Yes</mat-option>
|
||||||
|
<mat-option value="no" >No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="details.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
|
||||||
|
<mat-label>Please comment on the Traded Goods stock level observed?</mat-label>
|
||||||
|
<textarea matInput placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addTradedGoods()"
|
||||||
|
matTooltip="Add More Traded Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteTradedGoods(i)"
|
||||||
|
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="i>0">
|
||||||
|
<mat-icon>delete</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
@ -238,7 +330,7 @@
|
|||||||
<mat-dialog-actions>
|
<mat-dialog-actions>
|
||||||
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
||||||
<mat-form-field appearance="outline" style="width: 100%">
|
<mat-form-field appearance="outline" style="width: 100%">
|
||||||
<mat-label>Please comment on the stock level observed?</mat-label>
|
<mat-label>Remarks</mat-label>
|
||||||
<textarea matInput placeholder="Remarks" formControlName="stock_remarks"></textarea>
|
<textarea matInput placeholder="Remarks" formControlName="stock_remarks"></textarea>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -38,7 +38,14 @@ export class StockComponent implements OnInit {
|
|||||||
public stockForm: FormGroup;
|
public stockForm: FormGroup;
|
||||||
private notifier: NotifierService;
|
private notifier: NotifierService;
|
||||||
public uomData : any = [];
|
public uomData : any = [];
|
||||||
|
|
||||||
rawmaterial : any;
|
rawmaterial : any;
|
||||||
|
goodsValueInWords : any;
|
||||||
|
rawValueInWords : any;
|
||||||
|
tradedGoodsValueInWords : any;
|
||||||
|
rawMaterialAccess: boolean;
|
||||||
|
finishedGoodsAccess: boolean;
|
||||||
|
tradeConcernAccess: boolean;
|
||||||
|
|
||||||
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@ -50,90 +57,185 @@ export class StockComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.initstockForm();
|
this.initstockForm();
|
||||||
this.getUOM();
|
this.getUOM();
|
||||||
this.setSku('data',0);
|
//this.setSku('data',0);
|
||||||
let params: any = {};
|
let params: any = {};
|
||||||
|
let activityArray : any = [];
|
||||||
params.pd_id = this.pdid;
|
params.pd_id = this.pdid;
|
||||||
params.pd_form_id = this.form_id;
|
params.pd_form_id = this.form_id;
|
||||||
|
|
||||||
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:'1'}).subscribe(value => {
|
this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(value => {
|
||||||
console.log('Raw material Name',value.records.main_raw_materials);
|
console.log(value);
|
||||||
|
const rawMaterial = <FormArray>this.stockForm.controls['raw_materials'];
|
||||||
|
const finishedGoods = <FormArray>this.stockForm.controls['finished_goods'];
|
||||||
|
const tradedGoods = <FormArray>this.stockForm.controls['traded_goods'];
|
||||||
|
|
||||||
|
if (value.status == 200) {
|
||||||
|
console.log('value.records',value.records);
|
||||||
|
value.records.type_of_activity.forEach(val => {
|
||||||
|
//console.log(val);
|
||||||
|
//console.log(val.type_of_activity_id);
|
||||||
|
this.rawMaterialAccess = true;
|
||||||
|
this.finishedGoodsAccess = true;
|
||||||
|
this.tradeConcernAccess = true;
|
||||||
|
if(val.type_of_activity_id == 1){
|
||||||
|
rawMaterial.push(this.createRawmaterial());
|
||||||
|
finishedGoods.push(this.createGoods());
|
||||||
|
tradedGoods.push(this.createTradedGoods());
|
||||||
|
}
|
||||||
|
else if(val.type_of_activity_id == 2){
|
||||||
|
rawMaterial.push(this.createRawmaterial());
|
||||||
|
finishedGoods.push(this.createGoods());
|
||||||
|
}
|
||||||
|
else if(val.type_of_activity_id == 3){
|
||||||
|
rawMaterial.push(this.createRawmaterial());
|
||||||
|
finishedGoods.push(this.createGoods());
|
||||||
|
}
|
||||||
|
// else if(val.type_of_activity_id == 4){
|
||||||
|
// }
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:'1'}).subscribe(value => {
|
||||||
|
//console.log('Raw material Name',value.records.main_raw_materials);
|
||||||
|
|
||||||
// const faControl = (<FormArray>this.stockForm.controls['raw_materials']).at(1);
|
// const faControl = (<FormArray>this.stockForm.controls['raw_materials']).at(1);
|
||||||
|
|
||||||
const control = (<FormArray>this.stockForm.controls['raw_materials']).at(0);
|
//const control = (<FormArray>this.stockForm.controls['raw_materials']).at(0);
|
||||||
console.log(control);
|
//console.log(control);
|
||||||
|
|
||||||
// this.stockForm.controls['raw_materials'].setValue(value.records.main_raw_materials);
|
// this.stockForm.controls['raw_materials'].setValue(value.records.main_raw_materials);
|
||||||
if (value.status == 200) {
|
// if (value.status == 200) {
|
||||||
this.rawmaterial = value.records.main_raw_materials;
|
// this.rawmaterial = value.records.main_raw_materials;
|
||||||
}else{ this.rawmaterial = ''; }
|
// }else{ this.rawmaterial = ''; }
|
||||||
})
|
})
|
||||||
|
|
||||||
this._pd.retriveForm(params).subscribe(value => {
|
this._pd.retriveForm(params).subscribe(value => {
|
||||||
console.log('value', value);
|
//console.log('value', value);
|
||||||
const rawMaterial = <FormArray>this.stockForm.controls['raw_materials'];
|
|
||||||
const finishedGoods = <FormArray>this.stockForm.controls['finished_goods'];
|
|
||||||
if (value.status == 200) {
|
if (value.status == 200) {
|
||||||
|
console.log('data',value);
|
||||||
|
// Raw Material Access is True means., Data have to load,
|
||||||
|
if(this.rawMaterialAccess == true){
|
||||||
|
|
||||||
let result = Object.keys(value.records.raw_materials).map(function(key) {
|
let result = Object.keys(value.records.raw_materials).map(function(key) {
|
||||||
return value.records.raw_materials[key];
|
return value.records.raw_materials[key];
|
||||||
});
|
});
|
||||||
let result_Goods = Object.keys(value.records.finished_goods).map(function(key) {
|
|
||||||
return value.records.finished_goods[key];
|
|
||||||
});
|
|
||||||
this.stockForm.controls['stock_remarks'].setValue(value.records.stock_remarks);
|
|
||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
|
|
||||||
result.forEach(val => {
|
result.forEach(val => {
|
||||||
|
|
||||||
|
//this.RawMaterialValidation(val.stock_observed);
|
||||||
rawMaterial.push(this.createRawmaterial());
|
rawMaterial.push(this.createRawmaterial());
|
||||||
|
if(val.raw_value != '' && val.raw_value != null ){ this.rawValueInWords = this._pd.convertNumberToWords(val.raw_value); }
|
||||||
});
|
});
|
||||||
this.stockForm.controls['raw_materials'].setValue(result);
|
this.stockForm.controls['raw_materials'].setValue(result);
|
||||||
} else {
|
} else {
|
||||||
rawMaterial.push(this.createRawmaterial());
|
rawMaterial.push(this.createRawmaterial());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finished Goods Access is TRUE Means., data have to load.,
|
||||||
|
if(this.finishedGoodsAccess == true){
|
||||||
|
let result_Goods = Object.keys(value.records.finished_goods).map(function(key) {
|
||||||
|
return value.records.finished_goods[key];
|
||||||
|
});
|
||||||
|
|
||||||
if (result_Goods.length > 0) {
|
if (result_Goods.length > 0) {
|
||||||
|
|
||||||
result_Goods.forEach(val => {
|
result_Goods.forEach(val => {
|
||||||
|
|
||||||
|
//this.GoodsValidation(val.goods_observed);
|
||||||
finishedGoods.push(this.createGoods());
|
finishedGoods.push(this.createGoods());
|
||||||
|
if(val.goods_value != '' && val.goods_value != null ){ this.goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); }
|
||||||
});
|
});
|
||||||
this.stockForm.controls['finished_goods'].setValue(result_Goods);
|
this.stockForm.controls['finished_goods'].setValue(result_Goods);
|
||||||
} else {
|
} else {
|
||||||
finishedGoods.push(this.createGoods());
|
finishedGoods.push(this.createGoods());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//TradeConcern Access is TRUE Means., data have to load.,
|
||||||
|
if(this.tradeConcernAccess == true){
|
||||||
|
let result_Traded_Goods = Object.keys(value.records.finished_goods).map(function(key) {
|
||||||
|
return value.records.traded_goods[key];
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result_Traded_Goods.length > 0) {
|
||||||
|
|
||||||
|
result_Traded_Goods.forEach(val => {
|
||||||
|
|
||||||
|
|
||||||
|
tradedGoods.push(this.createTradedGoods());
|
||||||
|
if(val.traded_goods_value != '' && val.traded_goods_value != null )
|
||||||
|
{ this.tradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value); }
|
||||||
|
});
|
||||||
|
this.stockForm.controls['traded_goods'].setValue(result_Traded_Goods);
|
||||||
} else {
|
} else {
|
||||||
rawMaterial.push(this.createRawmaterial());
|
tradedGoods.push(this.createTradedGoods());
|
||||||
finishedGoods.push(this.createGoods());
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.stockForm.controls['stock_remarks'].setValue(value.records.stock_remarks);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// rawMaterial.push(this.createRawmaterial());
|
||||||
|
// finishedGoods.push(this.createGoods());
|
||||||
|
// tradedGoods.push(this.createTradedGoods());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public initstockForm(): void {
|
public initstockForm(): void {
|
||||||
this.stockForm = this.fb.group({
|
this.stockForm = this.fb.group({
|
||||||
stock_remarks: ['', Validators.compose([Validators.required])],
|
stock_remarks: ['', Validators.compose([Validators.required])],
|
||||||
raw_materials: this.fb.array([]),
|
raw_materials: this.fb.array([]),
|
||||||
finished_goods: this.fb.array([])
|
finished_goods: this.fb.array([]),
|
||||||
|
traded_goods: this.fb.array([])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setSku(sku: string, index: number) {
|
//setSku(sku: string, index: number) {
|
||||||
// const faControl =
|
// const faControl =
|
||||||
// (<FormArray>this.stockForm.controls['raw_materials']).at(index);
|
// (<FormArray>this.stockForm.controls['raw_materials']).at(index);
|
||||||
// faControl['controls'].raw_name.setValue(sku);
|
// faControl['controls'].raw_name.setValue(sku);
|
||||||
}
|
// }
|
||||||
createRawmaterial() {
|
createRawmaterial() {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
raw_name: ['', Validators.compose([Validators.required])],
|
raw_name: ['', Validators.compose([Validators.required])],
|
||||||
stock_observed:['', Validators.compose([Validators.required])],
|
stock_observed:['', Validators.compose([Validators.required])],
|
||||||
raw_quantity: ['', Validators.compose([Validators.required])],
|
raw_quantity: [''],
|
||||||
raw_uom: ['', Validators.compose([Validators.required])],
|
raw_uom: [''],
|
||||||
other_uom : [''],
|
other_uom : [''],
|
||||||
raw_value: ['', Validators.compose([Validators.required])],
|
raw_value: [''],
|
||||||
rawmaterial_value: ['', Validators.compose([Validators.required])],
|
rawmaterial_value: [''],
|
||||||
is_sufficiant_raw: ['', Validators.compose([Validators.required])],
|
is_sufficiant_raw: [''],
|
||||||
|
rawmaterial_remarks:['']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
createGoods() {
|
createGoods() {
|
||||||
return this.fb.group({
|
return this.fb.group({
|
||||||
goods_name: ['', Validators.compose([Validators.required])],
|
goods_name: ['', Validators.compose([Validators.required])],
|
||||||
goods_quantity: ['', Validators.compose([Validators.required])],
|
goods_observed: ['', Validators.compose([Validators.required])],
|
||||||
goods_value: ['', Validators.compose([Validators.required])],
|
goods_quantity: [''],
|
||||||
finished_goods_value: ['', Validators.compose([Validators.required])],
|
goods_value: [''],
|
||||||
is_sufficiant_goods: ['', Validators.compose([Validators.required])],
|
finished_goods_value: [''],
|
||||||
|
is_sufficiant_goods: [''],
|
||||||
|
finishedgoods_remarks:['']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
createTradedGoods() {
|
||||||
|
return this.fb.group({
|
||||||
|
traded_goods_name: ['', Validators.compose([Validators.required])],
|
||||||
|
traded_goods_observed: ['', Validators.compose([Validators.required])],
|
||||||
|
traded_goods_quantity: [''],
|
||||||
|
estimated_traded_goods_value: [''],
|
||||||
|
traded_goods_value: [''],
|
||||||
|
is_sufficiant_traded_goods: [''],
|
||||||
|
traded_goods_remarks:['']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
addRawMaterials() {
|
addRawMaterials() {
|
||||||
@ -152,6 +254,15 @@ export class StockComponent implements OnInit {
|
|||||||
const control = <FormArray>this.stockForm.controls['finished_goods'];
|
const control = <FormArray>this.stockForm.controls['finished_goods'];
|
||||||
control.removeAt(index);
|
control.removeAt(index);
|
||||||
}
|
}
|
||||||
|
addTradedGoods() {
|
||||||
|
const control = <FormArray>this.stockForm.controls['traded_goods'];
|
||||||
|
control.push(this.createTradedGoods());
|
||||||
|
}
|
||||||
|
deleteTradedGoods(index) {
|
||||||
|
const control = <FormArray>this.stockForm.controls['traded_goods'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
|
||||||
submitDetails() {
|
submitDetails() {
|
||||||
if (!this.stockForm.valid) {
|
if (!this.stockForm.valid) {
|
||||||
return;
|
return;
|
||||||
@ -160,12 +271,16 @@ export class StockComponent implements OnInit {
|
|||||||
records.pdid = this.pdid;
|
records.pdid = this.pdid;
|
||||||
records.formid = this.form_id;
|
records.formid = this.form_id;
|
||||||
records.fk_createdby = this.pdid;
|
records.fk_createdby = this.pdid;
|
||||||
records.raw_materials = this.stockForm.controls['raw_materials'].value;
|
if(this.rawMaterialAccess == true){
|
||||||
|
records.raw_materials = this.stockForm.controls['raw_materials'].value; }
|
||||||
|
if(this.finishedGoodsAccess == true){
|
||||||
|
records.finished_goods = this.stockForm.controls['finished_goods'].value;}
|
||||||
|
if(this.tradeConcernAccess == true){
|
||||||
|
records.traded_goods = this.stockForm.controls['traded_goods'].value; }
|
||||||
records.stock_remarks = this.stockForm.controls['stock_remarks'].value;
|
records.stock_remarks = this.stockForm.controls['stock_remarks'].value;
|
||||||
records.finished_goods = this.stockForm.controls['finished_goods'].value;
|
//console.log('data', records);
|
||||||
console.log('data', records);
|
|
||||||
this._pd.saveForm(records).subscribe(data => {
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
console.log('data', data);
|
//console.log('data', data);
|
||||||
this.notifier.notify('success', 'Saved Successfully.');
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
}, error => {
|
}, error => {
|
||||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
@ -201,4 +316,151 @@ export class StockComponent implements OnInit {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** To Convert Amount into Words */
|
||||||
|
inWords(e,flag:number){
|
||||||
|
switch(flag){
|
||||||
|
case 1 :
|
||||||
|
this.rawValueInWords = this._pd.convertNumberToWords(e.target.value);
|
||||||
|
break;
|
||||||
|
case 2 :
|
||||||
|
this.goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
|
||||||
|
break;
|
||||||
|
case 3 :
|
||||||
|
this.tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validation Dynamically Add And Remove
|
||||||
|
GoodsValidation(event: any){
|
||||||
|
// console.log('First Time',event);
|
||||||
|
// console.log('First Time Value',event.value);
|
||||||
|
|
||||||
|
const control = <FormArray>this.stockForm.controls['finished_goods'];
|
||||||
|
|
||||||
|
if(event.value == 'no') {
|
||||||
|
|
||||||
|
control.controls[0].get('goods_quantity').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('goods_quantity').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('goods_value').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('goods_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('finished_goods_value').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('finished_goods_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('is_sufficiant_goods').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('is_sufficiant_goods').updateValueAndValidity();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if(event.value == 'yes') {
|
||||||
|
|
||||||
|
control.controls[0].get('goods_quantity').clearValidators();
|
||||||
|
control.controls[0].get('goods_quantity').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('goods_value').clearValidators();
|
||||||
|
control.controls[0].get('goods_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('finished_goods_value').clearValidators();
|
||||||
|
control.controls[0].get('finished_goods_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('is_sufficiant_goods').clearValidators();
|
||||||
|
control.controls[0].get('is_sufficiant_goods').updateValueAndValidity();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
RawMaterialValidation(event: any){
|
||||||
|
// console.log('First Time',event);
|
||||||
|
// console.log('First Time Value',event.value);
|
||||||
|
|
||||||
|
const control = <FormArray>this.stockForm.controls['raw_materials'];
|
||||||
|
|
||||||
|
if(event.value == 'no') {
|
||||||
|
|
||||||
|
control.controls[0].get('raw_quantity').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('raw_quantity').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('raw_uom').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('raw_uom').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('raw_value').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('raw_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('rawmaterial_value').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('rawmaterial_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('is_sufficiant_raw').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('is_sufficiant_raw').updateValueAndValidity();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if(event.value == 'yes') {
|
||||||
|
|
||||||
|
control.controls[0].get('raw_quantity').clearValidators();
|
||||||
|
control.controls[0].get('raw_quantity').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('raw_uom').clearValidators();
|
||||||
|
control.controls[0].get('raw_uom').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('raw_value').clearValidators();
|
||||||
|
control.controls[0].get('raw_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('rawmaterial_value').clearValidators();
|
||||||
|
control.controls[0].get('rawmaterial_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('is_sufficiant_raw').clearValidators();
|
||||||
|
control.controls[0].get('is_sufficiant_raw').updateValueAndValidity();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
TradedGoodsValidation(event: any){
|
||||||
|
console.log('First Time',event);
|
||||||
|
console.log('First Time Value',event.value);
|
||||||
|
|
||||||
|
const control = <FormArray>this.stockForm.controls['tradeded_goods'];
|
||||||
|
|
||||||
|
if(event.value == 'no') {
|
||||||
|
|
||||||
|
control.controls[0].get('traded_goods_quantity').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('traded_goods_quantity').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('estimated_traded_goods_value').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('estimated_traded_goods_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('traded_goods_value').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('traded_goods_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('is_sufficiant_traded_goods').setValidators([Validators.required]);
|
||||||
|
control.controls[0].get('is_sufficiant_traded_goods').updateValueAndValidity();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if(event.value == 'yes') {
|
||||||
|
|
||||||
|
control.controls[0].get('traded_goods_quantity').clearValidators();
|
||||||
|
control.controls[0].get('traded_goods_quantity').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('estimated_traded_goods_value').clearValidators();
|
||||||
|
control.controls[0].get('estimated_traded_goods_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('traded_goods_value').clearValidators();
|
||||||
|
control.controls[0].get('traded_goods_value').updateValueAndValidity();
|
||||||
|
|
||||||
|
control.controls[0].get('is_sufficiant_traded_goods').clearValidators();
|
||||||
|
control.controls[0].get('is_sufficiant_traded_goods').updateValueAndValidity();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -417,6 +417,13 @@ convertNumberToWords(amount) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stockFormAccess(pdid: any): Observable<any> {
|
||||||
|
|
||||||
|
return this._http.post<any>(this.apiUrl+"getTypeOfActivetyFromBusinessForm",{"records":pdid})
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('operation', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
// private handleError<T>(operation = 'operation', result?: T) {
|
// private handleError<T>(operation = 'operation', result?: T) {
|
||||||
// return (error: any): Observable<T> => {
|
// return (error: any): Observable<T> => {
|
||||||
// return of(result as T);
|
// return of(result as T);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user