Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
a9673a0da7
@ -32,7 +32,7 @@
|
||||
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Address Type" formControlName="address_type" required>
|
||||
<mat-select placeholder="Address Type" formControlName="address_type" required (selectionChange)="selectedAddressType($event.source.triggerValue)">
|
||||
<mat-option value="{{m_addressType.address_type_id}}"
|
||||
*ngFor="let m_addressType of addressData">{{m_addressType.address_type}}
|
||||
</mat-option>
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
<div *ngIf="addressForm.controls['address_type'].value == 12" fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="Specify Address Type" formControlName="address_type_others" autocomplete="off">
|
||||
<input matInput placeholder="Specify Address Type" formControlName="address_type_others" autocomplete="off" (change)="selectedAddressType($event.target.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
@ -83,6 +83,12 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div *ngIf="addressForm.controls['comment_locality'].value == 10 " fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="Specify Comment on Locality" formControlName="other_comment_locality" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<mat-select placeholder="Ownership" formControlName="address_ownership">
|
||||
@ -95,7 +101,6 @@
|
||||
</div>
|
||||
|
||||
<div *ngIf="addressForm.controls['address_ownership'].value == 4 " fxFlex="33">
|
||||
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="Specify Ownership" formControlName="other_ownership" autocomplete="off">
|
||||
</mat-form-field>
|
||||
@ -103,7 +108,8 @@
|
||||
|
||||
<div *ngIf="addressForm.controls['address_ownership'].value == 3 " fxFlex="33">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off">
|
||||
<input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off" (keypress)="keyPress($event)" (keyup)="inWords($event,'')">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="addressForm.controls['rent_amt'].value != ''">{{"₹"}} {{rentAmtInwords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
@ -119,17 +125,36 @@
|
||||
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear($event.target.value)">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="68">
|
||||
<mat-form-field style="width: 95%;">
|
||||
<mat-select [placeholder]="placeholderName"
|
||||
formControlName="other_premises_bussiness_activity" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxFlex="32">
|
||||
<mat-form-field *ngIf="addressForm.controls['other_premises_bussiness_activity'].value != ''" style="width: 80%;">
|
||||
<input matInput autocomplete="off" placeholder="Remark" formControlName="bussiness_activity_remark">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
<div fxFlex="100">
|
||||
<mat-form-field style="width: 80%;">
|
||||
<!-- <mat-select placeholder="Is there any other premises from which business activity is being run?"-->
|
||||
<mat-select placeholder="Was any business activity seen at the (Address Type) seen during PD visit?"
|
||||
formControlName="bussiness_activity" required>
|
||||
<mat-form-field style="width: 95%;">
|
||||
<!--placeholder="Was any business activity seen at the (Address Type) seen during PD visit?"-->
|
||||
<mat-select placeholder="Is there any other premises from which business activity is being run?" formControlName="bussiness_activity" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -209,7 +234,8 @@
|
||||
<input matInput placeholder="Specify Ownership" formControlName="premises_ownership_others" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="item.get('premises_ownership').value == 3" style="width: 40%;">
|
||||
<input matInput placeholder="What is the monthly rent paid?" formControlName="premises_rent_amt" autocomplete="off">
|
||||
<input matInput placeholder="What is the monthly rent paid?" formControlName="premises_rent_amt" autocomplete="off" (keypress)="keyPress($event)" (keyup)="inWords($event,i)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('premises_rent_amt').value != ''">{{"₹"}} {{premisesRentAmtInwords[i]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Remarks"
|
||||
|
||||
@ -57,7 +57,10 @@ export class AddressComponent implements OnInit {
|
||||
formPremisesCityArray: any = [];
|
||||
additional_premises: any=[];
|
||||
bussiness_address_type: any=[];
|
||||
premisesRentAmtInwords:any=[];
|
||||
rentAmtInwords:any;
|
||||
tempArr: any[];
|
||||
placeholderName : any = 'Was any business activity seen at the Address Type during PD visit?';
|
||||
//neighbourStatusData:any=["Yes","No"];
|
||||
//applicantOwnerData:any=["Yes","No","Dont Know"];
|
||||
|
||||
@ -69,10 +72,13 @@ export class AddressComponent implements OnInit {
|
||||
public locality: AbstractControl;
|
||||
public pdLocation: AbstractControl;
|
||||
public commentlocality: AbstractControl;
|
||||
public other_comment_locality: AbstractControl;
|
||||
public customerBehaviour: AbstractControl;
|
||||
public ownership: AbstractControl;
|
||||
public other_ownership: AbstractControl;
|
||||
public rent_amt : AbstractControl;
|
||||
public other_premises_bussiness_activity : AbstractControl;
|
||||
public bussiness_activity_remark: AbstractControl;
|
||||
public bussinessActivity: AbstractControl;
|
||||
public business_years: AbstractControl;
|
||||
public business_month: AbstractControl;
|
||||
@ -118,11 +124,15 @@ export class AddressComponent implements OnInit {
|
||||
this.addressForm.controls.address.setValue(data.records.address);
|
||||
this.addressForm.controls.pd_location.setValue(data.records.pd_location);
|
||||
this.addressForm.controls.address_type.setValue(data.records.address_type);
|
||||
|
||||
this.selectedAddressType(data.records.address_type);
|
||||
if(data.records.address_type == 12) {
|
||||
this.addressForm.controls.address_type_others.setValue(data.records.address_type_others);
|
||||
this.selectedAddressType(data.records.address_type_others);
|
||||
}
|
||||
this.addressForm.controls.comment_locality.setValue(data.records.comment_locality);
|
||||
if(data.records.comment_locality == 10){
|
||||
this.addressForm.controls.other_comment_locality.setValue(data.records.other_comment_locality);
|
||||
}
|
||||
// this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour);
|
||||
this.addressForm.controls.locality.setValue(data.records.locality);
|
||||
if(data.records.locality == 7 ){
|
||||
@ -132,6 +142,16 @@ export class AddressComponent implements OnInit {
|
||||
this.addressForm.controls.address_ownership.setValue(data.records.address_ownership);
|
||||
this.addressForm.controls.other_ownership.setValue(data.records.other_ownership);
|
||||
this.addressForm.controls.rent_amt.setValue(data.records.rent_amt);
|
||||
if(data.records.rent_amt != ''){
|
||||
this.rentAmtInwords = this._pd.convertNumberToWords(data.records.rent_amt);
|
||||
}
|
||||
this.addressForm.controls.other_premises_bussiness_activity.setValue(data.records.other_premises_bussiness_activity);
|
||||
if(data.records.other_premises_bussiness_activity != '' && data.records.other_premises_bussiness_activity !=null) {
|
||||
this.addressForm.controls.bussiness_activity_remark.setValue(data.records.other_premises_bussiness_activity);
|
||||
}
|
||||
else{
|
||||
this.addressForm.controls.bussiness_activity_remark.setValue('');
|
||||
}
|
||||
this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity);
|
||||
|
||||
if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) {
|
||||
@ -152,7 +172,13 @@ export class AddressComponent implements OnInit {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
this.additional_premises.forEach((item,index)=>
|
||||
{
|
||||
console.log(item);
|
||||
console.log(index);
|
||||
//this.premisesRentAmtInwords[index] = this._pd.convertNumberToWords(item.premises_rent_amt);
|
||||
});
|
||||
|
||||
this.selectedValue(this.bussiness_address_type,this.additional_premises);
|
||||
if (data.records.locality_others) {
|
||||
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
|
||||
@ -181,12 +207,15 @@ export class AddressComponent implements OnInit {
|
||||
locality_others: [''],
|
||||
pd_location: ['', Validators.compose([Validators.required])],
|
||||
comment_locality: ['', Validators.compose([Validators.required])],
|
||||
other_comment_locality : [''],
|
||||
//customer_behaviour: ['', Validators.compose([Validators.required])],
|
||||
//neighbourhood: this.fb.array([]),
|
||||
address_form_remark:[''],
|
||||
address_ownership:[''],
|
||||
other_ownership:[''],
|
||||
rent_amt:[''],
|
||||
other_premises_bussiness_activity : [''],
|
||||
bussiness_activity_remark:[''],
|
||||
bussiness_activity:[''],
|
||||
business_years:[''],
|
||||
business_month:[''],
|
||||
@ -199,10 +228,13 @@ export class AddressComponent implements OnInit {
|
||||
this.locality = this.addressForm.controls['locality'];
|
||||
this.pdLocation = this.addressForm.controls['pd_location'];
|
||||
this.commentlocality = this.addressForm.controls['comment_locality'];
|
||||
this.other_comment_locality = this.addressForm.controls['other_comment_locality'];
|
||||
//this.customerBehaviour = this.addressForm.controls['customer_behaviour'];
|
||||
this.ownership = this.addressForm.controls['address_ownership'];
|
||||
this.other_ownership = this.addressForm.controls['other_ownership'];
|
||||
this.rent_amt = this.addressForm.controls['rent_amt'];
|
||||
this.other_premises_bussiness_activity = this.addressForm.controls['other_premises_bussiness_activity'],
|
||||
this.bussiness_activity_remark = this.addressForm.controls['bussiness_activity_remark'],
|
||||
this.bussinessActivity = this.addressForm.controls['bussiness_activity'];
|
||||
this.business_years = this.addressForm.controls['business_years'];
|
||||
this.business_month = this.addressForm.controls['business_month'];
|
||||
@ -303,12 +335,15 @@ export class AddressComponent implements OnInit {
|
||||
}
|
||||
records.pd_location = this.pdLocation.value;
|
||||
records.comment_locality = this.commentlocality.value;
|
||||
records.other_comment_locality = this.other_comment_locality.value;
|
||||
//records.customer_behaviour = this.commentlocality.value;
|
||||
//records.neighbourhood = this.addressForm.controls.neighbourhood.value;
|
||||
records.address_form_remark = this.addressForm.controls.address_form_remark.value;
|
||||
records.address_ownership = this.ownership.value;
|
||||
records.other_ownership = this.other_ownership.value;
|
||||
records.rent_amt = this.rent_amt.value;
|
||||
records.other_premises_bussiness_activity = this.other_premises_bussiness_activity.value;
|
||||
records.bussiness_activity_remark = this.bussiness_activity_remark.value;
|
||||
records.bussiness_activity = this.bussinessActivity.value;
|
||||
records.business_years = this.business_years.value;
|
||||
records.business_month = this.business_month.value;
|
||||
@ -323,7 +358,7 @@ export class AddressComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value);
|
||||
// console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value);
|
||||
|
||||
this.addressForm.controls.additional_premises.value.forEach((val,index)=>
|
||||
{
|
||||
@ -348,7 +383,7 @@ export class AddressComponent implements OnInit {
|
||||
records.formid = '5';
|
||||
// records.fk_createdby = '250';
|
||||
|
||||
console.log(JSON.stringify(records));
|
||||
// console.log(JSON.stringify(records));
|
||||
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
|
||||
@ -364,6 +399,10 @@ export class AddressComponent implements OnInit {
|
||||
// this.formPremisesCityArray.push({city: option});
|
||||
// });
|
||||
// }
|
||||
selectedAddressType(e: any){
|
||||
// console.log(e);
|
||||
this.placeholderName = 'Was any business activity seen at the '+e+' during PD visit?';
|
||||
}
|
||||
SelectedPremises($event){
|
||||
|
||||
let premisesData = $event.source.value;
|
||||
@ -516,4 +555,15 @@ export class AddressComponent implements OnInit {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
inWords(e,i){
|
||||
console.log(e);
|
||||
console.log(i);
|
||||
if(i != ''){
|
||||
this.premisesRentAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
|
||||
}
|
||||
else if(i == '' ){
|
||||
this.rentAmtInwords = this._pd.convertNumberToWords(e.target.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,7 @@
|
||||
<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-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Property Type" formControlName="property_type" >
|
||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -107,7 +107,7 @@
|
||||
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
|
||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
|
||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -138,7 +138,7 @@
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Type" formControlName="investments_type" >
|
||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:30%" *ngIf="detail.get('investments_type').value == 6 ">
|
||||
@ -175,7 +175,7 @@
|
||||
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" (selectionChange)="selectedAssetLoanType($event.value,2)">
|
||||
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</mat-option>
|
||||
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -219,8 +219,13 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *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" style="width:30%">
|
||||
<input matInput placeholder="Name of the Business Owner" formControlName="business_name_of_the_owner" autocomplete="off">
|
||||
</mat-form-field>
|
||||
<!-- <input matInput placeholder="Name of the Business Owner" formControlName="business_name_of_the_owner" autocomplete="off"> -->
|
||||
<mat-select placeholder="Name of the Business Owner"
|
||||
formControlName="business_name_of_the_owner" required>
|
||||
<mat-option [value]="company.company_name" *ngFor="let company of existCompanyList">{{company.company_name | titlecase}}</mat-option>
|
||||
<!-- <mat-option value="Others">Others</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
|
||||
@ -301,7 +306,7 @@
|
||||
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:100%">
|
||||
<mat-select (selectionChange)="selectedAssetsType($event,i,1)" placeholder="Assets Type" formControlName="assets_mode" requried>
|
||||
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name }}</mat-option>
|
||||
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id">{{ asset.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
@ -314,7 +319,7 @@
|
||||
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Property Type" formControlName="property_type" >
|
||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
|
||||
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="detail.get('property_type').value == 5" style="width:30%">
|
||||
@ -386,7 +391,7 @@
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
|
||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
|
||||
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:30%" *ngIf="detail.get('frequency_mode').value == 8 ">
|
||||
@ -418,7 +423,7 @@
|
||||
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Type" formControlName="investments_type" >
|
||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
|
||||
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name | titlecase }}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -457,7 +462,7 @@
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Name of the Owner"
|
||||
formControlName="name_of_the_owner" >
|
||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -470,7 +475,7 @@
|
||||
<mat-select placeholder="Relation" formControlName="relation" >
|
||||
<mat-option value="{{relations.relationship_id}}"
|
||||
*ngFor="let relations of m_relation">
|
||||
{{relations.name}}
|
||||
{{relations.name | titlecase}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@ -487,7 +492,7 @@
|
||||
<!-- </mat-form-field> -->
|
||||
<mat-form-field style="width:30%">
|
||||
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" (selectionChange)="selectedAssetLoanType($event.value,1)">
|
||||
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</mat-option>
|
||||
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
<!-- <input matInput placeholder="What is the EMI amount ?" formControlName="any_other_asset_loan" autocomplete="off"> -->
|
||||
</mat-form-field>
|
||||
@ -512,7 +517,7 @@
|
||||
|
||||
<mat-form-field *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" style="width:30%">
|
||||
<mat-select placeholder="Name of the Owner" formControlName="name_of_the_owner" >
|
||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -525,7 +530,7 @@
|
||||
<mat-select placeholder="Relation" formControlName="relation" >
|
||||
<mat-option value="{{relations.relationship_id}}"
|
||||
*ngFor="let relations of m_relation">
|
||||
{{relations.name}}
|
||||
{{relations.name | titlecase}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -31,7 +31,7 @@ export class AssetsInfoComponent implements OnInit {
|
||||
pageTitle: string ="Assets Details";
|
||||
//@Input() pdid: number;
|
||||
pdid:string;
|
||||
businessProfessionName :string;
|
||||
//businessProfessionName :string;
|
||||
|
||||
public _assetsQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
@ -183,6 +183,7 @@ public m_investmentType = [];
|
||||
// ]
|
||||
|
||||
private notifier: NotifierService;
|
||||
existCompanyList: any =[];
|
||||
constructor(
|
||||
notifier: NotifierService,
|
||||
private _formBuilder: FormBuilder,
|
||||
@ -216,9 +217,14 @@ public m_investmentType = [];
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
|
||||
this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
|
||||
});
|
||||
// this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
|
||||
// this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
|
||||
// });
|
||||
this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
|
||||
if(data.dataStatus){
|
||||
this.existCompanyList = data.records.filter(val =>val.is_active);
|
||||
}
|
||||
})
|
||||
|
||||
this.getPdSupplierFormDetails();
|
||||
this.getM_Assets_Type();
|
||||
@ -348,7 +354,7 @@ public m_investmentType = [];
|
||||
this.initDetails(),
|
||||
]),
|
||||
business_assets_details : this._formBuilder.array([
|
||||
this.initBusinessDetails(this.businessProfessionName),
|
||||
this.initBusinessDetails(),
|
||||
]),
|
||||
assets_form_remark:['']
|
||||
});
|
||||
@ -382,12 +388,12 @@ public m_investmentType = [];
|
||||
});
|
||||
}
|
||||
|
||||
initBusinessDetails(data) {
|
||||
initBusinessDetails() {
|
||||
return this._formBuilder.group({
|
||||
business_assets_mode: [''],
|
||||
business_details: this._formBuilder.array([]),
|
||||
business_approximate_market_value: [''],
|
||||
business_name_of_the_owner: [data],
|
||||
business_name_of_the_owner: [],
|
||||
//other_owner:[''],
|
||||
//relation:[''],
|
||||
//purchase_year: [''],
|
||||
@ -402,9 +408,6 @@ public m_investmentType = [];
|
||||
|
||||
show: boolean;
|
||||
selectedAssetsType(e: any, i: any,flag : any): void {
|
||||
console.log(e);
|
||||
console.log(i);
|
||||
console.log(flag);
|
||||
let val = i;
|
||||
if(flag == 1){
|
||||
const arr = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
@ -551,11 +554,10 @@ public m_investmentType = [];
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
loadPropertyWithData(data) {
|
||||
loadPropertyWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
property_type: [data.property_type]
|
||||
property_type: [data.property_type],
|
||||
other_property_type: [data.other_property_type]
|
||||
//property_type:['']
|
||||
});
|
||||
}
|
||||
@ -740,28 +742,41 @@ public m_investmentType = [];
|
||||
|
||||
setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
|
||||
let val = i;
|
||||
// var data = Object.keys(datas).map(function (key) {
|
||||
// let data = Object.keys(datas).map(function (key) {
|
||||
// return datas[key];
|
||||
// });
|
||||
// alert(JSON.stringify(datas));
|
||||
//alert('JSON Other Asset'+JSON.stringify(datas));
|
||||
let data = datas;
|
||||
|
||||
const arr = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
arr.controls.splice(0);
|
||||
|
||||
switch (assets_details_mode) {
|
||||
case '1': {
|
||||
let array_data : any;
|
||||
data.forEach((datas,i) => {
|
||||
array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.loadPropertyWithData(data));
|
||||
control.push(this.loadPropertyWithData(array_data));
|
||||
break;
|
||||
}
|
||||
case '2': {
|
||||
let array_data : any;
|
||||
data.forEach((datas,i) => {
|
||||
array_data = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.load_Four_WeelerWithData(data));
|
||||
control.push(this.load_Four_WeelerWithData(array_data));
|
||||
break;
|
||||
}
|
||||
case '3': {
|
||||
let array_data : any;
|
||||
data.forEach((datas,i) => {
|
||||
array_data = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.load_Two_WeelerWithData(data));
|
||||
control.push(this.load_Two_WeelerWithData(array_data));
|
||||
break;
|
||||
}
|
||||
case '4': {
|
||||
@ -770,34 +785,60 @@ public m_investmentType = [];
|
||||
break;
|
||||
}
|
||||
case '5': {
|
||||
let array_data : any;
|
||||
data.forEach((datas,i) => {
|
||||
array_data = { 'consumer_durable_description': datas.consumer_durable_description };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.loadConsumerDurableDescriptionWithData(data));
|
||||
control.push(this.loadConsumerDurableDescriptionWithData(array_data));
|
||||
break;
|
||||
}
|
||||
case '6': {
|
||||
let array_data : any;
|
||||
data.forEach((datas,i) => {
|
||||
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
|
||||
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
|
||||
array_data = {
|
||||
'premium_paid': datas.premium_paid,
|
||||
'frequency_mode': datas.frequency_mode,
|
||||
'other_frequency_mode':datas.other_frequency_mode,
|
||||
'sum_assured': datas.sum_assured,
|
||||
'members_coverd': datas.members_coverd
|
||||
};
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.loadInsuranceDescriptionWithData(data));
|
||||
control.push(this.loadInsuranceDescriptionWithData(array_data));
|
||||
break;
|
||||
}
|
||||
case '7': {
|
||||
let array_data : any;
|
||||
data.forEach((datas,i) => {
|
||||
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
|
||||
array_data = { 'investments_type': datas.investments_type,
|
||||
'other_investments_type' : datas.other_investments_type,
|
||||
'amount_of_invest': datas.amount_of_invest,
|
||||
'bank_name': datas.bank_name };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.loadInvestDescriptionWithData(data));
|
||||
control.push(this.loadInvestDescriptionWithData(array_data));
|
||||
break;
|
||||
}
|
||||
case '8': {
|
||||
let array_data : any;
|
||||
data.forEach((datas,i) => {
|
||||
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
|
||||
array_data = { 'any_other_assets': datas.any_other_assets,
|
||||
'name_of_the_owner':datas.name_of_the_owner,
|
||||
'other_owner':datas.other_owner,
|
||||
'relation':datas.relation,
|
||||
'any_other_asset_value' : datas.any_other_asset_value,
|
||||
'any_other_asset_loan' : datas.any_other_asset_loan,
|
||||
'other_asset_emi_amt' : datas.other_asset_emi_amt
|
||||
};
|
||||
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value);
|
||||
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
|
||||
control.push(this.otherAssetsDescriptionWithData(data));
|
||||
control.push(this.otherAssetsDescriptionWithData(array_data));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@ -807,60 +848,97 @@ public m_investmentType = [];
|
||||
}
|
||||
|
||||
setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
|
||||
console.log(datas);
|
||||
|
||||
let val = i;
|
||||
let data = datas;
|
||||
|
||||
const arr = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
arr.controls.splice(0);
|
||||
|
||||
switch (assets_details_mode) {
|
||||
case '1': {
|
||||
let business_property_datas : any;
|
||||
data.forEach((datas,i) => {
|
||||
business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.loadPropertyWithData(data));
|
||||
control.push(this.loadPropertyWithData(business_property_datas));
|
||||
break;
|
||||
}
|
||||
case '2': {
|
||||
let business_Four_Weeler_datas : any;
|
||||
data.forEach((datas,i) => {
|
||||
business_Four_Weeler_datas = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.load_Four_WeelerWithData(data));
|
||||
control.push(this.load_Four_WeelerWithData(business_Four_Weeler_datas));
|
||||
break;
|
||||
}
|
||||
case '3': {
|
||||
let business_Two_Weeler_datas : any;
|
||||
data.forEach((datas,i) => {
|
||||
business_Two_Weeler_datas = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.load_Two_WeelerWithData(data));
|
||||
control.push(this.load_Two_WeelerWithData(business_Two_Weeler_datas));
|
||||
break;
|
||||
}
|
||||
case '4': {
|
||||
break;
|
||||
}
|
||||
case '5': {
|
||||
let business_ConsumerDurableDescription_datas : any;
|
||||
data.forEach((datas,i) => {
|
||||
business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.loadConsumerDurableDescriptionWithData(data));
|
||||
control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas));
|
||||
break;
|
||||
}
|
||||
case '6': {
|
||||
let business_InsuranceDescription_datas : any;
|
||||
data.forEach((datas,i) => {
|
||||
this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
|
||||
this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
|
||||
business_InsuranceDescription_datas = {
|
||||
'premium_paid': datas.premium_paid,
|
||||
'frequency_mode': datas.frequency_mode,
|
||||
'other_frequency_mode':datas.other_frequency_mode,
|
||||
'sum_assured': datas.sum_assured,
|
||||
'members_coverd': datas.members_coverd
|
||||
};
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.loadInsuranceDescriptionWithData(data));
|
||||
control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas));
|
||||
break;
|
||||
}
|
||||
case '7': {
|
||||
let business_InvestDescription_datas : any;
|
||||
data.forEach((datas,i) => {
|
||||
this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
|
||||
business_InvestDescription_datas = { 'investments_type': datas.investments_type,
|
||||
'other_investments_type' : datas.other_investments_type,
|
||||
'amount_of_invest': datas.amount_of_invest,
|
||||
'bank_name': datas.bank_name };
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.loadInvestDescriptionWithData(data));
|
||||
control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas));
|
||||
break;
|
||||
}
|
||||
case '8': {
|
||||
let array_datas : any;
|
||||
data.forEach((datas,i) => {
|
||||
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
|
||||
this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
|
||||
array_datas = {
|
||||
'any_other_assets': datas.any_other_assets,
|
||||
'any_other_asset_value' : datas.any_other_asset_value,
|
||||
'any_other_asset_loan' : datas.any_other_asset_loan,
|
||||
'other_asset_emi_amt' : datas.other_asset_emi_amt
|
||||
};
|
||||
});
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.otherBusinessAssetsDescriptionWithData(data));
|
||||
control.push(this.otherBusinessAssetsDescriptionWithData(array_datas));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@ -878,7 +956,7 @@ public m_investmentType = [];
|
||||
control.push(this.initDetails());
|
||||
}else if(flag == 2){
|
||||
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
|
||||
control.push(this.initBusinessDetails(this.businessProfessionName));
|
||||
control.push(this.initBusinessDetails());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
<h2 mat-dialog-title class="paragraph_change">
|
||||
<div fxFlex="70" align="left" style="padding: 10px !important;">{{pageTitle}}</div>
|
||||
<div fxFlex="30" align="end" style="padding: 10px !important;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
|
||||
|
||||
</div>
|
||||
</h2>
|
||||
|
||||
<mat-dialog-content>
|
||||
<mat-card *ngFor="let companyList of existCompanyList">
|
||||
<mat-card-header>
|
||||
<mat-card-title class="p-text">{{companyList.company_name | titlecase}}</mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<div fxLayout="row wrap" class="child_mat_card">
|
||||
<mat-card fxFlex.xs="80" fxFlex.sm="80" fxFlex.md="40" fxFlex.lg="32" fxFlex.xl="33" *ngFor="let formButton of companyList.form_status;let quesIndex=index" [ngStyle]="{'background-color':formButton.isAnswered == false ? '#fff' : '#4caf50' ,'color':'#fff'}" (click)="OnSelectBusinessGroupForms(formButton, companyList)">
|
||||
<mat-card-header>
|
||||
<span style="padding: 17px 14px 3px 15px !important;border-radius: 0px 0px 0px 15px!important;width: 50px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
|
||||
<div fxFlex="100" align="left" style="padding:15px !important;">
|
||||
{{ formButton.form_name }}
|
||||
</div>
|
||||
</mat-card-header>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
</mat-dialog-content>
|
||||
<notifier-container></notifier-container>
|
||||
@ -0,0 +1,33 @@
|
||||
.paragraph_change {
|
||||
color: #fff !important;
|
||||
background-color: #e00201 !important;
|
||||
}
|
||||
|
||||
.p-text {
|
||||
color:#e00201 !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
::ng-deep .mat-card-header-text{
|
||||
margin:0px !important;
|
||||
}
|
||||
.mat-purple{
|
||||
background-color: gray !important;
|
||||
}
|
||||
.cdk-global-overlay-wrapper{
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
|
||||
mat-card .child_mat_card > mat-card {
|
||||
border-radius: 0px 0px 0px 15px;
|
||||
box-shadow: $base-card-box-shadow;
|
||||
transform: scale(0.95);
|
||||
transition: box-shadow 0.5s, transform 0.5s;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
// background-color: #e00201 !important;
|
||||
transform: scale(1);
|
||||
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { BusinessInfoGroupComponent } from './business-info-group.component';
|
||||
|
||||
describe('BusinessInfoGroupComponent', () => {
|
||||
let component: BusinessInfoGroupComponent;
|
||||
let fixture: ComponentFixture<BusinessInfoGroupComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ BusinessInfoGroupComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BusinessInfoGroupComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,110 @@
|
||||
import { Component,OnInit,Inject,Input} from '@angular/core';
|
||||
import { NotifierService } from 'angular-notifier';
|
||||
import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
|
||||
/** Service */
|
||||
import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {SupplierInfoComponent} from './../../forms/supplier-info/supplier-info.component';
|
||||
import {ClientInfoComponent} from './../../forms/client-info/client-info.component';
|
||||
import {StockComponent} from './../../forms/stock/stock.component';
|
||||
import {FinancialInfoComponent} from './../../forms/financial-info/financial-info.component';
|
||||
import {BusinessInfoComponent} from './../../forms/business-info/business-info.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-business-info-group',
|
||||
templateUrl: './business-info-group.component.html',
|
||||
styleUrls: ['./business-info-group.component.scss']
|
||||
})
|
||||
export class BusinessInfoGroupComponent implements OnInit {
|
||||
pageTitle: string ="Business Informations";
|
||||
existCompanyList: any = [];
|
||||
pdid: number;
|
||||
form_id: number;
|
||||
constructor(notifier: NotifierService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private _pd: PdTrigerService,
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) {
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.form_id = 13;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getCompanyListForBusiness();
|
||||
}
|
||||
getCompanyListForBusiness(): void{
|
||||
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
|
||||
if(data.dataStatus){
|
||||
this.existCompanyList = data.records.filter(val =>val.is_active);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// direct form based questions
|
||||
OnSelectBusinessGroupForms(details: any, company: any) {
|
||||
this.pd_all_details.company_id =company.company_order_id;
|
||||
this.pd_all_details.company_name =company.company_name;
|
||||
if(details.form_id==1){
|
||||
const dialogRef = this.dialog.open(SupplierInfoComponent, {
|
||||
data: this.pd_all_details,
|
||||
position: { right: '0'},
|
||||
width:'80%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getCompanyListForBusiness();
|
||||
});
|
||||
}
|
||||
else if(details.form_id==2){
|
||||
const dialogRef = this.dialog.open(ClientInfoComponent, {
|
||||
data: this.pd_all_details,
|
||||
position: { right: '0'},
|
||||
width:'80%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getCompanyListForBusiness();
|
||||
});
|
||||
}
|
||||
else if(details.form_id==11){
|
||||
const dialogRef = this.dialog.open(StockComponent, {
|
||||
data: this.pd_all_details,
|
||||
position: { right: '0'},
|
||||
width:'80%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getCompanyListForBusiness();
|
||||
});
|
||||
}
|
||||
else if(details.form_id==13){
|
||||
const dialogRef = this.dialog.open(BusinessInfoComponent, {
|
||||
data: this.pd_all_details,
|
||||
position: { right: '0'},
|
||||
width:'80%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getCompanyListForBusiness();
|
||||
});
|
||||
}
|
||||
else if(details.form_id==14){
|
||||
const dialogRef = this.dialog.open(FinancialInfoComponent, {
|
||||
data: this.pd_all_details,
|
||||
position: { right: '0'},
|
||||
width:'80%',
|
||||
disableClose: true
|
||||
});
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
this.getCompanyListForBusiness();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -26,8 +26,8 @@
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select placeholder="Name in Which The Business is Run"
|
||||
formControlName="profession_name" required>
|
||||
<mat-option value="{{company}}" *ngFor="let company of existCompanyList">{{company | titlecase}}</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
<mat-option [value]="company.company_name" *ngFor="let company of existCompanyList">{{company.company_name | titlecase}}</mat-option>
|
||||
<!-- <mat-option value="Others">Others</mat-option> -->
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.profession_name.value=='Others'">
|
||||
|
||||
@ -32,8 +32,10 @@ import {DatePipe } from '@angular/common';
|
||||
export class BusinessInfoComponent implements OnInit {
|
||||
pipe = new DatePipe('en-US');
|
||||
pdid: number;
|
||||
company_id: String;
|
||||
company_name: String;
|
||||
form_id: number;
|
||||
pageTitle: string ="Business Details";
|
||||
pageTitle: string ="Business Information";
|
||||
relationData: any = [];
|
||||
companyRelationShipList: any =[];
|
||||
//industryData: any = [];
|
||||
@ -60,6 +62,8 @@ export class BusinessInfoComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) {
|
||||
//this.adapter.setLocale('fr');
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.company_id = this.pd_all_details.company_id;
|
||||
this.company_name = this.pd_all_details.company_name;
|
||||
this.applicants = this.pd_all_details.pdapplicants_detials;
|
||||
this.form_id = 13;
|
||||
this.notifier = notifier;
|
||||
@ -101,6 +105,7 @@ export class BusinessInfoComponent implements OnInit {
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = this.form_id;
|
||||
params.company_id = this.company_id;
|
||||
this._pd.retriveForm(params).subscribe(data => {
|
||||
let businessVal = data.records;
|
||||
let constVal: any;
|
||||
@ -163,6 +168,7 @@ export class BusinessInfoComponent implements OnInit {
|
||||
|
||||
businessVal.pdid = this.pdid;
|
||||
businessVal.formid = this.form_id;
|
||||
businessVal.company_id = this.company_id;
|
||||
businessVal.fk_createdby = this.pdid;
|
||||
//businessVal.designation = DesgnArray;
|
||||
businessVal.partners = PartnrArray;
|
||||
@ -562,8 +568,9 @@ export class BusinessInfoComponent implements OnInit {
|
||||
this.businessForm = this.fb.group({
|
||||
pdid: this.pdid,
|
||||
formid: this.form_id,
|
||||
company_id: this.company_id,
|
||||
fk_createdby: this.pdid,
|
||||
profession_name: ['', Validators.compose([Validators.required])],
|
||||
profession_name: [this.company_name, Validators.compose([Validators.required])],
|
||||
business_entity_type: ['', Validators.compose([Validators.required])],
|
||||
business_years: ['', Validators.compose([Validators.required])],
|
||||
business_month: ['', Validators.compose([Validators.required])],
|
||||
@ -1266,7 +1273,7 @@ export class BusinessInfoComponent implements OnInit {
|
||||
getCompanyListForBusiness(): void{
|
||||
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
|
||||
if(data.dataStatus){
|
||||
this.existCompanyList = data.records;
|
||||
this.existCompanyList = data.records.filter(val =>val.is_active && val.company_order_id==this.company_id);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ export class ClientInfoComponent implements OnInit {
|
||||
//@Input() pdid: number;
|
||||
pdid: string;
|
||||
form_id: number;
|
||||
|
||||
company_id: string;
|
||||
public _supplierQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
|
||||
@ -78,6 +78,7 @@ export class ClientInfoComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.form_id = 2;
|
||||
this.company_id = this.pd_all_details.company_id;
|
||||
this.notifier = notifier;
|
||||
}
|
||||
public viewerOptions: any = {
|
||||
@ -103,8 +104,7 @@ export class ClientInfoComponent implements OnInit {
|
||||
noRecordsFound: Boolean = false;
|
||||
errorMessage: any = '';
|
||||
ngOnInit() {
|
||||
|
||||
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
|
||||
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,this.company_id).subscribe(data => {
|
||||
if(data.dataStatus){
|
||||
// let datas = {
|
||||
// "profession_name": "Others",
|
||||
@ -151,7 +151,11 @@ export class ClientInfoComponent implements OnInit {
|
||||
|
||||
retaildTradingForm: Boolean = false;
|
||||
initFormLoadDetails(record) {
|
||||
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '2').subscribe(
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = this.form_id;
|
||||
params.company_id = this.company_id;
|
||||
this.pdTrigerService.retriveForm(params).subscribe(
|
||||
data => {
|
||||
if (data.dataStatus) {
|
||||
let dataForm = data.records;
|
||||
@ -159,6 +163,7 @@ export class ClientInfoComponent implements OnInit {
|
||||
this._supplierQuesFrom = this._formBuilder.group({
|
||||
pdid: [this.pdid],
|
||||
formid: ['2'],
|
||||
company_id:[this.company_id],
|
||||
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
|
||||
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
|
||||
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
|
||||
@ -244,6 +249,7 @@ export class ClientInfoComponent implements OnInit {
|
||||
this._supplierQuesFrom = this._formBuilder.group({
|
||||
pdid: [this.pdid],
|
||||
formid: ['2'],
|
||||
company_id:[this.company_id],
|
||||
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
|
||||
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
|
||||
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
|
||||
|
||||
@ -33,6 +33,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
pageTitle: string ="Financial Information";
|
||||
pdid: string;
|
||||
form_id: number;
|
||||
company_id: string;
|
||||
public financialForm: FormGroup;
|
||||
private notifier: NotifierService;
|
||||
SalesStatement : any = [];
|
||||
@ -57,6 +58,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.form_id = 14;
|
||||
this.company_id =this.pd_all_details.company_id;
|
||||
this.notifier = notifier;
|
||||
}
|
||||
public viewerOptions: any = {
|
||||
@ -84,6 +86,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = this.form_id;
|
||||
params.company_id = this.company_id;
|
||||
this._pd.retriveForm(params).subscribe(value => {
|
||||
const financial_date = <FormArray>this.financialForm.controls['date_per_financial'];
|
||||
const estimated_val = <FormArray>this.financialForm.controls['estimated_value'];
|
||||
@ -111,7 +114,6 @@ export class FinancialInfoComponent implements OnInit {
|
||||
financial_date.push(this.createDate(''));
|
||||
}
|
||||
if (result_val.length > 0) {
|
||||
console.log(result_val);
|
||||
result_val.forEach((val,index) => {
|
||||
//console.log('dedrf',val.estimate_annual_sale);
|
||||
this.AV_annualSalesInwords[index] = this._pd.convertNumberToWords(val.estimate_annual_sale);
|
||||
@ -125,6 +127,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
}
|
||||
retriveData.pdid = this.pdid;
|
||||
retriveData.formid = this.form_id;
|
||||
retriveData.company_id = this.company_id;
|
||||
retriveData.fk_createdby = this.pdid;
|
||||
this.financialForm.setValue(retriveData);
|
||||
} else {
|
||||
@ -137,6 +140,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
this.financialForm = this.fb.group({
|
||||
pdid: this.pdid,
|
||||
formid: this.form_id,
|
||||
company_id: this.company_id,
|
||||
fk_createdby: this.pdid,
|
||||
financial_remarks: [''],
|
||||
staring_financial_year : ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
|
||||
@ -248,7 +252,6 @@ export class FinancialInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
selectedType(e: any): void {
|
||||
console.log(e);
|
||||
if(e.value == 'yes'){
|
||||
let startingYear = this.financialForm.controls['staring_financial_year'].value;
|
||||
let totalFinYear = this.financialForm.controls['total_financial_year'].value;
|
||||
@ -261,7 +264,6 @@ export class FinancialInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
if(array.length > 0 ){
|
||||
console.log(array.length);
|
||||
|
||||
array.value.forEach((val,index)=>{
|
||||
let vals = {
|
||||
@ -326,32 +328,23 @@ export class FinancialInfoComponent implements OnInit {
|
||||
// }
|
||||
// }
|
||||
calFinAnnualSale(index,detail){
|
||||
//alert('FIn Annual Sales Data');
|
||||
console.log(index);
|
||||
console.log()
|
||||
let annual_sale = detail.value.financial_annual_sale;
|
||||
if (index != 0) {
|
||||
let array = <FormArray>this.financialForm.controls['date_per_financial'];
|
||||
let prev_annual_sale = array.value[index-1].financial_annual_sale;
|
||||
let annual_sale_variation = (( annual_sale - prev_annual_sale)/prev_annual_sale) * 100 ;
|
||||
detail.controls.financial_annualsales_variation.setValue(annual_sale_variation.toFixed(2));
|
||||
console.log('annual sales variation in %',annual_sale_variation);
|
||||
}
|
||||
}
|
||||
|
||||
calculateEstimationAnnualSale(index,detail){
|
||||
//alert('Function Inside');
|
||||
console.log(detail);
|
||||
let annual_sale = detail.value.estimate_annual_sale;
|
||||
console.log(annual_sale);
|
||||
console.log(index);
|
||||
// console.log(annual_sale);
|
||||
if (index != 0) {
|
||||
let array = <FormArray>this.financialForm.controls['estimated_value'];
|
||||
let prev_annual_sale = array.value[index-1].estimate_annual_sale;
|
||||
let annual_sale_variation = (( annual_sale - prev_annual_sale)/prev_annual_sale) * 100 ;
|
||||
detail.controls.estimate_annualsales_variation.setValue(annual_sale_variation.toFixed(2));
|
||||
console.log('estimate annual sales variation in %',annual_sale_variation);
|
||||
}
|
||||
}
|
||||
|
||||
@ -363,25 +356,16 @@ export class FinancialInfoComponent implements OnInit {
|
||||
if ( (profit != '' || loss != '') && index != 0) {
|
||||
|
||||
let array = <FormArray>this.financialForm.controls['date_per_financial'];
|
||||
|
||||
console.log('Profit',profit);
|
||||
console.log(Math.abs(profit));
|
||||
|
||||
let prev_profit = array.value[index - 1].financial_net_profit != '' ? array.value[index - 1].financial_net_profit : 0;
|
||||
console.log('Profitpre',prev_profit);
|
||||
let prev_loss = array.value[index - 1].financial_net_loss !='' ? array.value[index - 1].financial_net_loss : 0 ;
|
||||
let prev_year = array.value[index - 1].financial_year;
|
||||
let prev_annual_sale = array.value[index-1].financial_annual_sale;
|
||||
console.log('loss',loss);
|
||||
loss = loss != 0 ? loss * (-1) : loss;
|
||||
console.log('-1 loss',loss);
|
||||
console.log('pre_loss',prev_loss);
|
||||
prev_loss = prev_loss != 0 ? prev_loss * (-1) : prev_loss ;
|
||||
console.log('-1 pre loss',prev_loss);
|
||||
console.log(Math.abs(profit));
|
||||
//let variation2 = ((()))
|
||||
let variation = (((profit != '' ? profit : loss ) - (prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100;
|
||||
//console.log('console.log(Math.abs(profit));',Math.abs(variation));
|
||||
console.log(variation);
|
||||
// let variation ;
|
||||
// if(profit != ''){
|
||||
// variation = (((profit != '' ? profit : loss ) - ( prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? prev_profit : prev_loss)) * 100 * (profit != '' ? (1) : (-1)) ;
|
||||
@ -396,7 +380,6 @@ export class FinancialInfoComponent implements OnInit {
|
||||
detail.controls.financial_variation.setValue(variation.toFixed(2));
|
||||
|
||||
//Increase in Sales in FY 2017-18 over sales in FY 2016-17 is 11.11%
|
||||
console.log('variation in %',variation);
|
||||
|
||||
// this.SalesStatement[index] = ( variation <= 0 ? 'Decreases ' : 'Increases ' ) + 'in Sales in FY ' + curr_year + ' Over Sales in FY '+ prev_year + ' is ' + variation.toFixed(2) + '%';
|
||||
// console.log('this.SlesStatement',this.SalesStatement);
|
||||
@ -438,7 +421,6 @@ export class FinancialInfoComponent implements OnInit {
|
||||
// }
|
||||
|
||||
calMargin(index, detail) {
|
||||
console.log('detail', detail);
|
||||
// let array = <FormArray>this.financialForm.controls['date_per_financial'];
|
||||
let salary = detail.value.financial_annual_sale;
|
||||
// let prev_annual_sale = array.value[index-1].financial_annual_sale;
|
||||
@ -500,7 +482,6 @@ export class FinancialInfoComponent implements OnInit {
|
||||
if ( (profit != '' || loss != '') && index != 0) {
|
||||
|
||||
let array = <FormArray>this.financialForm.controls['estimated_value'];
|
||||
console.log(array.value[index - 1].financial_net_profit);
|
||||
|
||||
let prev_profit = array.value[index - 1].estimate_net_profit != '' ? array.value[index - 1].estimate_net_profit : 1;
|
||||
let prev_loss = array.value[index - 1].estimate_net_loss !='' ? array.value[index - 1].estimate_net_loss : 1;
|
||||
@ -522,9 +503,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
calMarginVal(index, detail) {
|
||||
console.log('Margin Estimate VAR',detail);
|
||||
let salary = detail.value.estimate_annual_sale;
|
||||
console.log('Margin Estimate Vsalary',salary);
|
||||
|
||||
// if (salary != '' && profit != '') {
|
||||
// let margin = profit / salary * 100;
|
||||
@ -535,23 +514,16 @@ export class FinancialInfoComponent implements OnInit {
|
||||
if(detail.value.estimate_profit_or_loss == 1){
|
||||
|
||||
let profit = detail.value.estimate_net_profit;
|
||||
console.log('if Margin Profit',profit);
|
||||
|
||||
if (salary != '' && profit != '') {
|
||||
console.log('if if Margin Estimate salary',salary);
|
||||
console.log('if if Margin Profit',profit);
|
||||
let margin = profit / salary * 100;
|
||||
console.log('margin',margin);
|
||||
detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
|
||||
}
|
||||
}
|
||||
else if (detail.value.estimate_profit_or_loss == 2){
|
||||
|
||||
let loss = detail.value.estimate_net_loss;
|
||||
console.log('else if Margin loss',loss);
|
||||
if (salary != '' && loss != '') {
|
||||
console.log('elseif if Margin Estimate salary',salary);
|
||||
console.log('alseif if Margin loss',loss);
|
||||
let margin = (loss / salary) * 100 * (-1);
|
||||
detail.controls.estimate_margin_of_loss.setValue(margin.toFixed(2));
|
||||
|
||||
@ -589,7 +561,6 @@ export class FinancialInfoComponent implements OnInit {
|
||||
// }
|
||||
|
||||
calProfitAndLossVal( i, detail) {
|
||||
console.log(detail);
|
||||
let salary = detail.value.estimate_annual_sale;
|
||||
if(detail.value.estimate_profit_or_loss == 1){
|
||||
let margin_profit = detail.value.estimate_margin_of_profit;
|
||||
@ -683,9 +654,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
// return;
|
||||
// }
|
||||
let records = this.financialForm.value;
|
||||
console.log('data', records);
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
console.log('data', data);
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
//this.dialogRef.close();
|
||||
}, error => {
|
||||
@ -716,10 +685,6 @@ export class FinancialInfoComponent implements OnInit {
|
||||
|
||||
/** To Convert Amount into Words */
|
||||
inWords(e,i,flag:number){
|
||||
|
||||
// console.log(e);
|
||||
// console.log(i);
|
||||
// console.log(flag);
|
||||
|
||||
switch(flag){
|
||||
case 1 :
|
||||
|
||||
127
ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html
Executable file → Normal file
127
ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html
Executable file → Normal file
@ -77,8 +77,125 @@
|
||||
</mat-card>
|
||||
|
||||
<!-- companies end -->
|
||||
|
||||
<!-- Person Relationship Starts Here -->
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title> Person Relationship </mat-card-title>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<mat-table [dataSource]="relationSource" *ngIf="_generalForm.controls.persons_with_relationships['controls'].length>0" formArrayName="persons_with_relationships">
|
||||
<ng-container matColumnDef="applicant_name">
|
||||
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
|
||||
{{details.value.applicant_name | titlecase}}
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="relation">
|
||||
<mat-header-cell *matHeaderCellDef> Relation </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
|
||||
<mat-select placeholder="Relation" formControlName="relationship" style="width: 75%;">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option [value]="member.relationship_id" *ngFor="let member of relationShipList">{{member.name + ' of' | titlecase}}</mat-option>
|
||||
<mat-option value="0" > Not Applicable </mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="relation_to">
|
||||
<mat-header-cell *matHeaderCellDef> Relationship To </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
|
||||
<mat-select placeholder="Applicant" formControlName="relation_to" style="width: 75%;">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let appc of individualsList" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
|
||||
<mat-option value="0" > Not Applicable </mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="secondDisplayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: secondDisplayedColumns;"></mat-row>
|
||||
|
||||
</mat-table>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
<!-- Person Relationship Ends Here -->
|
||||
|
||||
<!-- company Relationship Start Here -->
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
|
||||
<mat-card-title> Company/Firm Relationship </mat-card-title>
|
||||
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
|
||||
|
||||
<mat-table [dataSource]="CompanySource" *ngIf="_generalForm.controls.company_with_relationships['controls'].length>0" formArrayName="company_with_relationships">
|
||||
|
||||
<ng-container matColumnDef="applicant_name">
|
||||
<mat-header-cell *matHeaderCellDef> Applicant </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
|
||||
<mat-select placeholder="Applicant" formControlName="applicant_name" style="width: 75%;">
|
||||
<mat-option *ngFor="let appc of individualsList" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
|
||||
</mat-select>
|
||||
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="company_relationship">
|
||||
<mat-header-cell *matHeaderCellDef> Relation </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
<mat-select placeholder="Relation" formControlName="company_relationship" style="width: 75%;">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
|
||||
{{comrelShip.name + ' of' | titlecase}}
|
||||
</mat-option>
|
||||
<mat-option value="0" > Not Applicable </mat-option>
|
||||
</mat-select>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="relation_to_company">
|
||||
<mat-header-cell *matHeaderCellDef> Company </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
|
||||
|
||||
<mat-select placeholder="Company / Firm" formControlName="relation_to_company" style="width: 75%;">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let comp of companyList" [value]="comp.company_order_id">
|
||||
{{comp.company_name | titlecase}}
|
||||
</mat-option>
|
||||
<mat-option value="0" > Not Applicable </mat-option>
|
||||
</mat-select>
|
||||
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanyRelationship(i)"
|
||||
matTooltip="Remove Company Relationship" matTooltipPosition="below">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<mat-header-row *matHeaderRowDef="thridDisplayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: thridDisplayedColumns;">
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="end">
|
||||
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addCompanyRelationshipDialogue()"
|
||||
matTooltip="Add Company Relationship" matTooltipPosition="left" color="primary">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
<!-- Company RelationShip Ends Here -->
|
||||
|
||||
<div fxLayout="row wrap" formArrayName="applicant_relation">
|
||||
<!-- -- <div fxLayout="row wrap" formArrayName="applicant_relation">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" *ngFor="let relation of _generalForm.controls.applicant_relation['controls']; let r = index;" [formGroupName]="r">
|
||||
<mat-card >
|
||||
<mat-card-header>
|
||||
@ -98,7 +215,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 20%">
|
||||
<!--[placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' "-->
|
||||
<!--[placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' "--
|
||||
<mat-select placeholder="Relation" formControlName="relationship">
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let relShip of relationShipList" [value]="relShip.relationship_id">
|
||||
@ -117,8 +234,8 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p>Company/Firm Relationship</p>
|
||||
</div>-->
|
||||
<!-- -- <p>Company/Firm Relationship</p>
|
||||
<div formArrayName="multiple_company_relation">
|
||||
<div fxLayout="row nowrap" *ngFor="let comRel of relation.get('multiple_company_relation').controls; let c = index" [formGroupName]="c">
|
||||
<mat-form-field style="width: 40%">
|
||||
@ -150,7 +267,7 @@
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
|
||||
0
ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss
Executable file → Normal file
0
ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss
Executable file → Normal file
0
ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.spec.ts
Executable file → Normal file
0
ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.spec.ts
Executable file → Normal file
209
ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts
Executable file → Normal file
209
ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts
Executable file → Normal file
@ -15,10 +15,16 @@ export class GeneralInfoComponent implements OnInit {
|
||||
pageTitle: string ="General Information";
|
||||
pdid : string;
|
||||
form_id:number;
|
||||
is_new : boolean;
|
||||
count : number = 1;
|
||||
private notifier: NotifierService;
|
||||
public _generalForm: FormGroup;
|
||||
displayedColumns = ['applicant_name','is_person_met','is_applicant'];
|
||||
public individualsSource= new MatTableDataSource();
|
||||
public relationSource= new MatTableDataSource();
|
||||
public CompanySource = new MatTableDataSource();
|
||||
secondDisplayedColumns = ['applicant_name','relation','relation_to'];
|
||||
thridDisplayedColumns = ['applicant_name','company_relationship','relation_to_company'];
|
||||
public pd_applicants_details: any;
|
||||
relationShipList:any=[];
|
||||
companyRelationShipList:any=[];
|
||||
@ -51,6 +57,19 @@ export class GeneralInfoComponent implements OnInit {
|
||||
let control = <FormArray>this._generalForm.controls['companies'];
|
||||
this.companyList = control.value.filter(element =>element.company_name && element.is_active);
|
||||
});
|
||||
|
||||
this._generalForm.controls['persons_with_relationships'].valueChanges.subscribe(val=>{
|
||||
let control = <FormArray>this._generalForm.controls['persons_with_relationships'];
|
||||
this.relationSource.data =control.controls;
|
||||
//this.individualsList = control.value.filter(element =>element.is_applicant===true);
|
||||
});
|
||||
|
||||
// change relation with businees update dat sorce table
|
||||
this._generalForm.controls['company_with_relationships'].valueChanges.subscribe(val=>{
|
||||
let ComapnyControl = <FormArray>this._generalForm.controls['company_with_relationships'];
|
||||
this.CompanySource .data =ComapnyControl.controls;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// init form
|
||||
@ -58,11 +77,13 @@ export class GeneralInfoComponent implements OnInit {
|
||||
this._generalForm = this._fb.group({
|
||||
pdid:this.pdid,
|
||||
formid:this.form_id,
|
||||
applicant_relation: this._fb.array([]),
|
||||
//applicant_relation: this._fb.array([]),
|
||||
individuals: this._fb.array([]),
|
||||
companies: this._fb.array([]),
|
||||
persons_with_relationships: this._fb.array([]),
|
||||
company_with_relationships: this._fb.array([]),
|
||||
general_remark:''
|
||||
});
|
||||
})
|
||||
this.loadFormData();
|
||||
}
|
||||
// get all master details
|
||||
@ -72,10 +93,12 @@ export class GeneralInfoComponent implements OnInit {
|
||||
if (data.status == 200) {
|
||||
if(type==1){
|
||||
this.relationShipList=data.records.filter(item => item.isactive == 1);
|
||||
this.relationShipList.push({'relationship_id':"0",'name':'Others'});
|
||||
|
||||
//this.relationShipList.push({'relationship_id':"0",'name':'Not Applicable'});
|
||||
}
|
||||
if(type==2){
|
||||
this.companyRelationShipList=data.records.filter(item => item.isactive == 1);
|
||||
this.companyRelationShipList=data.records.filter(item => item.name != 'Others');
|
||||
}
|
||||
|
||||
}
|
||||
@ -89,13 +112,18 @@ export class GeneralInfoComponent implements OnInit {
|
||||
params.pd_form_id = '18';
|
||||
let individualsControl = <FormArray>this._generalForm.controls['individuals'];
|
||||
let companyControl = this._generalForm.get('companies') as FormArray;
|
||||
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
|
||||
//let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
|
||||
let personsWithRelationshipsControl = <FormArray>this._generalForm.controls['persons_with_relationships'];
|
||||
let companyWithRelationshipsControl = <FormArray>this._generalForm.controls['company_with_relationships'];
|
||||
individualsControl.controls = [];
|
||||
relationControl.controls = [];
|
||||
//relationControl.controls = [];
|
||||
companyControl.controls = [];
|
||||
personsWithRelationshipsControl.controls = [];
|
||||
let exist_individuals:any;
|
||||
let exist_companies:any;
|
||||
let exist_relation:any;
|
||||
let exist_personsWithRelationships:any;
|
||||
let exist_companyWithRelationships:any;
|
||||
this._pd.retriveForm(params).subscribe(data => {
|
||||
if(data.dataStatus) {
|
||||
this._generalForm.controls['general_remark'].setValue(data.records.general_remark ? data.records.general_remark : '');
|
||||
@ -110,6 +138,30 @@ export class GeneralInfoComponent implements OnInit {
|
||||
individualsControl.push(this.createIndividulas(element))
|
||||
});
|
||||
}
|
||||
|
||||
// create persons with relationships
|
||||
exist_personsWithRelationships=Object.keys(data.records.persons_with_relationships).map(function(key) {
|
||||
return data.records.persons_with_relationships[key];
|
||||
});
|
||||
|
||||
if(exist_personsWithRelationships.length>0){
|
||||
exist_personsWithRelationships.forEach(element => {
|
||||
//individualsControl.push(this.createIndividulas(element))
|
||||
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element));
|
||||
});
|
||||
}
|
||||
|
||||
exist_companyWithRelationships=Object.keys(data.records.company_with_relationships).map(function(key) {
|
||||
return data.records.company_with_relationships[key];
|
||||
});
|
||||
|
||||
if(exist_companyWithRelationships.length>0){
|
||||
exist_companyWithRelationships.forEach(element => {
|
||||
//individualsControl.push(this.createIndividulas(element))
|
||||
companyWithRelationshipsControl.push(this.createCompaniesRelationshipWithData(element));
|
||||
});
|
||||
}
|
||||
|
||||
// create companies
|
||||
exist_companies = Object.keys(data.records.companies).map(function(key) {
|
||||
return data.records.companies[key];
|
||||
@ -127,37 +179,39 @@ export class GeneralInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
// create relations
|
||||
exist_relation = Object.keys(data.records.applicant_relation).map(function(key) {
|
||||
return data.records.applicant_relation[key];
|
||||
});
|
||||
if(exist_relation.length>0){
|
||||
exist_relation.forEach((element,index) => {
|
||||
relationControl.push(this.createApplicantRelation(element));
|
||||
let innerrelControl:any = relationControl.controls[index].get('multiple_relation') as FormArray;
|
||||
element.multiple_relation.forEach((innereElement) => {
|
||||
innerrelControl.push(this.createMultipleRelation(innereElement));
|
||||
});
|
||||
let innercomrelControl:any = relationControl.controls[index].get('multiple_company_relation') as FormArray;
|
||||
element.multiple_company_relation.forEach((innerecomElement) => {
|
||||
innercomrelControl.push(this.createMultipleCompanyRelation(innerecomElement));
|
||||
});
|
||||
});
|
||||
}
|
||||
// exist_relation = Object.keys(data.records.applicant_relation).map(function(key) {
|
||||
// return data.records.applicant_relation[key];
|
||||
// });
|
||||
// if(exist_relation.length>0){
|
||||
// exist_relation.forEach((element,index) => {
|
||||
// relationControl.push(this.createApplicantRelation(element));
|
||||
// let innerrelControl:any = relationControl.controls[index].get('multiple_relation') as FormArray;
|
||||
// element.multiple_relation.forEach((innereElement) => {
|
||||
// innerrelControl.push(this.createMultipleRelation(innereElement));
|
||||
// });
|
||||
// let innercomrelControl:any = relationControl.controls[index].get('multiple_company_relation') as FormArray;
|
||||
// element.multiple_company_relation.forEach((innerecomElement) => {
|
||||
// innercomrelControl.push(this.createMultipleCompanyRelation(innerecomElement));
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
else {
|
||||
this.pd_applicants_details.forEach((element,key) => {
|
||||
element.is_applicant=true;
|
||||
element.is_person_met=false;
|
||||
element.is_new=false;
|
||||
element.individuals_order_id = key+1
|
||||
individualsControl.push(this.createIndividulas(element));
|
||||
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
|
||||
let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1};
|
||||
relationControl.push(this.createApplicantRelation(applicant_details));
|
||||
let mulRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
|
||||
mulRelationControl.push(this.createMultipleRelation(applicant_details))
|
||||
let mulCmyRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
|
||||
mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
|
||||
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element));
|
||||
//let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
|
||||
// let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1};
|
||||
// relationControl.push(this.createApplicantRelation(applicant_details));
|
||||
// let mulRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
|
||||
// mulRelationControl.push(this.createMultipleRelation(applicant_details))
|
||||
// let mulCmyRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
|
||||
// mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
|
||||
|
||||
// create companies
|
||||
if(element.company_name!='' && element.company_name!=null){
|
||||
@ -182,9 +236,17 @@ export class GeneralInfoComponent implements OnInit {
|
||||
applicant_name: [elementValue.applicant_name],
|
||||
is_applicant:[elementValue.is_applicant],
|
||||
is_person_met:[elementValue.is_person_met],
|
||||
is_new:[elementValue.is_new],
|
||||
individuals_order_id: [elementValue.individuals_order_id],
|
||||
});
|
||||
}
|
||||
createPersonsWithRelationships(elementValue:any){
|
||||
return this._fb.group({
|
||||
applicant_name: [elementValue.applicant_name],
|
||||
relationship:[elementValue.relationship],
|
||||
relation_to:[elementValue.relation_to],
|
||||
});
|
||||
}
|
||||
// create companies
|
||||
createCompanies(elementValue:any) {
|
||||
return this._fb.group({
|
||||
@ -194,6 +256,46 @@ export class GeneralInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// createCompaniesRelationship(elementValue:any) {
|
||||
// return this._fb.group({
|
||||
// applicant_name:[elementValue.applicant_name],
|
||||
// company_relationship:[elementValue.company_relationship],
|
||||
// relation_to_company:[elementValue.relation_to_company]
|
||||
// });
|
||||
// }
|
||||
|
||||
createCompaniesRelationship() {
|
||||
return this._fb.group({
|
||||
applicant_name:[''],
|
||||
company_relationship:[''],
|
||||
relation_to_company:['']
|
||||
});
|
||||
}
|
||||
|
||||
createCompaniesRelationshipWithData(elementValue:any) {
|
||||
return this._fb.group({
|
||||
applicant_name:[elementValue.applicant_name],
|
||||
company_relationship:[elementValue.company_relationship],
|
||||
relation_to_company:[elementValue.relation_to_company]
|
||||
});
|
||||
}
|
||||
|
||||
// open other family family member details
|
||||
addCompanyRelationshipDialogue() {
|
||||
let control: any = this._generalForm.get('company_with_relationships') as FormArray;
|
||||
//let setValues: any = { applicant_name:'', company_relationship:'',relation_to_company:''};
|
||||
control.push(this.createCompaniesRelationship())
|
||||
}
|
||||
|
||||
// remove other famil membre
|
||||
removeCompanyRelationship(indexValues){
|
||||
let control: any = this._generalForm.get('company_with_relationships') as FormArray;
|
||||
control.removeAt(indexValues);
|
||||
// control.controls[indexValues].controls.company_name.clearValidators();
|
||||
// control.controls[indexValues].controls.company_name.updateValueAndValidity();
|
||||
//control.removeAt(indexValues);
|
||||
}
|
||||
|
||||
// add more companies
|
||||
addMoreCompanies() {
|
||||
let control: any = this._generalForm.get('companies') as FormArray;
|
||||
@ -203,6 +305,8 @@ export class GeneralInfoComponent implements OnInit {
|
||||
|
||||
// remove companies
|
||||
removeCompanies(indexValues) {
|
||||
this.count = this.count-1;
|
||||
console.log('removed Count',this.count);
|
||||
let control: any = this._generalForm.get('companies') as FormArray;
|
||||
control.controls[indexValues].controls.is_active.setValue(false);
|
||||
control.controls[indexValues].controls.company_name.clearValidators();
|
||||
@ -279,6 +383,7 @@ export class GeneralInfoComponent implements OnInit {
|
||||
|
||||
// add more individuals details
|
||||
addMoreIndividuals() {
|
||||
console.log('Initial Count',this.count);
|
||||
const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, {
|
||||
data: '',
|
||||
width:'40%',
|
||||
@ -287,17 +392,27 @@ export class GeneralInfoComponent implements OnInit {
|
||||
dialogRef.afterClosed()
|
||||
.subscribe(dataresult => {
|
||||
if(dataresult.data.length>0){
|
||||
dataresult.data.forEach(element => {
|
||||
dataresult.data.forEach((element,index) => {
|
||||
console.log('Foreach Entry Count',this.count);
|
||||
let individualsControl = <FormArray>this._generalForm.controls['individuals'];
|
||||
element.pd_co_applicant_id = this.count;
|
||||
this.count = this.count+1;
|
||||
element.individuals_order_id = individualsControl.controls.length+1;
|
||||
element.is_new=true;
|
||||
individualsControl.push(this.createIndividulas(element));
|
||||
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
|
||||
let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','other_relation':'','company_name':'','company_relation':'','company_other_relation':'','individuals_order_id':element.individuals_order_id};
|
||||
relationControl.push(this.createApplicantRelation(applicant_details));
|
||||
let mulRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
|
||||
mulRelationControl.push(this.createMultipleRelation(applicant_details))
|
||||
let mulCmyRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
|
||||
mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
|
||||
console.log('Foreach Entry Count with Incremented',this.count);
|
||||
console.log('Final Count',this.count);
|
||||
let relationControl = <FormArray>this._generalForm.controls['persons_with_relationships'];
|
||||
let applicant_details: any= {'applicant_name':element.applicant_name,'relationship':'','relation_to':''};
|
||||
relationControl.push(this.createPersonsWithRelationships(applicant_details));
|
||||
|
||||
// let relationControl2 = <FormArray>this._generalForm.controls['applicant_relation'];
|
||||
// let applicant_details2: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','other_relation':'','company_name':'','company_relation':'','company_other_relation':'','individuals_order_id':element.individuals_order_id};
|
||||
// relationControl2.push(this.createApplicantRelation(applicant_details2));
|
||||
// let mulRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
|
||||
// mulRelationControl.push(this.createMultipleRelation(applicant_details))
|
||||
// let mulCmyRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
|
||||
// mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
|
||||
});
|
||||
|
||||
}
|
||||
@ -314,21 +429,26 @@ export class GeneralInfoComponent implements OnInit {
|
||||
// submit form details
|
||||
submitGeneralForm(formData:any) {
|
||||
if (this._generalForm.invalid) {
|
||||
console.log('if',this._generalForm.value);
|
||||
this.validateAllFormFields(this._generalForm);
|
||||
return;
|
||||
}
|
||||
else if(formData.applicant_relation.length==0){
|
||||
this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
|
||||
|
||||
}
|
||||
// else if(formData.applicant_relation.length==0){
|
||||
// console.log('else if',this._generalForm.value);
|
||||
// this.notifier.notify('warning', 'Please Choose Name of Person Met.!');
|
||||
// }
|
||||
else{
|
||||
console.log('else',this._generalForm.value);
|
||||
let saveRecords:any = {}
|
||||
saveRecords.pdid=formData.pdid;
|
||||
saveRecords.formid=formData.formid;
|
||||
saveRecords.individuals=formData.individuals;
|
||||
saveRecords.companies=formData.companies;
|
||||
saveRecords.applicant_relation=formData.applicant_relation;
|
||||
saveRecords.persons_with_relationships=formData.persons_with_relationships;
|
||||
saveRecords.company_with_relationships=formData.company_with_relationships;
|
||||
//saveRecords.applicant_relation=formData.applicant_relation;
|
||||
saveRecords.general_remark=formData.general_remark;
|
||||
//console.log(saveRecords);
|
||||
this._pd.savePDFormDetailsWithID(saveRecords).subscribe(
|
||||
dataresult => {
|
||||
if (dataresult.status == 200) {
|
||||
@ -345,12 +465,7 @@ export class GeneralInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
}
|
||||
selectedApplicant(e,applicant_name){
|
||||
console.log(e);
|
||||
console.log(e.value);
|
||||
console.log(e.viewValue);
|
||||
console.log(applicant_name);
|
||||
}
|
||||
|
||||
// selectedfrequency(e,i){
|
||||
// switch(+e){
|
||||
// case 1: this.placeholderName[i] = 'Weekly Instalment Amount'; break;
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
</mat-form-field>
|
||||
<!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> -->
|
||||
<mat-card *ngIf="mortageCardAccess">
|
||||
<mat-card-header><p>Mortgage</p></mat-card-header>
|
||||
<mat-card-header><p>Details of Property being Mortgaged</p></mat-card-header>
|
||||
<mat-card-content class="matcard">
|
||||
<mat-form-field>
|
||||
<mat-select placeholder="Type of Property" formControlName="property_type" (selectionChange)="mortage_type($event.value)" required>
|
||||
@ -185,10 +185,10 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="loanDetailsForm.controls['construction_status'].value == 4">
|
||||
<!-- <mat-form-field *ngIf="loanDetailsForm.controls['construction_status'].value == 4">
|
||||
<input matInput placeholder="What is the approximate stage of construction (%)?"
|
||||
formControlName="percentage_of_construction" (keypress)="keyPress($event)" required autocomplete="off">
|
||||
</mat-form-field>
|
||||
formControlName="percentage_of_construction" (keypress)="keyPress($event)">
|
||||
</mat-form-field> -->
|
||||
|
||||
<!--<mat-select placeholder="Status of construction"
|
||||
formControlName="construction_status">
|
||||
|
||||
@ -107,7 +107,6 @@ export class LoanDetailsComponent implements OnInit {
|
||||
};
|
||||
ngOnInit() {
|
||||
console.clear();
|
||||
console.log(this.pd_all_details);
|
||||
this.initloanDetailsForm();
|
||||
this.getM_EndUseofLoad();
|
||||
this.getM_sourceofamount();
|
||||
@ -119,7 +118,6 @@ export class LoanDetailsComponent implements OnInit {
|
||||
params.pd_form_id = this.form_id;
|
||||
this._pd.retriveForm(params).subscribe(value => {
|
||||
// *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "
|
||||
console.log('value', value);
|
||||
if (value.status == 200) {
|
||||
let result = Object.keys(value.records.end_use_group).map(function(key) {
|
||||
return value.records.end_use_group[key];
|
||||
@ -178,15 +176,12 @@ export class LoanDetailsComponent implements OnInit {
|
||||
return value.records.source_group[key];
|
||||
});
|
||||
|
||||
console.log(source);
|
||||
|
||||
let dbsourcelist : any = [];
|
||||
source.forEach(val => {
|
||||
dbsourcelist.push(val.sources);
|
||||
});
|
||||
|
||||
console.log('sources',dbsourcelist);
|
||||
|
||||
this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution);
|
||||
if(value.records.own_contribution){ this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); }
|
||||
|
||||
@ -223,12 +218,12 @@ export class LoanDetailsComponent implements OnInit {
|
||||
this.loanDetailsForm.controls['other_owners_name'].setValue(value.records.other_owners_name);
|
||||
this.loanDetailsForm.controls['construction_status'].setValue(value.records.construction_status);
|
||||
|
||||
if(value.records.construction_status == 4 ){
|
||||
this.loanDetailsForm.controls['percentage_of_construction'].setValue(value.records.percentage_of_construction);
|
||||
}
|
||||
else{
|
||||
this.loanDetailsForm.controls['percentage_of_construction'].setValue('');
|
||||
}
|
||||
// if(value.records.construction_status == 4 ){
|
||||
// this.loanDetailsForm.controls['percentage_of_construction'].setValue(value.records.percentage_of_construction);
|
||||
// }
|
||||
// else{
|
||||
// this.loanDetailsForm.controls['percentage_of_construction'].setValue('');
|
||||
// }
|
||||
if(value.records.emv_per_customer != ''){
|
||||
this.loanDetailsForm.controls['emv_per_customer'].setValue(value.records.emv_per_customer);
|
||||
this.emvAmtInWords = this._pd.convertNumberToWords(value.records.emv_per_customer);
|
||||
@ -287,13 +282,11 @@ getM_sourceofamount() {
|
||||
function(data){
|
||||
if(that.productAbbr != "LAP"){
|
||||
if(data.group_name == that.productAbbr && data.isactive==1){
|
||||
console.log('if data');
|
||||
return data;
|
||||
}
|
||||
}
|
||||
else if(that.productAbbr == "LAP"){
|
||||
if(data.sub_group_name == that.subProductName && data.isactive==1){
|
||||
console.log('else data');
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -368,7 +361,7 @@ getM_sourceofamount() {
|
||||
owner_name: ['', Validators.compose([Validators.required])],
|
||||
other_owners_name :[''],
|
||||
construction_status: ['', Validators.compose([Validators.required])],
|
||||
percentage_of_construction : [''],
|
||||
//percentage_of_construction : [''],
|
||||
emv_per_customer: ['', Validators.compose([Validators.required])],
|
||||
//value_per_agreement: ['', Validators.compose([Validators.required])],
|
||||
loandetails_remarks: ['', Validators.compose([Validators.required])],
|
||||
@ -390,9 +383,6 @@ getM_sourceofamount() {
|
||||
event.forEach(option => {
|
||||
let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0];
|
||||
OthersAvaliable = othersData.name.substr(0,6).toLowerCase();
|
||||
console.log('other',othersData);
|
||||
console.log('',OthersAvaliable);
|
||||
|
||||
this.endUserList.push({ end_use: option });
|
||||
|
||||
});
|
||||
@ -404,8 +394,6 @@ getM_sourceofamount() {
|
||||
this.isOtherPurpose = false;
|
||||
}
|
||||
|
||||
console.log('e',event);
|
||||
|
||||
//this.isOtherPurpose = event.some(e => e == 'others') // this return true or false Only;
|
||||
}
|
||||
|
||||
@ -444,7 +432,6 @@ getM_sourceofamount() {
|
||||
// });
|
||||
}
|
||||
submitLoanDetails() {
|
||||
console.log('formData', this.loanDetailsForm.value);
|
||||
// if (!this.loanDetailsForm.valid) {
|
||||
// //this.notifier.notify('warning', 'Form Invaild Check all requried Field .!');
|
||||
// return;
|
||||
@ -524,13 +511,11 @@ getM_sourceofamount() {
|
||||
}else{ records.personal_loan_source = ''; }
|
||||
|
||||
records.construction_status = this.loanDetailsForm.controls['construction_status'].value;
|
||||
records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value;
|
||||
//records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value;
|
||||
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
|
||||
//records.value_per_agreement = this.loanDetailsForm.controls['value_per_agreement'].value;
|
||||
records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value;
|
||||
console.log('data', records);
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
console.log('data', data);
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
|
||||
@ -560,7 +560,7 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<notifier-container></notifier-container>
|
||||
<!-- <notifier-container></notifier-container> -->
|
||||
<!-- <mat-card style="padding: 12px;">
|
||||
<p>Stock Details</p>
|
||||
<form [formGroup]="stockForms" class="address"> -->
|
||||
|
||||
@ -22,6 +22,7 @@ export class StockComponent implements OnInit {
|
||||
pageTitle: string ="Stock Details";
|
||||
pdid: number;
|
||||
form_id: number;
|
||||
company_id: string;
|
||||
public stockForms: FormGroup;
|
||||
private notifier: NotifierService;
|
||||
public uomData : any = [];
|
||||
@ -60,6 +61,7 @@ export class StockComponent implements OnInit {
|
||||
private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.form_id = 11;
|
||||
this.company_id = this.pd_all_details.company_id
|
||||
this.notifier = notifier;
|
||||
}
|
||||
public viewerOptions: any = {
|
||||
@ -92,7 +94,7 @@ export class StockComponent implements OnInit {
|
||||
// })
|
||||
|
||||
//this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(
|
||||
this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => {
|
||||
this._pd.stockFormAccess({pd_id:this.pdid,company_id:this.company_id}).subscribe(data => {
|
||||
|
||||
if(data.dataStatus == true){
|
||||
let datas = data.records;
|
||||
@ -119,18 +121,18 @@ export class StockComponent implements OnInit {
|
||||
}
|
||||
|
||||
public initstockForms(record){
|
||||
console.log(record);
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = this.form_id;
|
||||
params.company_id = this.company_id;
|
||||
this._pd.retriveForm(params).subscribe(value => {
|
||||
if (value.status == 200) {
|
||||
let dataForm = value.records;
|
||||
if(dataForm !== undefined) {
|
||||
console.log(dataForm);
|
||||
this.stockForms = this.fb.group({
|
||||
pdid: [this.pdid],
|
||||
formid: [this.form_id],
|
||||
company_id: [this.company_id],
|
||||
stock_remarks: [''],
|
||||
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
|
||||
retail_details : this.fb.array([this.retailFormCreation(record)]),
|
||||
@ -138,7 +140,6 @@ export class StockComponent implements OnInit {
|
||||
});
|
||||
|
||||
let arr = record.filter(data => data.type_of_activity_id == 1);
|
||||
console.log(133,arr.length);
|
||||
if(arr.length > 0) {
|
||||
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
|
||||
console.log('136',value);
|
||||
@ -275,6 +276,7 @@ export class StockComponent implements OnInit {
|
||||
this.stockForms = this.fb.group({
|
||||
pdid: [this.pdid],
|
||||
formid: [this.form_id],
|
||||
company_id: [this.company_id],
|
||||
stock_remarks: [''],
|
||||
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
|
||||
retail_details : this.fb.array([this.retailFormCreation(record)]),
|
||||
@ -356,11 +358,8 @@ export class StockComponent implements OnInit {
|
||||
|
||||
manufacturingForm: Boolean = false;
|
||||
manufacturingFormCreation(record) {
|
||||
console.log(record);
|
||||
let arr = record.filter(data => data.type_of_activity_id == 1);
|
||||
console.log(arr);
|
||||
if (arr.length > 0) {
|
||||
console.log(arr.length);
|
||||
this.manufacturingForm = true;
|
||||
return this.fb.group({
|
||||
manufacturing_raw_materials: this.fb.array([]),
|
||||
|
||||
@ -37,7 +37,7 @@ export class SupplierInfoComponent implements OnInit {
|
||||
//@Input() pdid: number;
|
||||
pdid: string;
|
||||
form_id: number;
|
||||
|
||||
company_id: string;
|
||||
public _supplierQuesFrom: FormGroup;
|
||||
public submitted = false;
|
||||
|
||||
@ -51,6 +51,7 @@ export class SupplierInfoComponent implements OnInit {
|
||||
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.form_id = 1;
|
||||
this.company_id = this.pd_all_details.company_id
|
||||
this.notifier = notifier;
|
||||
}
|
||||
public viewerOptions: any = {
|
||||
@ -76,7 +77,7 @@ export class SupplierInfoComponent implements OnInit {
|
||||
noRecordsFound: Boolean = false;
|
||||
errorMessage: any = '';
|
||||
ngOnInit() {
|
||||
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
|
||||
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => {
|
||||
if(data.dataStatus){
|
||||
// let datas = {
|
||||
// "profession_name": "Others",
|
||||
@ -116,8 +117,12 @@ export class SupplierInfoComponent implements OnInit {
|
||||
|
||||
serviceProviderForm: Boolean = false;
|
||||
initFormLoadDetails(record) {
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = this.form_id;
|
||||
params.company_id = this.company_id;
|
||||
// alert(JSON.stringify(record));
|
||||
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe(
|
||||
this.pdTrigerService.retriveForm(params).subscribe(
|
||||
data => {
|
||||
if(data.dataStatus){
|
||||
let dataForm = data.records;
|
||||
@ -125,6 +130,7 @@ export class SupplierInfoComponent implements OnInit {
|
||||
this._supplierQuesFrom = this._formBuilder.group({
|
||||
pdid: [this.pdid],
|
||||
formid: ['1'],
|
||||
company_id: [this.company_id],
|
||||
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
|
||||
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
|
||||
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
|
||||
@ -154,6 +160,7 @@ export class SupplierInfoComponent implements OnInit {
|
||||
this._supplierQuesFrom = this._formBuilder.group({
|
||||
pdid: [this.pdid],
|
||||
formid: ['1'],
|
||||
company_id: [this.company_id],
|
||||
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
|
||||
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
|
||||
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
<span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
|
||||
</div> -->
|
||||
</mat-card-header>
|
||||
</mat-card>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
<mat-card-actions align="end">
|
||||
|
||||
@ -26,6 +26,7 @@ import {LoanDetailsComponent} from './forms/loan-details/loan-details.component'
|
||||
import {GeneralInfoComponent} from './forms/general-info/general-info.component';
|
||||
import {NeighbourHoodComponent} from './forms/neighbour-hood/neighbour-hood.component';
|
||||
import {FinalRemarksComponent} from './forms/final-remarks/final-remarks.component';
|
||||
import { BusinessInfoGroupComponent } from './forms/business-info-group/business-info-group.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-start-pd',
|
||||
@ -314,7 +315,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}else
|
||||
if(this.selectedFormsCategory.form_id==13){
|
||||
const dialogRef = this.dialog.open(BusinessInfoComponent, {
|
||||
const dialogRef = this.dialog.open(BusinessInfoGroupComponent, {
|
||||
data: this.pdFullDetails,
|
||||
position: { right: '0'},
|
||||
width:'80%',
|
||||
|
||||
@ -89,6 +89,7 @@ import { FinalRemarksComponent } from './list-pd/start-pd/forms/final-remarks/fi
|
||||
import { BusinessOtherFamilyMemberComponent } from './list-pd/start-pd/forms/dialogue/business-other-family-member/business-other-family-member.component';
|
||||
import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.component';
|
||||
import { SharedModule } from "app/shared/shared.module";
|
||||
import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component';
|
||||
|
||||
/**
|
||||
* Custom angular notifier options
|
||||
@ -266,7 +267,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
||||
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
||||
// OwlNativeDateTimeModule,
|
||||
// ],
|
||||
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent],
|
||||
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent],
|
||||
|
||||
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
||||
// providers: [PdTrigerService, GetGeometricLocationService],
|
||||
@ -304,13 +305,13 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
||||
OwlNativeDateTimeModule,
|
||||
],
|
||||
// declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent],
|
||||
exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent],
|
||||
exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent],
|
||||
providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
|
||||
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
|
||||
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],
|
||||
|
||||
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
|
||||
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent],
|
||||
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent],
|
||||
|
||||
})
|
||||
export class ManagePdModule {
|
||||
|
||||
@ -322,15 +322,14 @@ export class PdTrigerService {
|
||||
|
||||
swapOlderPDReportToLatest(pdId: any): Observable<any> {
|
||||
pdId.fk_createdby = this._aws.getlocale();
|
||||
alert(JSON.stringify(pdId));
|
||||
return this._http.post<any>(this.apiUrl + "swapOlderPDReportToLatest", { "records": pdId })
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
}
|
||||
|
||||
getTypeofActivityForSuppliedInfoForm(pd_id: any): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id } })
|
||||
getTypeofActivityForSuppliedInfoForm(pd_id: any,company_id:any): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id,"company_id":company_id } })
|
||||
.pipe(
|
||||
catchError(this.handleError('operation', []))
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user