This commit is contained in:
dineshkumarkannan 2019-01-07 19:49:31 +05:30
commit 85af16aad3
48 changed files with 2014 additions and 1063 deletions

View File

@ -11192,4 +11192,4 @@
"integrity": "sha512-W9Nj+UmBJG251wkCacIkETgra4QgBo/vgoEkb4a2uoLzpQG7qF9nzwoLXWU5xj3Fg2mxGvEDh47mg24vXccYjA=="
}
}
}
}

View File

@ -3,6 +3,7 @@
"version": "0.0.0",
"license": "MIT",
"scripts": {
"build-prod": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng",
"ng": "ng",
"start": "ng serve",
"build": "ng build",

View File

@ -109,7 +109,7 @@
</mat-form-field>
<mat-form-field style="width: 32%">
<input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required autocomplete="off">
<mat-hint align="end" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:70%" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>

View File

@ -273,7 +273,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
// save pd in draft
saveDraftPD(formValue: any, status:string){
alert('Inside The Draft PD');
//alert('Inside The Draft PD');
this.submitPdDetails(formValue, status);
}
//trigger pd
@ -362,11 +362,11 @@ export class AddPdComponent implements OnInit, OnDestroy {
// common function for both draft and process pd
submitPdDetails(formValue: any, status:string) {
alert('Inside Function Submit Function');
//alert('Inside Function Submit Function');
if(this._PDtriggerForm.invalid) {
this.validateAllFormFields(this._PDtriggerForm);
alert('validationError');
console.log(this._PDtriggerForm);
//alert('validationError');
//console.log(this._PDtriggerForm);
return;
}
else {
@ -473,7 +473,8 @@ export class AddPdComponent implements OnInit, OnDestroy {
}
/** On Key Press Event For Mobile Number */
keyPress(event: any) {
const pattern = /[0-9/ /./-]/;
// const pattern = /[0-9/ /./-]/;
const pattern = /[0-9]/;
let inputChar = String.fromCharCode(event.charCode);
if (event.keyCode != 8 && !pattern.test(inputChar)) {

View File

@ -42,7 +42,7 @@ export class EditPdApplicantComponent implements OnInit {
this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [null],
applicant_name: [null, Validators.compose([Validators.required])],
mobile_no: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])],
stdcode: [null, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
company_name: [null],
@ -59,7 +59,7 @@ export class EditPdApplicantComponent implements OnInit {
this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])],
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required,Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])],
stdcode: [stdcode, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
company_name: [this.mainApplicantData[0].company_name],
@ -76,9 +76,19 @@ export class EditPdApplicantComponent implements OnInit {
}
createItem(listData): FormGroup {
if(listData){
console.log(listData.landline);
let stdcode;
let landline;
if(listData.landline != null){
let stdcodesearch = listData.landline.search("-");
let stdcode = listData.landline.substr(0,stdcodesearch);
let landline = listData.landline.substr(+stdcodesearch + 1,8);
stdcode = listData.landline.substr(0,stdcodesearch);
//console.log(stdcode);
landline = listData.landline.substr(+stdcodesearch + 1,8);}
else{
stdcode = null;
landline = null;
}
console.log(landline);
return this._fb.group({
label: ['Co Applicant'],
fk_applicant_primary_id: [listData.pd_co_applicant_id],
@ -136,13 +146,32 @@ export class EditPdApplicantComponent implements OnInit {
"isactive":1
}];
formValue.coApplicantItems.forEach((itemElement, itemIndex) => {
// console.log(itemElement.coapplicant_stdcode);
// console.log(itemElement.coapplicant_landline);
let concat_landline
if(itemElement.coapplicant_stdcode != null && itemElement.coapplicant_landline != null){
if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){
concat_landline = null;
}else{
let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode;
let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline;
concat_landline = std+'-'+landline;
}
}else if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){
concat_landline = null;
}else{
concat_landline = null;
}
console.log(concat_landline);
let obj1 = {
"fk_pd_id": this.data.pdID,
"pd_co_applicant_id": itemElement.fk_applicant_primary_id,
"applicant_name":itemElement.coapplicantName,
"relation":itemElement.relationship,
"mobile_no":itemElement.coapplicant_mobile_no,
"landline":itemElement.coapplicant_stdcode+'-'+itemElement.coapplicant_landline,
"landline":concat_landline,
"applicant_type":itemElement.applicant_type,
"company_name":itemElement.company_name,
"isactive":1

View File

@ -37,10 +37,8 @@
<input matInput placeholder="Lender Contact Person" formControlName="pd_contact_person" type="text" required>
</mat-form-field>
<mat-form-field style="width: 32%">
<input matInput placeholder="Lender Contact Number" formControlName="pd_contact_mobileno" type="text" required>
<input matInput placeholder="Lender Contact Number" formControlName="pd_contact_mobileno" type="text" required (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.pd_contact_mobileno.hasError('pattern') || pdMain.pd_contact_mobileno.hasError('maxlength') || pdMain.pd_contact_mobileno.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 32%">
<mat-select placeholder="Product Name" formControlName="fk_product_id" (selectionChange)="getSubproductList(pdMain.fk_product_id.value)">
@ -90,7 +88,7 @@
<mat-form-field style="width: 24%">
<!-- <input matInput placeholder="Loan Amount" formControlName="loan_amount"> -->
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required autocomplete="off">
<mat-hint align="end" *ngIf="pdMain.loan_amount.value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:70%" *ngIf="pdMain.loan_amount.value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>

View File

@ -259,7 +259,8 @@ export class EditPdMasterComponent implements OnInit {
}
/** On Key Press Event For Mobile Number */
keyPress(event: any) {
const pattern = /[0-9/ /./-]/;
//const pattern = /[0-9/ /./-]/;
const pattern = /[0-9]/;
let inputChar = String.fromCharCode(event.charCode);
if (event.keyCode != 8 && !pattern.test(inputChar)) {

View File

@ -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)="inWordsForRent($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="addressForm.controls['rent_amt'].value != ''">{{"&#8377;"}} {{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>
@ -144,79 +169,72 @@
</mat-select>
</mat-form-field>--(Customer Behaviour)-->
<mat-card *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'">
<div formArrayName="additional_address_units">
<div *ngFor="let item of addressForm.controls.additional_address_units['controls']; let i=index" >
<mat-card-header><p>Additional Unit #{{i+1}}</p></mat-card-header>
<mat-card-content class="matcard" [formGroup]="item">
<!-- <mat-form-field *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 100%"> -->
<!-- <mat-select placeholder="Bussiness Type" formControlName="bussiness_address_type">
<mat-option value="{{m_addressType.address_type_id}}"
*ngFor="let m_addressType of addressData">{{m_addressType.address_type}}
</mat-option>
</mat-select> -->
<!-- <mat-select placeholder="Type of Premises" formControlName="bussiness_address_type" multiple>
<mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id" (onSelectionChange)="SelectedPremises($event)" > {{m_addressType.address_type}} </mat-option>
</mat-select>
</mat-form-field> -->
<label *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'"> Type of Premises </label>
<div fxLayout="row wrap" class="example-section" *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25" *ngFor="let at of addressData;let i = index;"> <!---- [formGroupName]="i"> -->
<mat-checkbox class="example-margin" color="primary" [value]="at.address_type_id" (change)="SelectedPremises($event)" [checked]="at.status==1 ? true:false">{{at.address_type}}</mat-checkbox>
</div>
</div>
<!-- <mat-form-field *ngIf="PremisesOtherFlag == true" style="width: 40%">
<input matInput placeholder="Specify Premises Type" formControlName="bussiness_address_type_others" (change)="otherValueset()" autocomplete="off">
</mat-form-field> -->
<span *ngIf="PremisesOtherFlag == true">
<br>
<mat-form-field style="width: 40%">
<input matInput placeholder="Specify Premises Type" formControlName="bussiness_address_type_others" (change)="otherValueset()" autocomplete="off">
</mat-form-field>
</span>
<mat-form-field style="width: 40%">
<mat-select placeholder="Type of Premises" formControlName="premises_type">
<mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id"> {{m_addressType.address_type}} </mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="item.get('premises_type').value == 12" style="width: 40%">
<input matInput placeholder="Specify Premises Type" formControlName="premises_type_others" autocomplete="off">
</mat-form-field>
<mat-form-field style="width: 40%;">
<input matInput placeholder="Number Of Additional Units"
formControlName="no_of_additional_units" autocomplete="off">
</mat-form-field>
<mat-form-field style="width: 40%;">
<input matInput placeholder="Location/City"
formControlName="premises_city" autocomplete="off">
</mat-form-field>
<mat-form-field style="width: 40%;">
<mat-select placeholder="Ownership" formControlName="premises_ownership">
<mat-option value="{{ownerShip.id}}" *ngFor="let ownerShip of ownerShipData">
{{ownerShip.name}}
</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-form-field *ngIf="addressForm.controls['premises_ownership'].value == 4 "> -->
<mat-form-field *ngIf="item.get('premises_ownership').value == 4" style="width: 40%;">
<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" (keypress)="keyPress($event)" (keyup)="inWords($event,i)">
<mat-hint align="start" style="font-size:70%" *ngIf="item.get('premises_rent_amt').value != ''">{{"&#8377;"}} {{premisesRentAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Remarks"
formControlName="premises_remarks" style="width: 65%;" autocomplete="off">
</mat-form-field>
<button type="button" matTooltip="Add More Neighbour Details" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button *ngIf="i==0"
(click)="addUnits($event)"
color="primary" style="float: right;">
<mat-icon>add</mat-icon>
</button>
<button type="button" matTooltip="Delete" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button *ngIf="i>0"
(click)="removeUnits(i)"
style="float: right;">
<mat-icon>delete</mat-icon>
</button>
</mat-card-content>
</div>
</div>
</mat-card>
<span formArrayName="additional_premises">
<div
*ngFor="let item of addressForm.controls.additional_premises['controls']; let i = index;" [formGroupName]="i">
<p>{{i+1}} . {{PremisesLabel[i]}}</p>
<mat-form-field style="width: 40%;">
<input matInput placeholder="Number Of Additional Units"
formControlName="no_of_additional_units" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="item.get('no_of_additional_units').value > 2" style="width: 40%;">
<mat-select placeholder="City" formControlName="premises_city" multiple > <!-- (selectionChange)="relationChanged($event)"> -->
<mat-option *ngFor="let CL of cityData" [value]="CL.city_id">
{{CL.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="item.get('no_of_additional_units').value <= 2 && item.get('no_of_additional_units').value != '' " style="width: 40%;">
<mat-select placeholder="Ownership" formControlName="premises_ownership">
<mat-option value="{{ownerShip.id}}" *ngFor="let ownerShip of ownerShipData">
{{ownerShip.name}}
</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-form-field *ngIf="addressForm.controls['premises_ownership'].value == 4 "> -->
<mat-form-field *ngIf="item.get('premises_ownership').value == 4" style="width: 40%;">
<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">
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Remarks"
formControlName="premises_remarks" style="width: 65%;" autocomplete="off">
</mat-form-field>
</div>
</span>
<!--- Don't Remove To replace atlast of the PD Completion and creating new form (Neighbourhood check) --
<mat-card>
<mat-card-header>

View File

@ -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;
@ -109,20 +115,27 @@ export class AddressComponent implements OnInit {
this._pd.retriveForm(params).subscribe(data => {
console.log('data', data);
//const control = <FormArray>this.addressForm.controls['neighbourhood'];
const additionalPremisesControl = <FormArray>this.addressForm.controls['additional_premises'];
const control = <FormArray>this.addressForm.controls['additional_address_units'];
//const additionalPremisesControl = <FormArray>this.addressForm.controls['additional_premises'];
if(data.status == 200) {
// var result = Object.keys(data.records.neighbourhood).map(function (key) {
// return data.records.neighbourhood[key];
// });
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);
let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type);
this.selectedAddressType(selectedAddressType);
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,42 +145,47 @@ 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) {
this.addressForm.controls.business_years.setValue(data.records.business_years);
this.addressForm.controls.business_month.setValue(data.records.business_month);
let that = this;
this.bussiness_address_type = [];
this.bussiness_address_type = (Object.keys(data.records.bussiness_address_type).map(function(key)
{
return data.records.bussiness_address_type[key].premises_types;
}))
this.additional_premises = Object.keys(data.records.additional_premises).map(function(key)
{
return data.records.additional_premises[key];
})
if(data.records.bussiness_activity == 'yes') {
// const control = <FormArray>this.addressForm.controls['additional_address_units'];
var resultOfUnits = Object.keys(data.records.additional_address_units).map(function (key) {
return data.records.additional_address_units[key];
});
//console.log(resultOfUnits);
if (resultOfUnits.length == 0) {
control.push(this.createUnits());
} else {
resultOfUnits.forEach((datas,index) => {
this.premisesRentAmtInwords[index] = this._pd.convertNumberToWords(datas.premises_rent_amt);
control.push(this.createUnits());
});
this.addressForm.controls.additional_address_units.setValue(resultOfUnits);
}
}
this.selectedValue(this.bussiness_address_type,this.additional_premises);
if (data.records.locality_others) {
this.addressForm.controls.locality_others.setValue(data.records.locality_others);
}
// if (result.length == 0) {
// control.push(this.createNeighbour());
// } else {
// result.forEach(datas => {
// control.push(this.createNeighbour());
// });
// this.addressForm.controls.neighbourhood.setValue(result);
// }
} else {
//control.push(this.createNeighbour());
control.push(this.createUnits());
}
});
}
@ -181,28 +199,35 @@ 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([]),
additional_address_units: 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:[''],
bussiness_address_type:[''],
bussiness_address_type_others: [''],
additional_premises: this.fb.array([])
//additional_premises: this.fb.array([])
});
this.address = this.addressForm.controls['address'];
this.addressType = this.addressForm.controls['address_type'];
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'];
@ -217,16 +242,28 @@ export class AddressComponent implements OnInit {
// is_owner: ['', Validators.compose([Validators.required])],
// });
// }
createPremises(): FormGroup {
createUnits(): FormGroup {
return this.fb.group({
no_of_additional_units: [''],
premises_type: [''],
premises_type_others: [''],
premises_city: [''],
premises_remarks: [''],
premises_ownership: [''],
premises_ownership_others: [''],
premises_rent_amt:[''],
premises_remarks: [''],
});
}
}
// createPremises(): FormGroup {
// return this.fb.group({
// no_of_additional_units: [''],
// premises_city: [''],
// premises_remarks: [''],
// premises_ownership: [''],
// premises_ownership_others: [''],
// premises_rent_amt:[''],
// });
// }
getMasterDetails(table:string,type:number){
this._pd.getAllMasterDatas(table).subscribe(data => {
data.records.forEach(val => {
@ -284,6 +321,17 @@ export class AddressComponent implements OnInit {
const control = <FormArray>this.addressForm.controls['neighbourhood'];
control.removeAt(index);
}*/
addUnits() {
const control = <FormArray>this.addressForm.controls['additional_address_units'];
control.push(this.createUnits());
}
removeUnits(index) {
const control = <FormArray>this.addressForm.controls['additional_address_units'];
control.removeAt(index);
}
onSubmit() {
if (!this.addressForm.valid) {
@ -303,52 +351,29 @@ 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;
if (this.bussinessActivity.value == 'yes') {
// records.bussiness_address_type = this.addressForm.controls.bussiness_address_type.value;
records.bussiness_address_type = this.formPremisesArray;
if (records.bussiness_address_type == 12) {
records.bussiness_address_type_others = this.addressForm.controls.bussiness_address_type_others.value;
}
if (this.bussinessActivity.value == 'yes') {
records.additional_address_units = this.addressForm.controls.additional_address_units.value;
}
console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value);
this.addressForm.controls.additional_premises.value.forEach((val,index)=>
{
if(val.premises_city != '' && val.premises_city != null){
this.formPremisesCityArray = [];
val.premises_city.forEach(option => {
this.formPremisesCityArray.push({additional_premises_city: option});
});
this.addressForm.controls.additional_premises.value[index].premises_city = this.formPremisesCityArray;
}
else{
this.formPremisesCityArray = [];
this.addressForm.controls.additional_premises.value[index].premises_city = null;
}
});
records.additional_premises = this.addressForm.controls.additional_premises.value;
records.pdid = this.pdid;
records.formid = '5';
// records.fk_createdby = '250';
console.log(JSON.stringify(records));
// console.log(JSON.stringify(records));
this._pd.saveForm(records).subscribe(data => {
@ -358,134 +383,11 @@ export class AddressComponent implements OnInit {
});
}
// relationChanged(event) {
// this.formPremisesCityArray = [];
// event.value.forEach(option => {
// this.formPremisesCityArray.push({city: option});
// });
// }
SelectedPremises($event){
selectedAddressType(e: any){
this.placeholderName = 'Was any business activity seen at the '+e+' during PD visit?';
}
let premisesData = $event.source.value;
if($event.checked === true ){
//this.formPremisesArray.push({member: $event.source.value});
//this.selectedSegmentDatas.push(CustomerSegmentName.name);
this.formPremisesArray.push({premises_types: $event.source.value});
const control = <FormArray>this.addressForm.controls['additional_premises'];
let array = this.addressData.filter(data => data.address_type_id == premisesData)[0];
if(premisesData == 12){
this.PremisesOtherFlag = true;
// this.PremisesLabel[this.z] = this.pdQuestionAddress.get('bussiness_address_type_others').value;
control.push(this.createPremises());
}
else{
this.PremisesLabel[this.z] = array.address_type;
control.push(this.createPremises());
}
//console.log(this.PremisesLabel);
this.z++;
}
else if($event.checked === false ){
if(premisesData == 12){
this.PremisesOtherFlag = false;
}
let index = this.formPremisesArray.findIndex(form=>form.premises_types== $event.source.value);
//console.log(index);
const control = <FormArray>this.addressForm.controls['additional_premises'];
control.removeAt(index);
this.PremisesLabel.splice(index,1);
//console.log(this.z);
this.z--;
}
}
getCity(e)
{
this.cityData = [];
e.forEach(val=>
{
this.cityData.push({additional_premises_city:val});
});
//console.log(this.cityData);
}
otherValueset()
{
let z = this.z;
this.PremisesLabel[z-1] = this.addressForm.get('bussiness_address_type_others').value;
}
selectedValue(e,data)
{
let premisesData = e ;
this.tempArr = [];
let that = this;
this.addressData = Object.keys(this.addressData).map(function(key)
{
that.addressData[key].status = 0;
return that.addressData[key];
})
premisesData.forEach((val,index)=>
{
this.z++;
this.formPremisesArray.push({premises_types: val});
this.tempArr.push(this.addressData.filter(add=>add.address_type_id==val)[0]);
this.PremisesLabel[index] = this.tempArr[index].address_type;
if(data[index] !==undefined && data[index].premises_ownership < 2 ){
data[index].premises_city = Object.keys(data[index].premises_city).map(function(key)
{
return data[index].premises_city[key].additional_premises_city;
});
//data[index].premises_city = data[index].premises_city.additional_premises_city;
}
this.addressData.forEach(data=>
{
if(data.address_type_id == val)
{
data.status = 1;
}
});
});
const control = <FormArray>this.addressForm.controls['additional_premises'] as FormArray;
// control.removeAt(0);
this.tempArr.forEach((item,index)=>
{
control.push(this.createPremises());
});
this.addressForm.controls['additional_premises'].setValue(data);
}
validateAllFormFields(formGroup: FormGroup) {
Object.keys(formGroup.controls).forEach(field => {
const control = formGroup.get(field);
@ -496,6 +398,7 @@ export class AddressComponent implements OnInit {
}
});
}
ConvertMonthintoYear(e){
let business_year = this.addressForm.controls.business_years.value;
@ -516,4 +419,12 @@ export class AddressComponent implements OnInit {
event.preventDefault();
}
}
inWords(e,i){
this.premisesRentAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
}
inWordsForRent(e){
this.rentAmtInwords = this._pd.convertNumberToWords(e.target.value);
}
}

View File

@ -13,7 +13,7 @@
<mat-tab-group>
<mat-tab label="Business Asset Questions">
<mat-tab label="Assets Used For Business">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
@ -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>
@ -101,12 +101,13 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,5)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}} {{PremiumPaidInwords[s]}} Only</mat-hint>
</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>
@ -117,7 +118,8 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,7)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}} {{SumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:30%">
@ -136,14 +138,15 @@
<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 ">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:30%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,9)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}} {{AmtInvestInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:30%">
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
@ -162,24 +165,45 @@
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,11)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('any_other_asset_value').value != ''">{{"&#8377;"}} {{AssetValueInwords[s]}} Only</mat-hint>
</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,2)">
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue | titlecase}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:30%" *ngIf="businessEmiAmtFlag">
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off" (keyup)="inWords($event,s,13)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('other_asset_emi_amt').value != ''">{{"&#8377;"}} {{B_emiAmtInwords[s]}} Only</mat-hint>
</mat-form-field>
</div>
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off">
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" > -->
<!-- </mat-form-field> -->
<!-- </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,2)">
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> --
<mat-form-field style="width:95%" *ngIf="businessEmiAmtFlag">
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off">
<!-- <span matSuffix>.00</span> -->
<!-- <span matSuffix>.00</span> --
</mat-form-field>
</div>
</div>-->
</div>
</div>
</div>
@ -195,12 +219,26 @@
</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="Asset Owned by"
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>
<span *ngIf="sup.get('business_assets_mode').value != ''">
<mat-form-field style="width:30%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="business_purchase_year" (keypress)="keyPress($event)">
<mat-error> Invalid year format</mat-error>
</mat-form-field>
</span>
<span *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -217,15 +255,15 @@
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="business_original_loan_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="business_original_loan_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Balance Tenure in Months" formControlName="business_balance_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)">
<input matInput placeholder="Balance Tenure in Months" formControlName="business_balance_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes' && sup.get('business_original_loan_tenure').value != '' && sup.get('business_balance_tenure').value != '' " style="width:30%">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="business_elapsed_tenure" autocomplete="off">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="business_elapsed_tenure" autocomplete="off" readonly>
</mat-form-field>
</div>
@ -261,7 +299,7 @@
</div>
</ng-template>
</mat-tab>
<mat-tab label="Other Asset Questions">
<mat-tab label="Other Personal Assets">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
@ -277,7 +315,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>
@ -290,7 +328,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%">
@ -357,11 +395,12 @@
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,6)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}} {{OtherPremiumPaidInwords[s]}} Only</mat-hint>
</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 ">
@ -371,7 +410,8 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,8)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}} {{OtherSumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:30%">
@ -392,7 +432,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>
@ -401,7 +441,8 @@
</mat-form-field>
<mat-form-field style="width:30%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,10)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
@ -426,44 +467,49 @@
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off">
</mat-form-field>
<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>
<mat-form-field *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''" style="width:30%">
<mat-form-field *ngIf="sup.get('name_of_the_owner').value == 0" style="width:30%">
<input matInput placeholder="Specify Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
{{relations.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
{{relations.name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,12)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('any_other_asset_value').value != ''">{{"&#8377;"}} {{OtherAssetValueInwords[s]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" > -->
<!-- </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>
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
<mat-form-field style="width:30%" *ngIf="otherEmiamtFlag">
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off">
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off"(keyup)="inWords($event,s,14)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('other_asset_emi_amt').value != ''">{{"&#8377;"}} {{O_emiAmtInwords[s]}} Only</mat-hint>
<!-- <span matSuffix>.00</span> -->
</mat-form-field>
</div>
@ -480,7 +526,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>
@ -493,12 +539,22 @@
<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>
</div>
<span *ngIf="sup.get('assets_mode').value != ''">
<mat-form-field style="width:30%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="purchase_year" (keypress)="keyPress($event)">
<mat-error> Invalid year format</mat-error>
</mat-form-field>
</span>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<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:95%">
@ -514,15 +570,15 @@
</mat-form-field>
<mat-form-field *ngIf="sup.get('emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="original_loan_tenure" (change)="loanTenureCalc(sup,1)" autocomplete="off">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="original_loan_tenure" (change)="loanTenureCalc(sup,1)" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="sup.get('emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Balance Tenure in Months" formControlName="balance_tenure" (change)="loanTenureCalc(sup,1)" autocomplete="off">
<input matInput placeholder="Balance Tenure in Months" formControlName="balance_tenure" (change)="loanTenureCalc(sup,1)"(keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="sup.get('emi').value === 'yes' && sup.get('original_loan_tenure').value != '' && sup.get('balance_tenure').value != '' " style="width:30%">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off" readonly>
</mat-form-field>
</div>

View File

@ -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;
@ -47,6 +47,16 @@ export class AssetsInfoComponent implements OnInit {
OtherAppxMarketAmtInwords : any = [];
emiAmtInwords : any = [];
OtherEmiAmtInwords : any = [];
PremiumPaidInwords : any = [];
OtherPremiumPaidInwords: any = [];
SumAssuredInwords: any = [];
OtherSumAssuredInwords: any = [];
AmtInvestInwords: any = [];
OtherAmtInvestInwords: any = [];
AssetValueInwords: any = [];
OtherAssetValueInwords: any = [];
B_emiAmtInwords: any = [];
O_emiAmtInwords: any = [];
// public m_assets_type = [
// {
// 'id': "1",
@ -173,6 +183,7 @@ public m_investmentType = [];
// ]
private notifier: NotifierService;
existCompanyList: any =[];
constructor(
notifier: NotifierService,
private _formBuilder: FormBuilder,
@ -206,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();
@ -299,6 +315,8 @@ public m_investmentType = [];
getPdSupplierFormDetails() {
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '4').subscribe(
data => {
console.log(data);
console.log(data.records);
if (data) {
if (data.dataStatus) {
this.formLoadData(data.records);
@ -314,6 +332,7 @@ public m_investmentType = [];
}
formLoadData(val) {
console.log(val);
if (val !== null) {
let value = val;
this._assetsQuesFrom = this._formBuilder.group({
@ -335,7 +354,7 @@ public m_investmentType = [];
this.initDetails(),
]),
business_assets_details : this._formBuilder.array([
this.initBusinessDetails(this.businessProfessionName),
this.initBusinessDetails(),
]),
assets_form_remark:['']
});
@ -359,7 +378,7 @@ public m_investmentType = [];
name_of_the_owner: [''],
other_owner:[''],
relation: [''],
//purchase_year: [''],
purchase_year: ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
//purchase_month: [''],
emi: [''],
emi_paid: [''],
@ -369,15 +388,15 @@ 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: [''],
business_purchase_year: ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
//purchase_month: [''],
business_emi: [''],
business_emi_paid: [''],
@ -389,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;
@ -538,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:['']
});
}
@ -624,7 +639,7 @@ public m_investmentType = [];
name_of_the_owner: [data.name_of_the_owner],
other_owner:[data.other_owner || ''],
relation: [data.relation || ''],
// purchase_year: [data.purchase_year],
purchase_year: [data.purchase_year],
// purchase_month: [data.purchase_month],
emi: [data.emi || 0],
emi_paid: [data.emi_paid || ''],
@ -635,6 +650,7 @@ public m_investmentType = [];
}
initBusinessDetailsWithdata(data) {
return this._formBuilder.group({
business_assets_mode: [data.business_assets_mode],
business_details: this._formBuilder.array([]),
@ -642,7 +658,7 @@ public m_investmentType = [];
business_name_of_the_owner: [data.business_name_of_the_owner],
// other_owner:[data.other_owner || ''],
// relation: [data.relation || ''],
// purchase_year: [data.purchase_year],
business_purchase_year: [data. business_purchase_year],
// purchase_month: [data.purchase_month],
business_emi: [data.business_emi || 0],
business_emi_paid: [data.business_emi_paid || ''],
@ -654,10 +670,16 @@ public m_investmentType = [];
loadDetails: boolean;
addAssetsDetailsWithData(supp_data) {
console.log(supp_data);
//console.log(supp_data);
var result = Object.keys(supp_data).map(function (key) {
return supp_data[key];
});
result.forEach((datas,index) => {
this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.approximate_market_value);
this.OtherEmiAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.emi_paid);
});
if (result.length > 0) {
for (let val of result) {
let vals = {
@ -666,7 +688,7 @@ public m_investmentType = [];
name_of_the_owner: val.name_of_the_owner,
other_owner:val.other_owner,
relation: val.relation,
// purchase_year: val.purchase_year,
purchase_year: val.purchase_year,
// purchase_month: val.purchase_month,
emi: val.emi,
emi_paid: val.emi_paid,
@ -684,12 +706,16 @@ public m_investmentType = [];
addBusinessAssetsDetailsWithData(supp_data) {
console.log(supp_data);
var result = Object.keys(supp_data).map(function (key) {
return supp_data[key];
});
if (result.length > 0) {
result.forEach((datas,index) => {
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.business_approximate_market_value);
this.emiAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.business_emi_paid);
});
for (let val of result) {
let vals = {
business_assets_mode: val.business_assets_mode,
@ -697,7 +723,7 @@ public m_investmentType = [];
business_name_of_the_owner: val.business_name_of_the_owner,
// other_owner: val.other_owner,
// relation : val.relation,
// purchase_year: val.purchase_year,
business_purchase_year: val. business_purchase_year,
// purchase_month: val.purchase_month,
business_emi: val.business_emi,
business_emi_paid: val.business_emi_paid,
@ -706,10 +732,6 @@ public m_investmentType = [];
business_balance_tenure: val.business_balance_tenure
};
// const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
// control.push(this.initDetailsWithdata(vals));
// this.setAssetsDetailsWithData(vals.business_assets_mode, val.details, control.length - 1)
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
control.push(this.initBusinessDetailsWithdata(vals));
this.setBusinessAssetsDetailsWithData(vals.business_assets_mode, val.business_details, control.length - 1)
@ -720,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': {
@ -750,23 +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) => {
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: {
@ -776,48 +848,97 @@ public m_investmentType = [];
}
setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
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: {
@ -835,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());
}
}
@ -875,6 +996,7 @@ public m_investmentType = [];
/** To Save/Edited Popup Data */
onSubmit() {
console.log(this._assetsQuesFrom.value);
this.submitted = true;
// stop here if form is invalid
@ -903,7 +1025,7 @@ public m_investmentType = [];
val.business_elapsed_tenure = '';
}
});
console.log(answerFormValues);
// Save the data with help of Service
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {
@ -979,8 +1101,38 @@ inWords(e,i,flag){
case 4 :
this.OtherEmiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 5 :
this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 6 :
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 7 :
this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 8 :
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 9 :
this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 10 :
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 11 :
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 12 :
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 13:
this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 14:
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}
}

View File

@ -95,7 +95,7 @@
</mat-panel-title>
</mat-expansion-panel-header>
<mat-form-field>
<mat-select placeholder="Applicant Name" formControlName="applicant_name" required (selectionChange)="selectedBorrower($event.value,i)">
<mat-select placeholder="Applicant Name" formControlName="applicant_name" (selectionChange)="selectedBorrower($event.value,i)">
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
</mat-select>
</mat-form-field>
@ -106,14 +106,14 @@
<!-- <mat-form-field>
<input matInput placeholder="Applicant Name"
formControlName="applicant_name" required>
formControlName="applicant_name">
</mat-form-field> -->
<!-- <mat-form-field>
<input matInput placeholder="Bank Name" formControlName="bank_name" required>
<input matInput placeholder="Bank Name" formControlName="bank_name" >
</mat-form-field> -->
<mat-form-field>
<mat-select placeholder="Bank Name" formControlName="bank_name" required>
<mat-select placeholder="Bank Name" formControlName="bank_name" >
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select>
</mat-form-field>
@ -124,7 +124,7 @@
<mat-form-field>
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)" placeholder="Account Type" formControlName="account_type" required >
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)" placeholder="Account Type" formControlName="account_type" >
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
<!--<mat-select placeholder="Account Type"
@ -139,7 +139,7 @@
<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<mat-select placeholder="Is this the main business account"
formControlName="is_main" required>
formControlName="is_main" >
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
@ -148,7 +148,7 @@
<div fxLayout="row" fxLayoutAlign="start none">
<mat-form-field style="width: 35%;" *ngIf="salaryField">
<mat-select placeholder="Salary Credited in this account"
formControlName="salary" required>
formControlName="salary" >
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
<mat-option value="NA">NA</mat-option>
@ -163,17 +163,17 @@
</div>
<!-- <mat-form-field>
<input matInput placeholder="Approximate Vintage"
formControlName="vintage" required>
formControlName="vintage" >
</mat-form-field>-->
<div>
<label>Number of Years / Months since account was started</label>
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="vintage_year" required (keypress)="keyPress($event)">
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="vintage_year" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="vintage_month" required (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(itemrow,$event.target.value)">
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="vintage_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(itemrow,$event.target.value)">
</mat-form-field>
</div>
</div>
@ -294,7 +294,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="banking_form_remark" required></textarea>
<textarea matInput placeholder="Remarks" formControlName="banking_form_remark" ></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">

View File

@ -149,20 +149,20 @@ export class BankingDetailsComponent implements OnInit {
createBankarray() {
return this.fb.group({
applicant_name: ['', Validators.compose([Validators.required])],
applicant_name: [''],
other_applicant : [''],
bank_name: ['', Validators.compose([Validators.required])],
bank_name: [''],
other_bank: [''],
account_type: ['', Validators.compose([Validators.required])],
//salary: ['', Validators.compose([Validators.required])],
salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : ['', Validators.compose([Validators.required])],
limit: ['', Validators.compose([Validators.required])],
//is_main: ['', Validators.compose([Validators.required])],
//is_main: [this.pd_cus_segment == 'SAL' ? '' : '', Validators.compose([Validators.required])],
account_type: [''],
//salary: [''],
salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : [''],
limit: [''],
//is_main: [''],
//is_main: [this.pd_cus_segment == 'SAL' ? '' : ''],
//is_main:[''],
is_main: this.pd_cus_segment == 'SAL' ? [''] : ['', Validators.compose([Validators.required])],
vintage_year: ['', Validators.compose([Validators.required])],
vintage_month: ['', Validators.compose([Validators.required])],
is_main: this.pd_cus_segment == 'SAL' ? [''] : [''],
vintage_year: [''],
vintage_month: [''],
});
}
@ -190,9 +190,6 @@ export class BankingDetailsComponent implements OnInit {
}
bankSubmit() {
if (!this.bankingForm.valid) {
return;
}
let records: any = {};
records.pdid = this.pdid;
records.formid = '7';

View File

@ -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}}</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>

View File

@ -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);
}
}

View File

@ -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();
});
});

View File

@ -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 Information";
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();
});
}
}
}

View File

@ -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}}</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'">
@ -37,7 +37,7 @@
<mat-form-field style="width: 45%;">
<mat-select placeholder="Business Entity Type"
formControlName="business_entity_type" required>
<mat-option [value]="entity.business_entity_type_id" *ngFor="let entity of businessEntityTypeList">{{entity.business_entity_type_name | titlecase}}</mat-option>
<mat-option [value]="entity.business_entity_type_id" *ngFor="let entity of businessEntityTypeList">{{entity.business_entity_type_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.business_entity_type.value=='11'">
@ -102,24 +102,35 @@
[formGroupName]="i">
<mat-card-content>
<mat-form-field style="width: 45%;">
<input matInput placeholder="Name"
formControlName="partner_name" required>
<mat-select placeholder="Name" formControlName="partner_name" style="width: 90%;" (selectionChange)="changePartnerGroup(members.value.partner_name,i)" required>
<mat-option *ngFor="let app_par of applicants" [value]="app_par.applicant_name">{{app_par.applicant_name | titlecase}}</mat-option>
<mat-option value="Others">Others</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%;">
<mat-form-field style="width: 45%;" *ngIf="members.value.partner_name=='Others'">
<input matInput placeholder="Specify Others"
formControlName="partner_other_name" required>
</mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.business_entity_type.value!='3' && businessForm.controls.business_entity_type.value!='8' && businessForm.controls.business_entity_type.value!=''">
<input matInput placeholder="Share of Profit / Shareholding (%)" (keypress)="keyPress($event)"
formControlName="shareholding" required>
formControlName="shareholding">
</mat-form-field>
<p style="padding-left: 2% !important">No of Years in Current Business</p>
<mat-form-field style="width: 20%;">
<input matInput type="number" placeholder="Year" formControlName="current_business_experiance_year" required min='0'>
<input matInput type="number" placeholder="Year" formControlName="current_business_experiance_year" (keyup)="getWorkExperience(members.value,i)" required min='0'>
</mat-form-field>
<mat-form-field style="width: 21%;">
<input matInput type="number" placeholder="Month" formControlName="current_business_experiance_month" required min='0' max='12'>
</mat-form-field>
<mat-form-field style="width: 35%;">
<input matInput placeholder="Total Business Experience"
formControlName="total_business_experiance" required>
<input matInput type="number" placeholder="Total Work Experience"
formControlName="total_business_experiance" (keyup)="getWorkExperience(members.value,i)" required>
</mat-form-field>
<mat-form-field style="width: 82%;" *ngIf="members.value.total_business_previous_experience!=undefined">
<input matInput placeholder="Previous Work Experience Details"
formControlName="total_business_previous_experience" required>
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addPartnerDetails()"
matTooltip="Add More" matTooltipPosition="above" color="primary" *ngIf="i==0">
<mat-icon>add</mat-icon>
@ -280,8 +291,8 @@
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<!-- this is for other than pan india -->
<div fxFlex="100" *ngIf="manufacturing.value.pan_india_options=='No'">
<mat-form-field style="width:35%;">
<div class="state-margin" fxFlex="100" *ngIf="manufacturing.value.pan_india_options=='No'">
<mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
@ -331,7 +342,13 @@
<div fxLayout="row nowrap" *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
{{country}}
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
@ -361,8 +378,8 @@
</mat-form-field>
</div>
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<div class="state-margin" fxLayout="row nowrap" *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
@ -408,7 +425,12 @@
<mat-tab label="Export" formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
@ -435,8 +457,8 @@
</mat-card-content>
<mat-card-actions>
<mat-form-field style="width: 92%">
<mat-label>Description of Manufacturing</mat-label>
<textarea matInput placeholder="Description of Manufacturing" formControlName="description"></textarea>
<mat-label>Description of Manufacturing Product</mat-label>
<textarea matInput placeholder="Description of Manufacturing Product" formControlName="description"></textarea>
</mat-form-field>
</mat-card-actions>
</mat-card>
@ -475,9 +497,8 @@
</mat-form-field>
<ng-container *ngIf="retail.value.india_where_sale_done !=undefined && retail.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<div class="state-margin" fxLayout="row nowrap" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
@ -527,7 +548,12 @@
<div fxLayout="row nowrap" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
@ -558,8 +584,8 @@
</mat-form-field>
</div>
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<div fxLayout="row nowrap" class="state-margin" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
@ -606,7 +632,12 @@
<mat-tab label="Export" formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
@ -634,8 +665,8 @@
</mat-card-content>
<mat-card-actions>
<mat-form-field style="width: 92%">
<mat-label>Description of Retail Trading</mat-label>
<textarea matInput placeholder="Description of Retail Trading" formControlName="description"></textarea>
<mat-label>Description of Retail Trading Product</mat-label>
<textarea matInput placeholder="Description of Retail Trading Product" formControlName="description"></textarea>
</mat-form-field>
</mat-card-actions>
</mat-card>
@ -674,9 +705,9 @@
</mat-form-field>
<ng-container *ngIf="wholesale.value.india_where_sale_done !=undefined && wholesale.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<div class="state-margin" fxLayout="row nowrap" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
@ -726,7 +757,12 @@
<div fxLayout="row nowrap" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
@ -756,8 +792,8 @@
</mat-form-field>
</div>
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<div fxLayout="row nowrap" class="state-margin" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:34%;">
<mat-select placeholder="State" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
@ -803,7 +839,12 @@
<mat-tab label="Export" formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" >
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
@ -831,8 +872,8 @@
</mat-card-content>
<mat-card-actions>
<mat-form-field style="width: 92%">
<mat-label>Description of Wholesale Trade</mat-label>
<textarea matInput placeholder="Description of Wholesale Trade" formControlName="description"></textarea>
<mat-label>Description of Wholesale Trade Product</mat-label>
<textarea matInput placeholder="Description of Wholesale Trade Product" formControlName="description"></textarea>
</mat-form-field>
</mat-card-actions>
</mat-card>
@ -871,9 +912,9 @@
</mat-form-field>
<ng-container *ngIf="serviceprovider.value.india_where_sale_done !=undefined && serviceprovider.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<div class="state-margin" fxLayout="row nowrap" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<mat-form-field style="width:34%;">
<mat-select placeholder="Where, In India, Is The Service Provided" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
@ -923,7 +964,12 @@
<div fxLayout="row nowrap" *ngFor="let countryList of serviceprovider.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<input matInput placeholder="Countries Where Services Are Being Exported" formControlName="country_name" >
<!-- <input matInput placeholder="Countries Where Services Are Being Exported" formControlName="country_name" > -->
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Revenue From Service" formControlName="approx_sale" required>
@ -953,8 +999,8 @@
</mat-form-field>
</div>
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<div fxLayout="row nowrap" class="state-margin" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:34%;">
<mat-select placeholder="Where, In India, Is The Service Provided" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
{{SL.state_name}}
@ -1002,7 +1048,12 @@
<mat-tab label="Export" formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let countryList of serviceprovider.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<input matInput placeholder="Countries Where Services Are Being Exported" formControlName="country_name" >
<!-- <input matInput placeholder="Countries Where Services Are Being Exported" formControlName="country_name" > -->
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
{{CL.country_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Revenue From Service" formControlName="approx_sale" required>
@ -1067,39 +1118,8 @@
</mat-card-actions>
</mat-card>
<mat-card>
<mat-card-title>Seasonality</mat-card-title>
<mat-card-content>
<div fxLayout="row nowrap">
<mat-form-field style="width: 60%">
<mat-select placeholder="Either Currently Running The Business / Are Loan Applicants"
formControlName="main_person" required>
<!-- <mat-option value="applicants">One of the applicants</mat-option> -->
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
<mat-option value="Relative">Relative of An Applicant</mat-option>
<mat-option value="Others">Others</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 28%" *ngIf="businessForm.controls['main_person'].value == 'Others'">
<input matInput placeholder="Specify other person"
formControlName="other_main_person">
</mat-form-field>
</div>
<div fxLayout="row nowrap">
<mat-form-field style="width: 60%">
<mat-select placeholder="Were They Involved In Any Other Business Before Starting This Business"
formControlName="before_business" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayout="row nowrap">
<mat-form-field style="width: 60%" *ngIf="businessForm.controls['before_business'].value == 'yes'">
<textarea matInput placeholder="Description For Before Starting This Business"
formControlName="before_business_description"></textarea>
</mat-form-field>
</div>
<div fxLayout="row wrap">
<mat-form-field style="width: 28%">
<!-- <input matInput placeholder="Seasonality" formControlName="seasonality" required> -->
@ -1127,7 +1147,6 @@
</mat-select>
</mat-form-field>
</div>
<div fxLayout="row nowrap" *ngIf="businessForm.controls['seasonality'].value == 'yes'">
<mat-form-field style="width: 60%">
@ -1165,7 +1184,7 @@
</mat-card>
<mat-card>
<mat-card-header>
<mat-card-title>No of Employees Sighted Ny PD Officer During His Visit </mat-card-title>
<mat-card-title>No of Employees Sighted By PD Officer During His Visit </mat-card-title>
</mat-card-header>
<mat-card-content class="matcard">
<mat-form-field>
@ -1435,7 +1454,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="business_remarks" required></textarea>
<textarea matInput placeholder="Remarks" formControlName="business_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">

View File

@ -137,4 +137,7 @@ mat-header-cell mat-cell {
.tab_class {
margin-top: 3%;
}
.state-margin {
margin-left: 2%;
}

View File

@ -32,13 +32,17 @@ 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 = [];
activityData: any = [];
stateList: any = [];
countryDataList : any = [];
relativeNames: any;
applicants: any;
public businessForm: FormGroup;
@ -46,6 +50,7 @@ export class BusinessInfoComponent implements OnInit {
existCompanyList: any = [];
// businessEntityTypeList: any=["Private Limited Company","Proprietorship","Partnership","Limited Liability Partnership (LLP)","One Person Company (OPC)","Hindu Undivided Family (HUF)","Society","Cooperative","Trust","Public Ltd Company","Others"]
businessEntityTypeList: any =[];
filterCityList : any = [];
// this is for automatic bind entitity name for display
//sourceNames: any = {"Private Limited Company": 'Director / Shareholder Details',"Proprietorship": 'Proprietor Details', "Sole Proprietorship": 'Proprietor Details',"Partnership": 'Partner Details',"Limited Liability Partnership (LLP)": 'Partner Details',"One Person Company (OPC)": 'Director Details',"Hindu Undivided Family (HUF)": 'Karta Details',"Society": 'Member Details',"Cooperative": 'Member Details',"Trust": 'Trustee Details',"Public Ltd Company": 'Director / Shareholder Details','Individual':'Self',"Others": 'Other Enitity Details'};
sourceNames: {[k: string]: any} = {};
@ -60,6 +65,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;
@ -92,6 +99,7 @@ export class BusinessInfoComponent implements OnInit {
//this.getIndustry();
this.getActivity();
this.getStateCityList();
this.getCountryDataList();
this.initBusinessForm();
this.getCompanyRelation();
this.getCompanyListForBusiness();
@ -101,11 +109,12 @@ 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;
//const Desgn = <FormArray>this.businessForm.controls['designation'];
const Partnr = <FormArray>this.businessForm.controls['partners'];
const Partnr: any = <FormArray>this.businessForm.controls['partners'];
const otherDoc = <FormArray>this.businessForm.controls['documents'];
const personRel = <FormArray>this.businessForm.controls['persons_with_relationships'];
const businessActivityControl = <FormArray>this.businessForm.controls['select_business_activity_type'];
@ -114,9 +123,6 @@ export class BusinessInfoComponent implements OnInit {
const wholesaleControl: any = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
const serviceProviderControl: any = <FormArray>this.businessForm.controls['service_provider_activity_details'];
const othersControl: any = <FormArray>this.businessForm.controls['others_activity_details'];
if (data.status == 200) {
let DocArray: any;
// let DesgnArray = Object.keys(data.records.designation).map(function (key) {
@ -137,8 +143,17 @@ export class BusinessInfoComponent implements OnInit {
if (PartnrArray.length == 0) {
Partnr.push(this.createPartners());
} else {
PartnrArray.forEach(datas => {
PartnrArray.forEach((datas,key) => {
Partnr.push(this.createPartners());
if(datas.partner_name=='Others') {
Partnr.controls[key].addControl('partner_other_name', new FormControl('', Validators.required))
}
if(parseInt(datas.total_business_experiance) > parseInt(datas.current_business_experiance_year)) {
Partnr.controls[key].addControl('total_business_previous_experience', new FormControl('', Validators.required))
}
else {
Partnr.controls[key].removeControl('total_business_previous_experience')
}
});
}
if (data.records.other_documents == 'yes') {
@ -163,6 +178,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;
@ -349,7 +365,6 @@ export class BusinessInfoComponent implements OnInit {
}
else {
businessVal.retail_trading_activity_details=[];
}
// update whole sale details
@ -562,8 +577,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])],
@ -595,11 +611,7 @@ export class BusinessInfoComponent implements OnInit {
esic_regn: ['', Validators.compose([Validators.required])],
other_documents: ['', Validators.compose([Validators.required])],
documents: this.fb.array([]),
business_remarks: ['', Validators.compose([Validators.required])],
main_person: ['', Validators.compose([Validators.required])],
other_main_person: [''],
before_business: ['', Validators.compose([Validators.required])],
before_business_description: [''],
business_remarks: [''],
//any_delays: ['', Validators.compose([Validators.required])],
persons_with_relationships:this.fb.array([]),
select_business_activity_type: this.fb.array([]),
@ -863,7 +875,7 @@ export class BusinessInfoComponent implements OnInit {
createPartners(): FormGroup {
return this.fb.group({
partner_name: ['', Validators.compose([Validators.required])],
shareholding: ['', Validators.compose([Validators.required])],
shareholding: [''],
current_business_experiance_year: ['', Validators.compose([Validators.required])],
current_business_experiance_month: ['', Validators.compose([Validators.required])],
total_business_experiance: ['', Validators.compose([Validators.required])],
@ -1098,6 +1110,18 @@ export class BusinessInfoComponent implements OnInit {
});
}
getCountryDataList(){
let master_name = 'COUNTRY';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
data.records.forEach(val => {
if (val.isactive == 1) {
this.countryDataList.push(val);
console.log(this.countryDataList);
}
})
});
}
// add and create person with relationship details
createPersonRelationhip(details: any):FormGroup {
return this.fb.group({
@ -1167,13 +1191,57 @@ export class BusinessInfoComponent implements OnInit {
let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
othersControl.push(this.createOthersActivity());
}
// update partner group other form control
changePartnerGroup(value,key) {
let control: any = this.businessForm.get('partners') as FormArray;
value=='Others' ? control.controls[key].addControl('partner_other_name', new FormControl('', Validators.required)) : control.controls[key].removeControl('partner_other_name');
}
// get work experience based on create form control
getWorkExperience(event, key) {
let current_experience = event.current_business_experiance_year=='' ? 0 : parseInt(event.current_business_experiance_year);
let total_experience = event.total_business_experiance=='' ? 0 : parseInt(event.total_business_experiance);
let control: any = this.businessForm.get('partners') as FormArray;
if(total_experience > current_experience) {
control.controls[key].addControl('total_business_previous_experience', new FormControl('', Validators.required))
}
else if(total_experience < current_experience) {
control.controls[key].controls['total_business_experiance'].setValue(current_experience);
control.controls[key].removeControl('total_business_previous_experience')
}
else {
control.controls[key].removeControl('total_business_previous_experience')
}
}
/**
* This Function For validate For Appx. sale based on Type OF Activities
*/
// validateAppxSales(records){
// //console.log(records.manufacturing_activity_details.length);
// //this Variable For Validation
// }
submitDetails() {
// let family: any = [];
console.log(this.businessForm.value);
if (!this.businessForm.valid) {
//console.log(' Requried validation error');
return;
}
// let design: any;
let records = this.businessForm.value;
//to check the Appx. sale validation.
// this.validateAppxSales(records);
if (records.other_documents == 'no') {
delete records.documents;
}
@ -1183,6 +1251,86 @@ export class BusinessInfoComponent implements OnInit {
if (records.ownership_others == '') {
delete records.ownership_others;
}
let validationFlag : number = 0;
//type 1: Checking manufacturing_activity_details
if(records.manufacturing_activity_details.length > 0){
records.manufacturing_activity_details.forEach((val,index) => {
if(val.area_of_sale!= "Within India"){
let ManufacturingArray = Object.keys(val.countries_where_export_done).map(function (key) {
return val.countries_where_export_done[key];
});
let total = ManufacturingArray.reduce((sum, item) => sum + +item.approx_sale, 0);
if(total > 100 || total < 100){
validationFlag++;
}
}
});
}
//type 3 checking wholesale_trading_activity_details
if(records.wholesale_trading_activity_details.length > 0){
records.wholesale_trading_activity_details.forEach((val,index) => {
if(val.area_of_sale != "Within India"){
let WholesaleTradingArray = Object.keys(val.countries_where_export_done).map(function (key) {
return val.countries_where_export_done[key];
});
let total = WholesaleTradingArray.reduce((sum, item) => sum + +item.approx_sale, 0);
if(total > 100 || total < 100){
validationFlag++;
}
}
});
}
//type 2 checking retail_trading_activity_details
if(records.retail_trading_activity_details.length > 0){
records.retail_trading_activity_details.forEach((val,index) => {
if(val.area_of_sale != "Within India"){
let RetailTradingArray = Object.keys(val.countries_where_export_done).map(function (key) {
return val.countries_where_export_done[key];
});
let total = RetailTradingArray.reduce((sum, item) => sum + +item.approx_sale, 0);
if(total > 100 || total < 100){
validationFlag++;
}
}
});
}
//type 4 checking service_provider_activity_details
if(records.service_provider_activity_details.length > 0){
records.service_provider_activity_details.forEach((val,index) => {
if(val.area_of_sale != "Within India"){
let ServiceProviderArray = Object.keys(val.countries_where_export_done).map(function (key) {
return val.countries_where_export_done[key];
});
let total = ServiceProviderArray.reduce((sum, item) => sum + +item.approx_sale, 0);
if(total > 100 || total < 100){
validationFlag++;
}
}
});
}
//validationFlag is greater then 0 means its display the notifer as warning
if(validationFlag > 0){
this.notifier.notify('warning',"Approximate sales doesn't add upto 100%");
return;
}
records.select_business_activity_type = records.select_business_activity_type.filter(value=>value.exist_status==1);
this._pd.saveForm(records).subscribe(data => {
@ -1238,6 +1386,7 @@ export class BusinessInfoComponent implements OnInit {
// filter max sale options
filterMaxSaleState(datasource: any,filterValues:any){
this.filterCityList = filterValues;
if(filterValues){
let getOriginalStateList = datasource.map(dval => dval.state_id);
let getStateValues = filterValues.filter(val =>val.state_name).map(mapVal => mapVal.state_name);
@ -1249,24 +1398,48 @@ export class BusinessInfoComponent implements OnInit {
return setStateFilter.length > 0 ? setStateFilter : [];
}
}
// filter max sale cities options
filterMaxSaleCities(datasource: any,filterValues:any) {
filterMaxSaleCities(datasource: any,filterValues:any) {
// console.log('Whole State data',datasource); // Whole State data
// console.log('Filtered state id',filterValues); // Filtered state id
if(filterValues){
let getOriginalStateList = datasource.map(dval => dval.state_id);
// console.log('Whole State id from Datasources',getOriginalStateList)//Whole State id from Datasources
let setCityFilter = filterValues.map(x => {
let findIndex = getOriginalStateList.indexOf(x);
findIndex = datasource[findIndex].cities;
return findIndex;
});
// console.log('Filtered City Array Based on State Wise',setCityFilter)//Filtered City Array
// console.log('Previous filtered City id List ',this.filterCityList);
let merged = [].concat.apply([], setCityFilter);
let getFilteredCityValues = [].concat.apply([],this.filterCityList.filter(val =>val.city_name).map(mapVal => mapVal.city_name));
let getOriginalCityList = merged.map(dval => dval.city_id);
let Filter: any=[];
Filter = getFilteredCityValues.map(x => {
let findIndex = getOriginalCityList.indexOf(x);
findIndex = merged[findIndex];
// console.log('findIndex',findIndex);
//return findIndex.filter(x => x !== undefined);
});
Filter = getFilteredCityValues.filter(x => x !== undefined);
return merged.length > 0 ? merged : [];
//return Filter.length > 0 ? Filter : [];
}
}
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);
}
})
}

View File

@ -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)]),

View File

@ -20,7 +20,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="final_form_remarks"></textarea>
<textarea matInput placeholder="Remarks" formControlName="final_form_remarks" required></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">

View File

@ -55,7 +55,7 @@ export class FinalRemarksComponent implements OnInit {
pdid: [this.pdid],
formid: ['20'],
final_custormer_remark_type : [],
final_form_remarks: []
final_form_remarks: ['',Validators.required]
});
this.getM_Type();
}

View File

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

View File

@ -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'];
@ -97,6 +100,7 @@ export class FinancialInfoComponent implements OnInit {
return value.records.estimated_value[key];
});
if (result.length > 0) {
this.customerCommentsFlag = result.length == 1 ? false : true;
result.forEach((val,index) => {
//financial_date.push(this.createDate());
this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale);
@ -110,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);
@ -124,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 {
@ -136,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)])],
@ -247,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;
@ -260,7 +264,6 @@ export class FinancialInfoComponent implements OnInit {
}
if(array.length > 0 ){
console.log(array.length);
array.value.forEach((val,index)=>{
let vals = {
@ -325,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);
}
}
@ -362,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)) ;
@ -395,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);
@ -437,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;
@ -499,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;
@ -521,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;
@ -534,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));
@ -588,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;
@ -682,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 => {
@ -715,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 :

View File

@ -58,16 +58,16 @@
<!-- companies start -->
<mat-card>
<mat-card-header>
<mat-card-title>Companies</mat-card-title>
<mat-card-title>Company/Firm</mat-card-title>
</mat-card-header>
<mat-card-content>
<div fxLayout="row wrap" formArrayName="companies">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" *ngFor="let com of _generalForm.controls.companies['controls']; let c = index;" [formGroupName]="c">
<mat-form-field style="width: 60%">
<mat-form-field style="width: 60%" *ngIf="com.value.is_active==true">
<input matInput placeholder="Company/Firm" formControlName="company_name" type="text">
</mat-form-field>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Company/Firm" matTooltipPosition="above" color="primary" (click)="addMoreCompanies()" *ngIf="c==0"><mat-icon>add</mat-icon></button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanies(c)" *ngIf="c>0"
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanies(c)" *ngIf="c>0 && com.value.is_active==true"
matTooltip="Remove Company/Firm" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
@ -77,8 +77,126 @@
</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 | json}} -->
<!-- <input type="hidden" [value]="delivery_extry" /> -->
{{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}}
</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>
@ -90,15 +208,15 @@
<div *ngFor="let mulRel of relation.get('multiple_relation').controls; let m = index" [formGroupName]="m">
<div fxLayout="row nowrap">
<mat-form-field style="width: 40%">
<mat-select placeholder="Relation to" formControlName="applicant_relation_to">
<mat-select placeholder="Relation to" formControlName="applicant_relation_to" (selectionChange)="selectedApplicant($event,relation.controls.applicant_name.value)">
<mat-option>Select</mat-option>
<mat-option *ngFor="let rel of individualsList" [value]="rel.individuals_order_id">
<!-- [disabled]="relation.controls.applicant_name.value == rel" -->
<mat-option *ngFor="let rel of individualsList" [value]="rel.individuals_order_id" [disabled]="relation.controls.applicant_name.value == rel.applicant_name">
{{rel.applicant_name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-form-field style="width: 20%">
<!--[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">
@ -106,6 +224,9 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:20%" *ngIf="mulRel.get('relationship').value == 0">
<input matInput autocomplete="off" placeholder="Specify Relation" formControlName="other_relationship">
</mat-form-field>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Personal Relationship" matTooltipPosition="above" color="primary" (click)="addMoreRelation(r,m)" *ngIf="m==0"><mat-icon>add</mat-icon></button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeRelation(r,m)" *ngIf="m>0"
matTooltip="Remove Personal Relationship" matTooltipPosition="above">
@ -114,8 +235,8 @@
</div>
</div>
</div>
<p>Company 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%">
@ -125,8 +246,8 @@
{{comp.company_name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%">
</mat-form-field>
<mat-form-field style="width: 20%">
<mat-select placeholder="Relation" formControlName="company_relationship">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">
@ -134,6 +255,9 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:20%" *ngIf="comRel.get('company_relationship').value == 6">
<input matInput autocomplete="off" placeholder="Specify Relation" formControlName="company_other_relationship">
</mat-form-field>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Company Relationship" matTooltipPosition="above" color="primary" (click)="addMoreCompanyRelation(r,c)" *ngIf="c==0"><mat-icon>add</mat-icon></button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanyRelation(r,c)" *ngIf="c>0"
matTooltip="Remove Company Relationship" matTooltipPosition="above">
@ -144,14 +268,14 @@
</mat-card-content>
</mat-card>
</div>
</div>
</div> -->
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="general_remark" required></textarea>
<textarea matInput placeholder="Remarks" formControlName="general_remark"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">

View File

@ -4,6 +4,8 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , MatTableDataSource} from '@a
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
import {OtherApplicantDetailsComponent} from './../dialogue/other-applicant-details/other-applicant-details.component';
import { element } from '@angular/core/src/render3/instructions';
import { ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser/src/dom/debug/ng_probe';
@Component({
selector: 'app-general-info',
templateUrl: './general-info.component.html',
@ -13,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=[];
@ -47,8 +55,21 @@ export class GeneralInfoComponent implements OnInit {
// update company details
this._generalForm.controls['companies'].valueChanges.subscribe(val=>{
let control = <FormArray>this._generalForm.controls['companies'];
this.companyList = control.value.filter(element =>element.company_name);
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
@ -56,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
@ -70,9 +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':'Not Applicable'});
}
if(type==2){
this.companyRelationShipList=data.records.filter(item => item.isactive == 1);
this.companyRelationShipList=data.records.filter(item => item.name != 'Others');
}
}
@ -86,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 : '');
@ -107,63 +138,90 @@ 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];
});
if(exist_companies.length>0){
exist_companies.forEach(element => {
companyControl.push(this.createCompanies(element))
exist_companies.forEach((element,cindex) => {
companyControl.push(this.createCompanies(element));
if(element.is_active==false){
let control: any = this._generalForm.get('companies') as FormArray;
control.controls[cindex].controls.company_name.clearValidators();
control.controls[cindex].controls.company_name.updateValueAndValidity();
}
});
}
// 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){
let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:element.company_name}
let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:element.company_name,is_active:true}
companyControl.push(this.createCompanies(setCompanyValues))
}
});
// check company if null update one row
if(companyControl.controls.length ==0){
let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:''}
let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:'',is_active:true}
companyControl.push(this.createCompanies(setCompanyValues))
}
@ -178,6 +236,16 @@ 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({
pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_name: [elementValue.applicant_name],
relationship:[elementValue.relationship],
relation_to:[elementValue.relation_to],
individuals_order_id: [elementValue.individuals_order_id],
});
}
@ -185,21 +253,68 @@ export class GeneralInfoComponent implements OnInit {
createCompanies(elementValue:any) {
return this._fb.group({
company_order_id: [elementValue.company_order_id],
company_name: [elementValue.company_name,Validators.required],
company_name: [elementValue.company_name],
company_messrs_name: ['M/s'],
is_active: [elementValue.is_active]
});
}
// 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;
let setValues: any = {company_order_id :control.controls.length+1,company_name:''}
let setValues: any = {company_order_id :control.controls.length+1,company_name:'',is_active:true}
control.push(this.createCompanies(setValues))
}
// 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.removeAt(indexValues);
control.controls[indexValues].controls.is_active.setValue(false);
control.controls[indexValues].controls.company_name.clearValidators();
control.controls[indexValues].controls.company_name.updateValueAndValidity();
//control.removeAt(indexValues);
}
// create applicant form array
@ -227,6 +342,7 @@ export class GeneralInfoComponent implements OnInit {
return this._fb.group({
applicant_relation_to: [elementValue.applicant_relation_to],
relationship: [elementValue.relationship],
other_relationship:[elementValue.other_relationship]
});
}
@ -234,7 +350,7 @@ export class GeneralInfoComponent implements OnInit {
addMoreRelation(rindex,mindex) {
let control: any = this._generalForm.get('applicant_relation') as FormArray;
control = control.controls[rindex].get('multiple_relation') as FormArray;
let setValues: any = {applicant_relation_to :'',relationship:''}
let setValues: any = {applicant_relation_to :'',relationship:'',other_relationship:''}
control.push(this.createMultipleRelation(setValues))
}
@ -248,15 +364,16 @@ export class GeneralInfoComponent implements OnInit {
// create multiple company relation
createMultipleCompanyRelation(elementValue: any) {
return this._fb.group({
company_name: [elementValue.company_name,Validators.required],
company_name: [elementValue.company_name],
company_relationship: [elementValue.company_relationship],
company_other_relationship:[elementValue.company_other_relationship]
});
}
// add more company relation
addMoreCompanyRelation(rindex,cindex) {
let control: any = this._generalForm.get('applicant_relation') as FormArray;
control = control.controls[rindex].get('multiple_company_relation') as FormArray;
let setValues: any = {company_name :'',company_relationship:''}
let setValues: any = {company_name :'',company_relationship:'',company_other_relationship:''}
control.push(this.createMultipleCompanyRelation(setValues))
}
@ -269,6 +386,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%',
@ -277,17 +395,28 @@ 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':'','company_name':'','company_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= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'relationship':'','relation_to':'','individuals_order_id':element.individuals_order_id};
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))
});
}
@ -304,21 +433,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) {
@ -335,7 +469,19 @@ export class GeneralInfoComponent implements OnInit {
});
}
}
// selectedfrequency(e,i){
// switch(+e){
// case 1: this.placeholderName[i] = 'Weekly Instalment Amount'; break;
// case 2: this.placeholderName[i] = 'Daily Instalment Amount'; break;
// case 3: this.placeholderName[i] = 'Annual Instalment Amount'; break;
// case 4: this.placeholderName[i] = 'Hourly Instalment Amount'; break;
// case 5: this.placeholderName[i] = 'EMI Amount'; break;
// case 6: this.placeholderName[i] = 'Quarterly Instalment Amount'; break;
// case 7: this.placeholderName[i] = 'Halfyearly Instalment Amount'; break;
// default : this.placeholderName[i] = ''; break;
// }
// }
// validate all form group and form array fields
validateAllFormFields(formGroup: any) {

View File

@ -82,8 +82,8 @@ export class LenderRepresentativeComponent implements OnInit {
}
public initRepresentative(): void {
this.representativeForm = this.fb.group({
lender_representative_accompany: ['', Validators.compose([Validators.required])],
representative_remarks: ['', Validators.compose([Validators.required])],
lender_representative_accompany: [''],
representative_remarks: [''],
lender_representative_details: this.fb.array([]),
});
}
@ -99,8 +99,8 @@ export class LenderRepresentativeComponent implements OnInit {
}
createLRDetail() {
return this.fb.group({
lender_representative_who_accompanies : ['', Validators.compose([Validators.required])],
lender_representative_carry_loan_files: ['', Validators.compose([Validators.required])],
lender_representative_who_accompanies : [''],
lender_representative_carry_loan_files: [''],
});
}

View File

@ -20,13 +20,13 @@
<div fxLayout="row wrap">
<div fxFlex="33">
<mat-form-field style="width: 80%">
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field style="width: 80%">
<mat-select multiple (selectionChange)="endUserChange($event.value)" placeholder="What is the end use" formControlName="end_use" required>
<mat-select multiple (selectionChange)="endUserChange($event.value)" placeholder="What is the end use" formControlName="end_use" >
<mat-option *ngFor="let enduse of m_endUseofLoad" [value]="enduse.subproduct_id">{{ enduse.name }}</mat-option>
</mat-select>
<!--<mat-select multiple placeholder="What is the end use"
@ -53,7 +53,7 @@
<div fxFlex="33">
<mat-form-field style="width: 80%">
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)"
formControlName="is_transfer" required >
formControlName="is_transfer" >
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
@ -65,12 +65,12 @@
<div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
<mat-form-field style="width: 60%">
<input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
<input matInput placeholder="What is the amount for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Is there a Top Up"
formControlName="is_topup" required>
formControlName="is_topup" >
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
@ -88,7 +88,7 @@
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 60%">
<input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 30%">
@ -98,12 +98,12 @@
<div *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' ">
<mat-form-field style="width: 30%">
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" (keyup)="inWords($event,4)" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-select (selectionChange)="sourceChange($event.value)" placeholder="Source of Own Contribution" formControlName="source" required multiple>
<mat-select (selectionChange)="sourceChange($event.value)" placeholder="Source of Own Contribution" formControlName="source" multiple>
<mat-option *ngFor="let sour of m_sourceofamount" [value]="sour.id">{{ sour.name }}</mat-option>
</mat-select>
</mat-form-field>
@ -134,15 +134,15 @@
<mat-form-field style="width: 60%">
<input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" required autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} {{emiAmtInWords}} Only</mat-hint>
<input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} {{emiAmtInWords}} Only</mat-hint>
</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>
<mat-select placeholder="Type of Property" formControlName="property_type" (selectionChange)="mortage_type($event.value)" >
<mat-option *ngFor="let typeprop of m_mortageTypeProperty" [value]="typeprop.mortage_property_id">{{ typeprop.property_name }}</mat-option>
</mat-select>
</mat-form-field>
@ -169,7 +169,7 @@
</mat-form-field>
<mat-form-field>
<mat-select multiple placeholder="Name of Owner"
formControlName="owner_name" (selectionChange)="ownerNameChange($event)" required>
formControlName="owner_name" (selectionChange)="ownerNameChange($event)" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
<mat-option value="Others">Others (Please Specify)</mat-option>
</mat-select>
@ -180,15 +180,15 @@
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Status of Construction" formControlName="construction_status" required>
<mat-select placeholder="Status of Construction" formControlName="construction_status" >
<mat-option *ngFor="let status of m_statusofCunstruction" [value]="status.id">{{ status.name }}</mat-option>
</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">
@ -199,13 +199,13 @@
<mat-form-field>
<input matInput placeholder="Estimate Market Value as Per Customer"
formControlName="emv_per_customer" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" required autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{emvAmtInWords}} Only</mat-hint>
formControlName="emv_per_customer" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{emvAmtInWords}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field>
<input matInput placeholder="Value as Per Agreement"
formControlName="value_per_agreement" (keypress)="keyPress($event)" required (keyup)="inWords($event,3)">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{valAsPerAgmtInWords}} Only</mat-hint>
formControlName="value_per_agreement" (keypress)="keyPress($event)" (keyup)="inWords($event,3)">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{valAsPerAgmtInWords}} Only</mat-hint>
</mat-form-field> -->
</mat-card-content>
</mat-card>
@ -319,7 +319,7 @@
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="loandetails_remarks" required></textarea>
<textarea matInput placeholder="Remarks" formControlName="loandetails_remarks" ></textarea>
</mat-form-field>
</div>

View File

@ -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;
}
}
@ -346,11 +339,11 @@ getM_sourceofamount() {
public initloanDetailsForm(): void {
this.loanDetailsForm = this.fb.group({
loan_amount: [this.exist_loan_amt, Validators.compose([Validators.required])],
end_use: ['', Validators.compose([Validators.required])],
loan_amount: [this.exist_loan_amt],
end_use: [''],
end_use_other: [''],
is_transfer: ['', Validators.compose([Validators.required])],
//is_topup: ['', Validators.compose([Validators.required])],
is_transfer: [''],
//is_topup: [''],
is_topup: [''],
balance_transfer_amount: [''],
topup_amount: [''],
@ -362,16 +355,16 @@ getM_sourceofamount() {
other_source:[''],
personal_loan_source:[''],
//lender_name_type: [''],
emi_level: ['', Validators.compose([Validators.required])],
property_type: ['', Validators.compose([Validators.required])],
emi_level: [''],
property_type: [''],
property_type_others:[''],
owner_name: ['', Validators.compose([Validators.required])],
owner_name: [''],
other_owners_name :[''],
construction_status: ['', Validators.compose([Validators.required])],
percentage_of_construction : [''],
emv_per_customer: ['', Validators.compose([Validators.required])],
//value_per_agreement: ['', Validators.compose([Validators.required])],
loandetails_remarks: ['', Validators.compose([Validators.required])],
construction_status: [''],
//percentage_of_construction : [''],
emv_per_customer: [''],
//value_per_agreement: [''],
loandetails_remarks: [''],
});
}
// endUserChange(event) {
@ -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.!');

View File

@ -142,7 +142,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="neighbour_reference_remark" required></textarea>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="neighbour_reference_remark" ></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">

View File

@ -137,17 +137,17 @@ export class NeighbourHoodComponent implements OnInit {
let stdcode = elementValue.landline.substr(0,stdcodesearch);
let landline = elementValue.landline.substr(+stdcodesearch + 1,8);
return this._fb.group({
reference_name: [elementValue.reference_name, Validators.required],
mobile: [elementValue.mobile,Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(10)])],
reference_name: [elementValue.reference_name],
mobile: [elementValue.mobile,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])],
std_code: [stdcode,Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
location:[elementValue.location,Validators.required],
relationship_with:[elementValue.relationship_with,Validators.required],
location:[elementValue.location],
relationship_with:[elementValue.relationship_with],
others: [elementValue.others],
year_relation_applicant:[elementValue.year_relation_applicant,Validators.required],
months_relation_applicant:[elementValue.months_relation_applicant,Validators.required],
business_volume_amount:[elementValue.business_volume_amount,Validators.required],
business_volume_unit:[elementValue.business_volume_unit, Validators.required],
year_relation_applicant:[elementValue.year_relation_applicant],
months_relation_applicant:[elementValue.months_relation_applicant],
business_volume_amount:[elementValue.business_volume_amount],
business_volume_unit:[elementValue.business_volume_unit],
others_unit : [elementValue.others_unit],
reference_final_remarks:[elementValue.reference_final_remarks],
specify_final_remark : [elementValue.specify_final_remark],
@ -173,8 +173,8 @@ export class NeighbourHoodComponent implements OnInit {
// create neighbourhood form array
createNeighbourhood(elementValue:any){
return this._fb.group({
neighbourhood_name: [elementValue.neighbourhood_name, Validators.required],
do_know: [elementValue.do_know,Validators.required],
neighbourhood_name: [elementValue.neighbourhood_name],
do_know: [elementValue.do_know],
how_long_do_know: [elementValue.how_long_do_know],
is_applicant_owner: [elementValue.is_applicant_owner],
});

View File

@ -38,7 +38,7 @@
<mat-card-content class="matcard">
<mat-form-field style="width:25%">
<mat-select placeholder="Source"
formControlName="source" required>
formControlName="source">
<mat-option value="{{src.id}}" *ngFor="let src of sourceData">{{src.name}}</mat-option>
<!-- <mat-option value="rental_income">Rental Income</mat-option>
<mat-option value="interest_income">Interest Income</mat-option>
@ -54,12 +54,12 @@
</mat-form-field>
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Amount" formControlName="amount" (keypress)="keyPress($event)" required (keyup)="inWords($event,i)">
<input matInput autocomplete="off" placeholder="Amount" formControlName="amount" (keypress)="keyPress($event)" (keyup)="inWords($event,i)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('amount').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:25%">
<mat-select placeholder="Frequency" formControlName="frequency" required>
<mat-select placeholder="Frequency" formControlName="frequency">
<mat-option value="{{frq.frequency_id}}" *ngFor="let frq of frequencyData">{{frq.name}}</mat-option>
</mat-select>
</mat-form-field>
@ -198,7 +198,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="otherincome_remarks" required></textarea>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="otherincome_remarks"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">

View File

@ -112,8 +112,8 @@ public viewerOptions: any = {
}
public initOtherincomeForm(): void {
this.otherIncomeForm = this.fb.group({
other_income: ['', Validators.compose([Validators.required])],
otherincome_remarks: ['', Validators.compose([Validators.required])],
other_income: [''],
otherincome_remarks: [''],
income_details: this.fb.array([])
});
}
@ -129,10 +129,10 @@ public viewerOptions: any = {
}
createDetail() {
return this.fb.group({
source: ['', Validators.compose([Validators.required])],
source: [''],
others_source : [''],
amount: ['', Validators.compose([Validators.required])],
frequency: ['', Validators.compose([Validators.required])],
amount: [''],
frequency: [''],
others_frequency : ['']
});
}

View File

@ -305,7 +305,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
<!-- <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="personal_info_form_remark" required></textarea>
<textarea matInput placeholder="Remarks" formControlName="personal_info_form_remark" ></textarea>
</mat-form-field> -->
</div>
<div fxFlex="40" align="end">

View File

@ -108,32 +108,32 @@ export class RentalInfoComponent implements OnInit {
pdid: this.pdid,
formid: this.form_id,
fk_createdby: this.pdid,
person_met: ['', Validators.compose([Validators.required])],
property_own: ['', Validators.compose([Validators.required])],
nature_property: ['', Validators.compose([Validators.required])],
person_met: [''],
property_own: [''],
nature_property: [''],
rental_home: this._fb.array([])
});
}
createpropertyArray() {
this.propertyList = this._fb.group({
complete_add: ['', Validators.compose([Validators.required])],
area_of_property: ['', Validators.compose([Validators.required])],
structure_property: ['', Validators.compose([Validators.required])],
total_room: ['', Validators.compose([Validators.required])],
is_rent: ['', Validators.compose([Validators.required])],
complete_add: [''],
area_of_property: [''],
structure_property: [''],
total_room: [''],
is_rent: [''],
date_agreement: [''],
date_validity: [''],
rent_agreement: [''],
actual_rent: [''],
photo_areegment: [''],
bank: ['', Validators.compose([Validators.required])],
cash: ['', Validators.compose([Validators.required])],
rent_each_floor: ['', Validators.compose([Validators.required])],
total_rent: ['', Validators.compose([Validators.required])],
related_doc_owner: ['', Validators.compose([Validators.required])],
property_photographs: ['', Validators.compose([Validators.required])],
third_party_check: ['', Validators.compose([Validators.required])],
bank: [''],
cash: [''],
rent_each_floor: [''],
total_rent: [''],
related_doc_owner: [''],
property_photographs: [''],
third_party_check: [''],
details_tenants: this._fb.array([this.createTenatsArray()]),
});
return this.propertyList;
@ -141,12 +141,12 @@ export class RentalInfoComponent implements OnInit {
createTenatsArray() {
return this._fb.group({
name: ['', Validators.compose([Validators.required])],
mobile_no: ['', Validators.compose([Validators.required])],
tenants_seen: ['', Validators.compose([Validators.required])],
tenants_con_owner: ['', Validators.compose([Validators.required])],
staying_since: ['', Validators.compose([Validators.required])],
rent_paid: ['', Validators.compose([Validators.required])],
name: [''],
mobile_no: [''],
tenants_seen: [''],
tenants_con_owner: [''],
staying_since: [''],
rent_paid: [''],
});
}

View File

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

View File

@ -16,7 +16,9 @@
// background: #62B013;
// color: white;
// }
.highlight {
color: red;
}
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;

View File

@ -22,21 +22,31 @@ 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 = [];
rawmaterial : any;
M_rawValueInWords : any;
M_goodsValueInWords : any;
R_goodsValueInWords : any;
T_goodsValueInWords : any;
M_rawValueInWords : any = [];
M_financialRawValueInWords : any = [];
M_tradedGoodsValueInWords : any;
R_tradedGoodsValueInWords : any;
T_tradedGoodsValueInWords : any;
M_goodsValueInWords : any = [];
R_goodsValueInWords : any = [];
T_goodsValueInWords : any = [];
M_financialGoodsValueInWords : any = [];
R_financialGoodsValueInWords : any = [];
T_financialGoodsValueInWords : any = [];
M_tradedGoodsValueInWords : any = [];
R_tradedGoodsValueInWords : any = [];
T_tradedGoodsValueInWords : any = [];
M_financialTradedGoodsValueInWords : any = [];
R_financialTradedGoodsValueInWords : any = [];
T_financialTradedGoodsValueInWords : any = [];
rawMaterialAccess: boolean;
finishedGoodsAccess: boolean;
@ -44,12 +54,14 @@ export class StockComponent implements OnInit {
public submitted = false;
noRecordsFound: Boolean = false;
serviceProviderForm: Boolean = false;
suppliers_raw_materials : any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
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 = {
@ -82,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;
@ -109,21 +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;
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)]),
@ -131,8 +140,25 @@ 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);
if(value.status == 200){
this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials;
let manufacturing_temparr = [];
manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials;
manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods;
manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods;
this.initManufacturingDetails(manufacturing_temparr);
}
else{
let manufacturing_temparr = [];
manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials;
manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods;
manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods;
this.initManufacturingDetails(manufacturing_temparr);
}
});
// console.log(1,dataForm);
// console.log(164,dataForm.manufacturing_details);
// console.log(2,dataForm.retail_details);
@ -169,14 +195,7 @@ export class StockComponent implements OnInit {
// console.log(163,dataForm.manufacturing_details.manufacturing_raw_materials);
// console.log(164,dataForm.manufacturing_details[0]);
// console.log(164,dataForm.manufacturing_details[0].manufacturing_raw_materials);
let manufacturing_temparr = [];
manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials;
manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods;
manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods;
this.initManufacturingDetails(manufacturing_temparr);
//this.initManufacturingDetails(dataForm);
}
@ -257,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)]),
@ -264,7 +284,16 @@ export class StockComponent implements OnInit {
});
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
this.initManufacturingDetails(null);
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
if(value.status == 200){
this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials;
this.initManufacturingDetails(null);
}
else{
this.initManufacturingDetails(null);
}
});
// this.initManufacturingDetails(null);
}
let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) {
@ -292,7 +321,16 @@ export class StockComponent implements OnInit {
});
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) {
this.initManufacturingDetails(null);
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
if(value.status == 200){
this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials;
this.initManufacturingDetails(null);
}
else{
this.initManufacturingDetails(null);
}
});
}
let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) {
@ -311,7 +349,7 @@ export class StockComponent implements OnInit {
})
// this.stockForms = this.fb.group({
// stock_remarks: ['', Validators.compose([Validators.required])],
// stock_remarks: [''],
// raw_materials: this.fb.array([]),
// finished_goods: this.fb.array([]),
// traded_goods: this.fb.array([])
@ -320,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([]),
@ -378,14 +413,27 @@ tradingFormCreation(val) {
const rawMaterial = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials'];
const finishedGoods = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods'];
const tradedGoods = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods'];
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if(datas === null){
// console.log(299,'if');
if(this.suppliers_raw_materials.length > 0){
for (let val of this.suppliers_raw_materials) {
let Ref_RawMaterials : any = {'raw_name': val.manufacturing_raw_material_name,
'stock_observed':'',
'raw_quantity': '',
'raw_uom': '',
'other_uom': '',
'raw_value': '',
'rawmaterial_value': '',
'is_sufficiant_raw': '',
'rawmaterial_remarks':''};
rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
}
}
else{
rawMaterial.push(this.createRawmaterial(null));
}
finishedGoods.push(this.createGoods(null));
tradedGoods.push(this.createTradedGoods(null));
} else {
// console.log(305,'else')
// console.log(377,datas);
@ -395,6 +443,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.raw_value){
this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value);
this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value);
}
rawMaterial.push(this.createRawmaterial(val));
}
@ -407,6 +456,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.goods_value){
this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
}
finishedGoods.push(this.createGoods(val));
@ -420,6 +470,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.estimated_traded_goods_value){
this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
this.M_financialTradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val));
@ -432,21 +483,6 @@ tradingFormCreation(val) {
}
}
createRawmaterial2() {
return this.fb.group({
raw_name: ['', Validators.compose([Validators.required])],
stock_observed:['', Validators.compose([Validators.required])],
raw_quantity: [''],
raw_uom: [''],
other_uom : [''],
raw_value: [''],
rawmaterial_value: [''],
is_sufficiant_raw: [''],
rawmaterial_remarks:['']
});
}
createRawmaterial(records) {
// console.log(330,'function in');
if(records === null) {
@ -497,6 +533,7 @@ tradingFormCreation(val) {
if(val.goods_value){
this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
this.R_financialGoodsValueInWords =this._pd.convertNumberToWords(val.finished_goods_value);
}
finishedGoods.push(this.createGoods(val));
@ -512,6 +549,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.estimated_traded_goods_value){
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
this.R_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val));
@ -525,8 +563,8 @@ tradingFormCreation(val) {
createGoods2() {
return this.fb.group({
goods_name: ['', Validators.compose([Validators.required])],
goods_observed: ['', Validators.compose([Validators.required])],
goods_name: [''],
goods_observed: [''],
goods_quantity: [''],
goods_value: [''],
finished_goods_value: [''],
@ -563,8 +601,8 @@ tradingFormCreation(val) {
createTradedGoods2() {
return this.fb.group({
traded_goods_name: ['', Validators.compose([Validators.required])],
traded_goods_observed: ['', Validators.compose([Validators.required])],
traded_goods_name: [''],
traded_goods_observed: [''],
traded_goods_quantity: [''],
estimated_traded_goods_value: [''],
traded_goods_value: [''],
@ -596,6 +634,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.goods_value){
this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
this.T_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value);
}
finishedGoods.push(this.createGoods(val));
@ -610,6 +649,7 @@ tradingFormCreation(val) {
// console.log(val);
if(val.estimated_traded_goods_value){
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
this.T_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val));
}
@ -833,29 +873,50 @@ tradingFormCreation(val) {
}
/** To Convert Amount into Words */
inWords(e,flag:number){
inWords(e,flag:number,i){
switch(flag){
case 1 :
this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value);
this.M_rawValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
this.M_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 3 :
this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
this.M_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 4 :
this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
this.R_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 5 :
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
this.R_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 6 :
this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
this.T_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 7 :
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
this.T_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 8 :
this.M_financialRawValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 9 :
this.M_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 10 :
this.M_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 11 :
this.R_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 12 :
this.R_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 13 :
this.T_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 14 :
this.T_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;

View File

@ -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]

View File

@ -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">

View File

@ -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%',

View File

@ -1,84 +1,149 @@
<mat-card>
<mat-card-content>
<div class="mb-2">
<mat-card>
<mat-card-content style="background:#e00201;">
<div fxLayout="row" fxLayoutAlign="start center" class="filter-header">
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs" fxFlex="45" style="color:#fff;">
<h4>{{master.lender_full_name}} - {{master.branch_name}}</h4>
<span *ngIf="master.lender_applicant_id"> {{master.lender_applicant_id}} - </span> {{master.pd_date_of_initiation}}
</div>
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="55" style="text-align:right;">
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED"
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above"
(click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED"
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above"
(click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT && enableStartPD"
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above"
(click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
<button *ngIf="master.pd_type_name && (currentPDStatus===pdStatusCheck.QC_COMPLETED || currentPDStatus===pdStatusCheck.COMPLETED)"
mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above"
(click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above"
(click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
<br>
<!-- <span *ngIf="master.pd_allocated_to" style="color:red;text-align:left" class="fa-1x fa fa-user-secret" matTooltip="PD Officer"
matTooltipPosition="above"></span> -->
<span *ngIf="master.pd_allocated_to && master.fk_pd_type==1" style="color:#fff;text-align:left"><mat-icon class="hover-icon" matTooltip="PD Officer" matTooltipPosition="above">person</mat-icon>{{master.pd_allocated_to | titlecase}}</span>
<span *ngIf="master.executive_name && master.centralofficer && master.fk_pd_type==2" style="color:#fff;text-align:left"><mat-icon class="hover-icon" matTooltip="PD Officer" matTooltipPosition="above">person</mat-icon>{{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}}</span>
<span *ngIf="master.centralofficer && master.fk_pd_type==3" style="color:#fff;text-align:left"><mat-icon class="hover-icon" matTooltip="PD Officer" matTooltipPosition="above">person</mat-icon>{{master.centralofficer | titlecase}}</span> &nbsp;&nbsp;
<span *ngIf="master.pd_status==pdStatusCheck.SCHEDULED" style="color:#fff;text-align:left">{{master.pd_status | titlecase}} &nbsp;On&nbsp;{{master.scheduled_on}}</span>
<span *ngIf="master.pd_status!=pdStatusCheck.SCHEDULED && master.pd_status!=pdStatusCheck.QC_COMPLETED " style="color:#fff;text-align:left">{{master.pd_status | titlecase}}</span>
<span *ngIf="master.pd_status==pdStatusCheck.QC_COMPLETED " style="color:#fff;text-align:left">QC Completed</span>
</div>
</div>
</mat-card-content>
</mat-card>
<mat-card-content>
<div fxLayout="row wrap">
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<!--pd master -->
<mat-card *ngFor="let master of pdMasterData" class="minheight">
<mat-card-header>
<!-- <img mat-card-avatar src="assets/images/avatar.jpg">
<mat-card-title>{{master.lender_full_name}} - {{master.lender_applicant_id}}
</mat-card-title>-->
<mat-card-title *ngIf="master.state_name" class="hover-icon"><i class="fa-1x fa fa-map-marker"> </i> &nbsp;<span>{{master.city_name}} / {{master.state_name}}-{{master.pincode}}</span></mat-card-title>
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<!-- <button *ngIf="master.pd_type_name" mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="pdAllocationTo(master)"><mat-icon>directions_run</mat-icon></button>
<button *ngIf="master.pd_type_name" mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
-->
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)"><mat-icon>edit</mat-icon></button>
<mat-card-content>
<mat-card class="p-2 mb-2" style="height: 370px !important;">
<div fxLayout="row" fxLayoutWrap="wrap" class="mb-3">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="60" fxFlex.lg="30" fxFlex.xl="30" class="profile-center" style="text-align:center;">
<!--<div class="mb-1">
<img src="assets/images/userpic.jpg" width="100" height="100" alt="" class="radius-circle">
</div>-->
<mat-card style="padding: 15px;height: 290px;width: 280px;box-shadow: 0 5px 11px 0 rgba(0,0,0,.18), 0 4px 15px 0 rgba(0,0,0,.15) !important;">
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs">
<h4 class="ma-0">{{master.lender_short_name}}</h4>
<small>{{master.branch_name}}</small>
<div *ngIf="master.lender_applicant_id">
<small> {{master.lender_applicant_id}}</small> <br>
<small>{{master.pd_date_of_initiation}}</small><br>
<br>
<button mat-raised-button color="primary">
<span *ngIf="master.pd_status==pdStatusCheck.SCHEDULED" style="text-align:left">{{master.pd_status | titlecase}}</span>
<span *ngIf="master.pd_status!=pdStatusCheck.SCHEDULED && master.pd_status!=pdStatusCheck.QC_COMPLETED " style="text-align:left">{{master.pd_status | titlecase}}</span>
<span *ngIf="master.pd_status==pdStatusCheck.QC_COMPLETED " style="text-align:left">QC Completed</span>
</button>&nbsp;&nbsp;
<button *ngIf="master.pd_type_name && currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="editPdMaster(master)"><mat-icon>save</mat-icon></button>
<br>
<small *ngIf="master.pd_allocated_to && master.fk_pd_type==1" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.pd_allocated_to | titlecase}}</small>
<small *ngIf="master.executive_name && master.centralofficer && master.fk_pd_type==2" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}}</small>
<small *ngIf="master.centralofficer && master.fk_pd_type==3" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.centralofficer | titlecase}}<br></small>
<small *ngIf="master.pd_status==pdStatusCheck.SCHEDULED">{{master.scheduled_on}}</small>
</div>
</mat-card-header>
<mat-card-content>
<p *ngIf="master.pd_contact_person || master.pd_contact_mobileno "><span *ngIf="master.pd_contact_person"> <i class="fa-1x fa fa-user-o"></i> {{master.pd_contact_person}}</span>&nbsp;&nbsp;
<span *ngIf="master.pd_contact_mobileno"> <i class="fa-1x fa fa-phone"></i> {{master.pd_contact_mobileno}}</span>
<span style="font-size:13px;"> (Lender Contact Details) </span>
</p>
<p *ngIf="master.product_name">{{master.product_name}}<span *ngIf="master.subproduct_name"> / {{master.subproduct_name}} </span></p>
<p *ngIf="master.pd_type_name"><span>{{master.pd_type_name}}</span> <span *ngIf="master.loan_amount" class="hover-icon"> / <i class="fa-1x fa fa-rupee">&nbsp;</i>{{master.loan_amount}}</span></p>
<p><span>{{master.addressline1}}</span></p>
<p *ngIf="master.remarks"><span style="font-size:13px;"> Remarks : </span> <span style="color:red">{{master.remarks}}</span></p>
</mat-card-content>
</mat-card>
</div>
<div fxFlex.xs="100" class="m-gap p-gap" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<!-- applicant card -->
<mat-card class="minheight">
</div>
</mat-card>
<!--< <h4>John Doe</h4>
<span>johndoe@johndoe.com</span>
p class="mt-xs mb-xs">Sr. Manager</p>
<a href="javascript:;" class="block mt-xs mb-xs">www.example.com</a>
<button mat-raised-button color="primary">Edit Profile</button>-->
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="70" fxFlex.xl="70" class="content-data">
<figure>
<mat-card-content style="padding:0px !important;">
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs">
<div fxLayout="row">
<div fxFlex="100" style="text-align: right;">
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Allocate" matTooltipPosition="above" (click)="pdAllocationTo(master)"><mat-icon>verified_user</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.COMPLETED && currentPDStatus!=pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Schedule" matTooltipPosition="above" (click)="scheduleDetails(master)"><mat-icon>schedule</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus!=pdStatusCheck.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && currentPDStatus!=pdStatusCheck.DRAFT && enableStartPD" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Discussion" matTooltipPosition="above" (click)="getPDStart(viewID)"><mat-icon>question_answer</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus===pdStatusCheck.QC_COMPLETED" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="PD Report" matTooltipPosition="above" (click)="getPDIDReport(viewID)"><mat-icon>ballot</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="above" (click)="loadPdListCompoent()"><mat-icon>close</mat-icon></button>
</div>
</div>
</div>
</mat-card-content>
<hr>
<mat-card-content>
<div *ngFor="let master of pdMasterData">
<div fxLayout="row" fxLayoutWrap="wrap" class="mb-3">
<div fxFlex="60">
<div fxLayout="row">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<div fxFlex="10">
<span><i class="fa-1x fa fa-suitcase" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i></span>
</div>
<div fxFlex="90">
<span *ngIf="master.product_name"> {{master.product_name}}<span *ngIf="master.subproduct_name"> / {{master.subproduct_name}} </span></span>
</div>
</div>
</div>
<div fxLayout="row">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<div fxFlex="10">
<span><i class="fa-1x fa fa-rupee" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i></span>
</div>
<div fxFlex="90">
<span *ngIf="master.loan_amount"> {{master.loan_amount}}</span>
</div>
</div>
</div>
<div fxLayout="row">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<div fxFlex="10">
<span><i class="fa-1x fa fa-check-circle" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i></span>
</div>
<div fxFlex="90">
<span *ngIf="master.pd_type_name"> {{master.pd_type_name}}</span>
</div>
</div>
</div>
<div fxLayout="row">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<div fxFlex="10">
<span><i class="fa-1x fa fa-map-marker" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i></span>
</div>
<div fxFlex="90">
<span *ngIf="master.state_name" class="hover-icon"> {{master.addressline1}},<br> {{master.city_name}},<br>{{master.state_name}}-{{master.pincode}} </span>
</div>
</div>
</div>
<!--<div fxLayout="row">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<span><i class="fa-1x fa fa-suitcase" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i>&nbsp; {{master.addressline1}}</span>
</div>
</div>-->
</div>
<div fxFlex="40">
<div *ngIf="master.pd_contact_person || master.pd_contact_mobileno" style="background-color:#e3dbdb;padding:9px;">
<h4 class="ma-0" style="font-size:13px;padding-bottom:5px;color:red;"><span>Lender Contact Details</span></h4>
<div fxLayout="row">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<span *ngIf="master.pd_contact_person"> <i class="fa-1x fa fa-user" style="padding: 8px 13px 8px 13px;border-bottom: 2px solid red;"></i>&nbsp; {{master.pd_contact_person}}</span>
</div>
</div>
<div fxLayout="row">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<span *ngIf="master.pd_contact_mobileno"> <i class="fa-1x fa fa-phone" style="padding: 8px 13px 8px 13px;border-bottom: 2px solid red;"></i>&nbsp; {{master.pd_contact_mobileno}}</span>
</div>
</div>
</div>
<br>
<div fxLayout="row" *ngIf="master.remarks" style="background-color:#e3dbdb;padding:15px;">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<h4 class="ma-0" style="font-size:13px;padding-bottom:5px;color:red;"><span> Remarks </span></h4>
<span>{{master.remarks}}</span>
</div>
</div>
<div fxLayout="row" class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" class="profile-center">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdMaster(master)"><mat-icon>edit</mat-icon></button>
</div>
</div>
</div>
</div>
</div>
</mat-card-content>
</figure>
</div>
</div>
</mat-card>
<mat-card class="p-2">
<h4>PD Details</h4>
<mat-tab-group class="mt-2">
<mat-tab>
<ng-template mat-tab-label>Applicants</ng-template>
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editPdApplicant(pdApplicantData)"><mat-icon>edit</mat-icon></button>
</div>
@ -90,19 +155,19 @@
<mat-list *ngFor="let applicant of pdApplicantData">
<mat-list-item style="height:68px !important;">
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-user-o"></i>
<i class="fa-1x fa fa-user-o" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i>
&nbsp;{{applicant.applicant_name}}
</span> &nbsp;&nbsp;&nbsp;
<span *ngIf="applicant.mobile_no != '' && applicant.mobile_no != null" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-phone"></i>
<i class="fa-1x fa fa-phone" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i>
&nbsp;{{applicant.mobile_no}}
</span> &nbsp;&nbsp;&nbsp;
<span *ngIf="applicant.landline != '' && applicant.landline != 'null-null' && applicant.landline != null " class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-phone"></i>
<i class="fa-1x fa fa-phone" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;"></i>
&nbsp;<span matPrefix>+91</span>{{applicant.landline}}
</span>
<br><span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">Main Applicant </span>
<ng-template #codetails><span>{{applicant.relation_name}}</span></ng-template>
<span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">( Main Applicant ) </span>
<ng-template #codetails><span>( {{applicant.relation_name}} )</span></ng-template>
</p>
</mat-list-item>
</mat-list>
@ -111,19 +176,16 @@
<mat-card-content>
<p>No Applicant</p>
</mat-card-content>
</ng-template>
</mat-card>
</div>
<div fxFlex.xs="100" class="m-gap p-gap" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="100" fxFlex.xl="100">
<!-- applicant card -->
<mat-card class="minheight">
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
</ng-template>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>Additional Requirements</ng-template>
<div class="cardEdit" *ngIf="currentPDStatus==pdStatusCheck.DRAFT || currentPDStatus==pdStatusCheck.TRIGGERED || currentPDStatus==pdStatusCheck.ALLOCATED || currentPDStatus==pdStatusCheck.SCHEDULED">
<button mat-raised-button mat-button-sm mat-icon-button class="mr-1 mb-1 hover-icon" type="button" (click)="editAdditionalRequirement(pdAdditionalReqData)"><mat-icon>edit</mat-icon></button>
</div>
<mat-card-header>
</div>
<mat-card-header>
<mat-card-title style="color:red !important;">Additional Requirements</mat-card-title>
</mat-card-header>
<mat-card-content *ngIf="pdAdditionalReqData.length>0; else noRequirement">
<mat-list *ngFor="let requirement of pdAdditionalReqData">
<mat-list-item>
@ -135,75 +197,38 @@
<mat-card-content>
<p>No Additional Requirements</p>
</mat-card-content>
</ng-template>
</mat-card>
</div>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
<!-- pd documents card -->
<mat-expansion-panel *ngIf="pdDocumentsData.length>0; else nodocument">
<mat-expansion-panel-header>
<mat-panel-title class="text-xs-left" style="color:red !important;">
<h6 class="mt-0">Documents</h6>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-list *ngFor="let documents of pdDocumentsData">
</ng-template>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>Documents</ng-template>
<div *ngIf="pdDocumentsData.length>0; else nodocument">
<mat-list *ngFor="let documents of pdDocumentsData">
<mat-list-item>
<!--<p><span><i class="fa-1x fa fa-file"></i> {{documents.pd_document_title}} </span></p> -->
<a href="{{documents.doc_url}}" target="_blank"><i class="fa-1x fa fa-file"></i> {{documents.pd_document_title}}</a>
<!---- <span class="mb-2 text-center hover-icon"> &nbsp;{{documents.pd_document_name}} </span> -->
<!-- <span class="mb-2 text-center hover-icon"> &nbsp;{{documents.pd_document_name}} </span> -->
</mat-list-item>
</mat-list>
</mat-expansion-panel>
<ng-template #nodocument>
<mat-card>
</div>
<ng-template #nodocument>
<mat-card-content>
<p>No Document</p>
</mat-card-content>
</mat-card>
</ng-template>
</div>
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<!--pd logs card -->
<mat-expansion-panel *ngIf="masterPdLogsData.length>0; else nohistory">
<mat-expansion-panel-header>
<mat-panel-title class="text-xs-left" style="color:red !important;">
<h6 class="mt-0"> PD History</h6>
</mat-panel-title>
</mat-expansion-panel-header>
<mat-list class="m-gap p-gap" *ngFor="let master of masterPdLogsData">
<mat-list-item>
<span style="font-size:15px;"><span style="color:#908f8f">{{master.time}}</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#908f8f"> <i> {{master.user}} </i> </span><br> <span>{{master.log}}</span> </span>
</mat-list-item>
</mat-list>
</mat-expansion-panel>
<ng-template #nohistory>
<mat-card>
<mat-card-content>
<p>No History</p>
</mat-card-content>
</mat-card>
</ng-template>
</div>
<div class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50">
<mat-card>
</mat-card-content>
</ng-template>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>QC Notes</ng-template>
<div style="color:red !important;">
<h6>QC Notes</h6>
</div>
<p>
{{ pdMasterData[0]?.qc_remarks}}</p>
</mat-card>
</div>
<div *ngIf="pdMasterData[0]?.pd_status === 'QC_COMPLETED'" class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50"
fxFlex.lg="50" fxFlex.xl="50">
<mat-card>
{{ pdMasterData[0]?.qc_remarks}}</p>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>QC Remarks</ng-template>
<div *ngIf="pdMasterData[0]?.pd_status === 'QC_COMPLETED'" class="m-gap p-gap" fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100"
fxFlex.lg="100" fxFlex.xl="100">
<div style="color:red !important;">
<h6>QC Remarks</h6>
</div>
@ -220,13 +245,30 @@
<br>
<div style="display: inline-block;">
{{ pdMasterData[0]?.qc_feedback}}
</div>
</mat-card>
</div>
</div>
</mat-card-content>
</div>
</mat-card-content>
</div>
</div>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>PD History</ng-template>
<div *ngIf="masterPdLogsData.length>0; else nohistory">
<mat-list class="m-gap p-gap" *ngFor="let master of masterPdLogsData">
<mat-list-item>
<span style="font-size:15px;"><span style="color:#908f8f">{{master.time}}&nbsp;</span>
<span style="color:#908f8f"> <i> {{master.user}} </i> </span><br> <span>{{master.log}}</span> </span>
</mat-list-item>
</mat-list>
</div>
<ng-template #nohistory>
<mat-card-content>
<p>No History</p>
</mat-card-content>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-card>
</mat-card-content>
</mat-card>
<!-- <notifier-container></notifier-container> -->

View File

@ -8,4 +8,26 @@
}
::ng-deep .body-container{
padding: 0rem !important;
}
}
:host {
margin-left: -5px;
margin-right: -5px;
margin-top: -5px;
display: block;
}
.wrapper {
margin: 6px;
}
.content-data{
h2{
font-size: 1.5rem;
}
}
@media(max-width:767px){
.profile-center{
text-align: center;
}
}

View File

@ -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 {

View File

@ -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', []))
)