This commit is contained in:
dineshkumarkannan 2018-12-24 15:37:33 +05:30
commit 559aa8ed8e
31 changed files with 794 additions and 999 deletions

View File

@ -43,6 +43,7 @@ export class EditPdApplicantComponent implements OnInit {
fk_applicant_primary_id: [null], fk_applicant_primary_id: [null],
applicant_name: [null, Validators.compose([Validators.required])], 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.required,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)])], landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
company_name: [null], company_name: [null],
applicant_type: [1], applicant_type: [1],
@ -54,7 +55,6 @@ export class EditPdApplicantComponent implements OnInit {
loadApplicantFormData() { loadApplicantFormData() {
let stdcodesearch = this.mainApplicantData[0].landline.search("-"); let stdcodesearch = this.mainApplicantData[0].landline.search("-");
let stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch); let stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch);
console.log(stdcode);
let landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8); let landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8);
this._EditApplicantForm = this._fb.group({ this._EditApplicantForm = this._fb.group({
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],

View File

@ -19,26 +19,29 @@
<mat-card> <mat-card>
<!-- <mat-card-title>Address Details</mat-card-title> --> <!-- <mat-card-title>Address Details</mat-card-title> -->
<mat-card-content> <mat-card-content>
<div fxLayout="row wrap">
<mat-form-field> <div fxFlex="33">
<mat-form-field style="width: 80%;">
<!-- <input matInput placeholder="Name" formControlName="name_ans" type="text" required> --> <!-- <input matInput placeholder="Name" formControlName="name_ans" type="text" required> -->
<input matInput placeholder="Address" formControlName="address" required autocomplete="off"> <input matInput placeholder="Address" formControlName="address" required autocomplete="off">
</mat-form-field> </mat-form-field>
</div>
<mat-form-field> <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>
<mat-option value="{{m_addressType.address_type_id}}" <mat-option value="{{m_addressType.address_type_id}}"
*ngFor="let m_addressType of addressData">{{m_addressType.address_type}} *ngFor="let m_addressType of addressData">{{m_addressType.address_type}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="addressForm.controls['address_type'].value == 12" style="width: 80%;">
<mat-form-field *ngIf="addressForm.controls['address_type'].value == 12">
<input matInput placeholder="Address Type Others" formControlName="address_type_others" autocomplete="off"> <input matInput placeholder="Address Type Others" formControlName="address_type_others" autocomplete="off">
</mat-form-field> </mat-form-field>
</div>
<mat-form-field> <div fxFlex="33">
<mat-form-field style="width: 80%;">
<mat-select placeholder="Locality" formControlName="locality" required> <mat-select placeholder="Locality" formControlName="locality" required>
<mat-option value="{{m_locality.locality_id}}" <mat-option value="{{m_locality.locality_id}}"
*ngFor="let m_locality of localityData">{{m_locality.locality_name}} *ngFor="let m_locality of localityData">{{m_locality.locality_name}}
@ -46,27 +49,75 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="addressForm.controls.locality.value == 'Others'"> <mat-form-field *ngIf="addressForm.controls.locality.value == 'Others'" style="width: 80%;">
<input matInput placeholder="Specify Locality" <input matInput placeholder="Specify Locality"
formControlName="locality_others" autocomplete="off"> formControlName="locality_others" autocomplete="off">
</mat-form-field> </mat-form-field>
</div>
<mat-form-field style="width: 30%">
</div>
<div fxLayout="row wrap">
<div fxFlex="33">
<mat-form-field style="width: 80%;">
<mat-select placeholder="Approach to PD Location" formControlName="pd_location" required> <mat-select placeholder="Approach to PD Location" formControlName="pd_location" required>
<mat-option value="{{data.pd_location_approach_id}}" <mat-option value="{{data.pd_location_approach_id}}"
*ngFor="let data of locationdata">{{data.description}} *ngFor="let data of locationdata">{{data.description}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div>
<mat-form-field style="width: 30%"> <div fxFlex="33">
<mat-form-field style="width: 80%;">
<mat-select placeholder="Comment on Locality" formControlName="comment_locality" required> <mat-select placeholder="Comment on Locality" formControlName="comment_locality" required>
<mat-option value="{{data.comments_on_locality_id}}" <mat-option value="{{data.comments_on_locality_id}}"
*ngFor="let data of commentData">{{data.rating}} *ngFor="let data of commentData">{{data.rating}}
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field style="width: 80%;">
<mat-select placeholder="Ownership" formControlName="address_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['address_ownership'].value == 4 " style="width: 80%;">
<input matInput placeholder="Specify Other Ownership" formControlName="other_ownership" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="addressForm.controls['address_ownership'].value == 3 " style="width: 80%;">
<input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off">
</mat-form-field>
</div>
</div>
<div fxLayout="row wrap">
<div fxFlex="33">
<mat-form-field style="width: 80%;">
<mat-select placeholder="Is there any 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 *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 60%">
<label>How long has business been operated from this premise?</label>
<mat-form-field style="width: 40%">
<input matInput placeholder="Year(s)" formControlName="business_years" min='0'>
</mat-form-field>
<mat-form-field style="width: 40%">
<input matInput placeholder="Month(s)" formControlName="business_month" min='0' max='12'>
</mat-form-field>
</div>
</div>
</div>
<!-- Don't Remove To replace atlast of the PD Completion and creating new form (Customer Behaviour 221118 review doc : s.no 3.e ) <!-- Don't Remove To replace atlast of the PD Completion and creating new form (Customer Behaviour 221118 review doc : s.no 3.e )
<mat-form-field> <mat-form-field>
<mat-select placeholder="Customer Behaviour" <mat-select placeholder="Customer Behaviour"
@ -77,31 +128,10 @@
</mat-select> </mat-select>
</mat-form-field>--(Customer Behaviour)--> </mat-form-field>--(Customer Behaviour)-->
<mat-form-field>
<mat-select placeholder="Ownership" formControlName="address_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['address_ownership'].value == 4 " style="width: 38%">
<input matInput placeholder="Specify Other Ownership" formControlName="other_ownership" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="addressForm.controls['address_ownership'].value == 3 " style="width: 38%">
<input matInput placeholder="What is the monthly rent paid?" formControlName="rent_amt" autocomplete="off">
</mat-form-field>
<mat-form-field style="width: 42%">
<mat-select placeholder="Is there any 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>
<!-- <mat-form-field *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 100%"> --> <!-- <mat-form-field *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 100%"> -->
<!-- <mat-select placeholder="Bussiness Type" formControlName="bussiness_address_type"> <!-- <mat-select placeholder="Bussiness Type" formControlName="bussiness_address_type">
<mat-option value="{{m_addressType.address_type_id}}" <mat-option value="{{m_addressType.address_type_id}}"
@ -112,8 +142,8 @@
<mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id" (onSelectionChange)="SelectedPremises($event)" > {{m_addressType.address_type}} </mat-option> <mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id" (onSelectionChange)="SelectedPremises($event)" > {{m_addressType.address_type}} </mat-option>
</mat-select> </mat-select>
</mat-form-field> --> </mat-form-field> -->
<p>Type of Premises</p> <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 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"> --> <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> <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>
@ -157,12 +187,12 @@
<mat-form-field *ngIf="item.get('premises_ownership').value == 3" style="width: 40%;"> <mat-form-field *ngIf="item.get('premises_ownership').value == 3" style="width: 40%;">
<input matInput placeholder="What is the monthly rent paid?" formControlName="premises_rent_amt" autocomplete="off"> <input matInput placeholder="What is the monthly rent paid?" formControlName="premises_rent_amt" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width: 40%">
<input matInput placeholder="Remarks" <input matInput placeholder="Remarks"
formControlName="premises_remarks" style="width: 65%;" autocomplete="off"> formControlName="premises_remarks" style="width: 65%;" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</span> </span>
<!--- Don't Remove To replace atlast of the PD Completion and creating new form (Neighbourhood check) -- <!--- Don't Remove To replace atlast of the PD Completion and creating new form (Neighbourhood check) --
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>

View File

@ -36,6 +36,7 @@ export class AddressComponent implements OnInit {
//@Input() pdid: number; //@Input() pdid: number;
pdid : number; pdid : number;
form_id: number; form_id: number;
pdAddress: string;
loadDataStatus: boolean=true; loadDataStatus: boolean=true;
@ -73,6 +74,8 @@ export class AddressComponent implements OnInit {
public other_ownership: AbstractControl; public other_ownership: AbstractControl;
public rent_amt : AbstractControl; public rent_amt : AbstractControl;
public bussinessActivity: AbstractControl; public bussinessActivity: AbstractControl;
public business_years: AbstractControl;
public business_month: AbstractControl;
//constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , ) { //constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , ) {
constructor(private el: ElementRef, notifier: NotifierService, constructor(private el: ElementRef, notifier: NotifierService,
private fb: FormBuilder, private fb: FormBuilder,
@ -84,11 +87,12 @@ export class AddressComponent implements OnInit {
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 5; this.form_id = 5;
this.notifier = notifier; this.notifier = notifier;
this.pdAddress = this.pd_all_details.pdmaster_details.addressline1;
} }
ngOnInit() { ngOnInit() {
console.clear(); console.clear();
console.log('this.address',this.pdAddress);
this.getMasterDetails('PDLOCATIONAPPROACH',1); this.getMasterDetails('PDLOCATIONAPPROACH',1);
this.getMasterDetails('COMMENTSONLOCALITY',2); this.getMasterDetails('COMMENTSONLOCALITY',2);
//this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e //this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e
@ -177,6 +181,9 @@ export class AddressComponent implements OnInit {
// } // }
if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) { 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; let that = this;
this.bussiness_address_type = []; this.bussiness_address_type = [];
@ -191,8 +198,8 @@ export class AddressComponent implements OnInit {
}) })
} }
console.log(this.bussiness_address_type); // console.log(this.bussiness_address_type);
console.log(this.additional_premises); // console.log(this.additional_premises);
this.selectedValue(this.bussiness_address_type,this.additional_premises); this.selectedValue(this.bussiness_address_type,this.additional_premises);
if (data.records.locality_others) { if (data.records.locality_others) {
@ -215,7 +222,7 @@ export class AddressComponent implements OnInit {
public initAddressForm(): void { public initAddressForm(): void {
this.addressForm = this.fb.group({ this.addressForm = this.fb.group({
address: ['', Validators.compose([Validators.required])], address: [this.pdAddress != '' ? this.pdAddress : '' , Validators.compose([Validators.required])],
address_type: ['', Validators.compose([Validators.required])], address_type: ['', Validators.compose([Validators.required])],
address_type_others: [''], address_type_others: [''],
locality: ['', Validators.compose([Validators.required])], locality: ['', Validators.compose([Validators.required])],
@ -229,6 +236,8 @@ export class AddressComponent implements OnInit {
other_ownership:[''], other_ownership:[''],
rent_amt:[''], rent_amt:[''],
bussiness_activity:[''], bussiness_activity:[''],
business_years:[''],
business_month:[''],
bussiness_address_type:[''], bussiness_address_type:[''],
bussiness_address_type_others: [''], bussiness_address_type_others: [''],
additional_premises: this.fb.array([]) additional_premises: this.fb.array([])
@ -243,6 +252,8 @@ export class AddressComponent implements OnInit {
this.other_ownership = this.addressForm.controls['other_ownership']; this.other_ownership = this.addressForm.controls['other_ownership'];
this.rent_amt = this.addressForm.controls['rent_amt']; this.rent_amt = this.addressForm.controls['rent_amt'];
this.bussinessActivity = this.addressForm.controls['bussiness_activity']; this.bussinessActivity = this.addressForm.controls['bussiness_activity'];
this.business_years = this.addressForm.controls['business_years'];
this.business_month = this.addressForm.controls['business_month'];
// this.bussiessAddressType = this.addressForm.controls['bussiness_address_type']; // this.bussiessAddressType = this.addressForm.controls['bussiness_address_type'];
} }
// createNeighbour(): FormGroup { // createNeighbour(): FormGroup {
@ -322,7 +333,7 @@ export class AddressComponent implements OnInit {
control.removeAt(index); control.removeAt(index);
}*/ }*/
onSubmit() { onSubmit() {
console.log('form data', this.addressForm.value); //console.log('form data', this.addressForm.value);
if (!this.addressForm.valid) { if (!this.addressForm.valid) {
return; return;
} }
@ -346,6 +357,8 @@ export class AddressComponent implements OnInit {
records.other_ownership = this.other_ownership.value; records.other_ownership = this.other_ownership.value;
records.rent_amt = this.rent_amt.value; records.rent_amt = this.rent_amt.value;
records.bussiness_activity = this.bussinessActivity.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') { if (this.bussinessActivity.value == 'yes') {
@ -358,7 +371,7 @@ export class AddressComponent implements OnInit {
} }
this.addressForm.controls.additional_premises.value.forEach((val,index)=> this.addressForm.controls.additional_premises.value.forEach((val,index)=>
{ {
console.log(val); //console.log(val);
if(val.premises_city != ''){ if(val.premises_city != ''){
this.formPremisesCityArray = []; this.formPremisesCityArray = [];
@ -385,7 +398,7 @@ export class AddressComponent implements OnInit {
console.log('params', records); console.log('params', records);
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
console.log('data', data); //console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}, error => { }, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -401,7 +414,7 @@ export class AddressComponent implements OnInit {
SelectedPremises($event){ SelectedPremises($event){
let premisesData = $event.source.value; let premisesData = $event.source.value;
console.log(premisesData); //console.log(premisesData);
if($event.checked === true ){ if($event.checked === true ){
@ -413,10 +426,10 @@ export class AddressComponent implements OnInit {
this.formPremisesArray.push({premises_types: $event.source.value}); this.formPremisesArray.push({premises_types: $event.source.value});
console.log(this.formPremisesArray); //console.log(this.formPremisesArray);
const control = <FormArray>this.addressForm.controls['additional_premises']; const control = <FormArray>this.addressForm.controls['additional_premises'];
let array = this.addressData.filter(data => data.address_type_id == premisesData)[0]; let array = this.addressData.filter(data => data.address_type_id == premisesData)[0];
console.log(array); //console.log(array);
if(premisesData == 12){ if(premisesData == 12){
this.PremisesOtherFlag = true; this.PremisesOtherFlag = true;
// this.PremisesLabel[this.z] = this.pdQuestionAddress.get('bussiness_address_type_others').value; // this.PremisesLabel[this.z] = this.pdQuestionAddress.get('bussiness_address_type_others').value;
@ -428,7 +441,7 @@ export class AddressComponent implements OnInit {
control.push(this.createPremises()); control.push(this.createPremises());
} }
console.log(this.PremisesLabel); //console.log(this.PremisesLabel);
this.z++; this.z++;
@ -442,13 +455,13 @@ export class AddressComponent implements OnInit {
if(premisesData == 12){ if(premisesData == 12){
this.PremisesOtherFlag = false; this.PremisesOtherFlag = false;
} }
console.log(this.formPremisesArray); //console.log(this.formPremisesArray);
let index = this.formPremisesArray.findIndex(form=>form.premises_types== $event.source.value); let index = this.formPremisesArray.findIndex(form=>form.premises_types== $event.source.value);
console.log(index); //console.log(index);
const control = <FormArray>this.addressForm.controls['additional_premises']; const control = <FormArray>this.addressForm.controls['additional_premises'];
control.removeAt(index); control.removeAt(index);
this.PremisesLabel.splice(index,1); this.PremisesLabel.splice(index,1);
console.log(this.z); //console.log(this.z);
this.z--; this.z--;
} }
@ -461,7 +474,7 @@ export class AddressComponent implements OnInit {
{ {
this.cityData.push({additional_premises_city:val}); this.cityData.push({additional_premises_city:val});
}); });
console.log(this.cityData); //console.log(this.cityData);
} }
otherValueset() otherValueset()
{ {
@ -537,9 +550,9 @@ export class AddressComponent implements OnInit {
selectedValue(e,data) selectedValue(e,data)
{ {
console.log('501 function',); // console.log('501 function',);
console.log('inside function in bussiness_address_type,',e); // console.log('inside function in bussiness_address_type,',e);
console.log('inside function in this.additional_premises,',data); // console.log('inside function in this.additional_premises,',data);
let premisesData = e ; let premisesData = e ;
this.tempArr = []; this.tempArr = [];
@ -549,10 +562,10 @@ export class AddressComponent implements OnInit {
that.addressData[key].status = 0; that.addressData[key].status = 0;
return that.addressData[key]; return that.addressData[key];
}) })
console.log(this.addressData); //console.log(this.addressData);
premisesData.forEach((val,index)=> premisesData.forEach((val,index)=>
{ {
console.log(val); //console.log(val);
this.z++; this.z++;
// console.log(this.addressTypes); // console.log(this.addressTypes);
this.formPremisesArray.push({premises_types: val}); this.formPremisesArray.push({premises_types: val});

View File

@ -28,7 +28,7 @@
<div [formGroupName]="i"> <div [formGroupName]="i">
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-select (selectionChange)="selectedAssetsType($event, i,2)" placeholder="Assets Type" formControlName="business_assets_mode" requried> <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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -42,7 +42,7 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-select placeholder="Property Type" formControlName="property_type" required> <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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -63,7 +63,7 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" required autocomplete="off"> <input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -77,7 +77,7 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" required autocomplete="off"> <input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -91,7 +91,7 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Description" formControlName="consumer_durable_description" required> <input matInput placeholder="Description" formControlName="consumer_durable_description" >
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -106,26 +106,26 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" required (keypress)="keyPress($event)" autocomplete="off"> <input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field> <mat-form-field>
<mat-select placeholder="Frequency" formControlName="frequency_mode" required> <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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" required (keypress)="keyPress($event)" autocomplete="off"> <input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Members Covered" formControlName="members_coverd" required autocomplete="off"> <input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -141,24 +141,24 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field> <mat-form-field>
<mat-select placeholder="Type" formControlName="investments_type" required> <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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<!-- <div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 "> --> <div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 ">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Specify Other Type" formControlName="other_investments_type" autocomplete="off"> <input matInput placeholder="Specify Other Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field> </mat-form-field>
<!-- </div> --> </div>
<div fxFlex="33" > <div fxFlex="33" >
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" required (keypress)="keyPress($event)" autocomplete="off"> <input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Bank Name" formControlName="bank_name" required autocomplete="off"> <input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -174,19 +174,19 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" required autocomplete="off"> <input matInput placeholder="Description of the Assets" formControlName="any_other_assets" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" required autocomplete="off"> <input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off">
</mat-form-field> </mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width"> --> <!-- <mat-form-field class="ml-xs example-full-width"> -->
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" required> --> <!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" > -->
<!-- </mat-form-field> --> <!-- </mat-form-field> -->
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" required> <mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" >
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
<mat-option value="nan">NAN</mat-option> <mat-option value="nan">NA</mat-option>
</mat-select> </mat-select>
</mat-form-field> </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'"> -->
@ -215,7 +215,7 @@
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Name of the Owner" formControlName="business_name_of_the_owner" autocomplete="off"> <input matInput placeholder="Name of the Business Owner" formControlName="business_name_of_the_owner" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
@ -223,7 +223,7 @@
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<mat-select placeholder="Name of the Owner" <mat-select placeholder="Name of the Owner"
formControlName="business_name_of_the_owner" required> formControlName="business_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}}</mat-option>
@ -238,7 +238,7 @@
</div> </div>
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<mat-select placeholder="Relation" formControlName="relation" required> <mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}" <mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation"> *ngFor="let relations of m_relation">
{{relations.name}} {{relations.name}}
@ -329,7 +329,7 @@
<div [formGroupName]="i"> <div [formGroupName]="i">
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-select (selectionChange)="selectedAssetsType($event, i,1)" placeholder="Assets Type" formControlName="assets_mode" requried> <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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -343,7 +343,7 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field style="width:100%"> <mat-form-field style="width:100%">
<mat-select placeholder="Property Type" formControlName="property_type" required> <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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -364,7 +364,7 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" required autocomplete="off"> <input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -378,7 +378,7 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" required autocomplete="off"> <input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -406,7 +406,7 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Description" formControlName="consumer_durable_description" required> <input matInput placeholder="Description" formControlName="consumer_durable_description" >
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -421,33 +421,33 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!---- <div fxFlex="33"> <!---- <div fxFlex="33">
<mat-form-field> <mat-form-field>
<mat-select placeholder="Type" formControlName="insurance_type" required> <mat-select placeholder="Type" formControlName="insurance_type" >
<mat-option *ngFor="let ins_type of m_insuranceType" [value]="ins_type.id">{{ ins_type.name }}</mat-option> <mat-option *ngFor="let ins_type of m_insuranceType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div>--> </div>-->
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" required (keypress)="keyPress($event)" autocomplete="off"> <input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field> <mat-form-field>
<mat-select placeholder="Frequency" formControlName="frequency_mode" required> <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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" required (keypress)="keyPress($event)" autocomplete="off"> <input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Members Covered" formControlName="members_coverd" required autocomplete="off"> <input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -463,7 +463,7 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33%" class="ml-xs example-full-width"> <div fxFlex="33%" class="ml-xs example-full-width">
<mat-form-field> <mat-form-field>
<mat-select placeholder="Type" formControlName="investments_type" required> <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 }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@ -477,14 +477,14 @@
<!-- </div> --> <!-- </div> -->
<div fxFlex="33%" > <div fxFlex="33%" >
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" required (keypress)="keyPress($event)" autocomplete="off"> <input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33%"> <div fxFlex="33%">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Bank Name" formControlName="bank_name" required autocomplete="off"> <input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -499,19 +499,43 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div> <div>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" required autocomplete="off"> <input matInput placeholder="Description of the Assets" formControlName="any_other_assets" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" required autocomplete="off"> <input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field class="ml-xs example-full-width">
<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-select>
</mat-form-field>
<div *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''">
<mat-form-field class="ml-xs example-full-width" >
<input matInput placeholder="Specify Other Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
</div>
<div>
<mat-form-field class="ml-xs example-full-width">
<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>
</div>
<!-- <mat-form-field class="ml-xs example-full-width"> --> <!-- <mat-form-field class="ml-xs example-full-width"> -->
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" required> --> <!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" > -->
<!-- </mat-form-field> --> <!-- </mat-form-field> -->
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" required> <mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" >
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
<mat-option value="nan">NAN</mat-option> <mat-option value="nan">NA</mat-option>
</mat-select> </mat-select>
<!-- <input matInput placeholder="What is the EMI amount ?" formControlName="any_other_asset_loan" autocomplete="off"> --> <!-- <input matInput placeholder="What is the EMI amount ?" formControlName="any_other_asset_loan" autocomplete="off"> -->
</mat-form-field> </mat-form-field>
@ -545,7 +569,7 @@
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<mat-select placeholder="Name of the Owner" <mat-select placeholder="Name of the Owner"
formControlName="name_of_the_owner" required> 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}}</mat-option>
@ -560,7 +584,7 @@
</div> </div>
<div fxFlex="33"> <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width"> <mat-form-field class="ml-xs example-full-width">
<mat-select placeholder="Relation" formControlName="relation" required> <mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}" <mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation"> *ngFor="let relations of m_relation">
{{relations.name}} {{relations.name}}

View File

@ -31,6 +31,7 @@ export class AssetsInfoComponent implements OnInit {
pageTitle: string ="Assets Details"; pageTitle: string ="Assets Details";
//@Input() pdid: number; //@Input() pdid: number;
pdid:string; pdid:string;
businessProfessionName :string;
public _assetsQuesFrom: FormGroup; public _assetsQuesFrom: FormGroup;
public submitted = false; public submitted = false;
@ -196,9 +197,12 @@ public m_investmentType = [];
}; };
ngOnInit() { ngOnInit() {
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
});
this.getPdSupplierFormDetails(); this.getPdSupplierFormDetails();
this.getM_Assets_Type(); this.getM_Assets_Type();
this.getM_PropertyType(); this.getM_PropertyType();
this.getM_InvestmentType(); this.getM_InvestmentType();
@ -209,6 +213,7 @@ public m_investmentType = [];
// ====================== // ======================
getM_Assets_Type() { getM_Assets_Type() {
this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe( this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe(
data => { data => {
@ -322,7 +327,7 @@ public m_investmentType = [];
this.initDetails(), this.initDetails(),
]), ]),
business_assets_details : this._formBuilder.array([ business_assets_details : this._formBuilder.array([
this.initBusinessDetails(), this.initBusinessDetails(this.businessProfessionName),
]), ]),
assets_form_remark:[''] assets_form_remark:['']
}); });
@ -340,14 +345,14 @@ public m_investmentType = [];
// Dynamic Form field creation Functionality : START ===> // Dynamic Form field creation Functionality : START ===>
initDetails() { initDetails() {
return this._formBuilder.group({ return this._formBuilder.group({
assets_mode: ['', Validators.compose([Validators.required])], assets_mode: [''],
details: this._formBuilder.array([]), details: this._formBuilder.array([]),
approximate_market_value: ['', Validators.compose([])], approximate_market_value: [''],
name_of_the_owner: ['', Validators.compose([])], name_of_the_owner: [''],
other_owner:[''], other_owner:[''],
relation: [''], relation: [''],
// purchase_year: ['', Validators.compose([])], // purchase_year: [''],
//purchase_month: ['', Validators.compose([])], //purchase_month: [''],
emi: [''], emi: [''],
emi_paid: [''], emi_paid: [''],
original_loan_tenure: [''], original_loan_tenure: [''],
@ -356,16 +361,16 @@ public m_investmentType = [];
}); });
} }
initBusinessDetails() { initBusinessDetails(data) {
return this._formBuilder.group({ return this._formBuilder.group({
business_assets_mode: ['', Validators.compose([Validators.required])], business_assets_mode: [''],
business_details: this._formBuilder.array([]), business_details: this._formBuilder.array([]),
business_approximate_market_value: ['', Validators.compose([])], business_approximate_market_value: [''],
business_name_of_the_owner: ['', Validators.compose([])], business_name_of_the_owner: [data],
// other_owner:[''], // other_owner:[''],
// relation:[''], // relation:[''],
// purchase_year: ['', Validators.compose([])], // purchase_year: [''],
//purchase_month: ['', Validators.compose([])], //purchase_month: [''],
business_emi: [''], business_emi: [''],
business_emi_paid: [''], business_emi_paid: [''],
business_original_loan_tenure: [''], business_original_loan_tenure: [''],
@ -434,9 +439,14 @@ public m_investmentType = [];
break; break;
} }
case '8': { case '8': {
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray if(flag == 1){
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('details') as FormArray ; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray ;
control.push(this.otherAssetsDescription()); control.push(this.otherAssetsDescription());
}
else if (flag == 2){
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.otherBusinessAssetsDescription());
}
break; break;
} }
default: { default: {
@ -448,26 +458,39 @@ public m_investmentType = [];
loadProperty() { loadProperty() {
return this._formBuilder.group({ return this._formBuilder.group({
property_type: ['', Validators.compose([Validators.required])], property_type: [''],
other_property_type: [''] other_property_type: ['']
}); });
} }
loadJwellDescription() { loadJwellDescription() {
return this._formBuilder.group({ return this._formBuilder.group({
jwell_description: ['', Validators.compose([])] jwell_description: ['']
}); });
} }
loadConsumerDurableDescription() { loadConsumerDurableDescription() {
return this._formBuilder.group({ return this._formBuilder.group({
consumer_durable_description: ['', Validators.compose([Validators.required])] consumer_durable_description: ['']
}); });
} }
otherAssetsDescription() { otherAssetsDescription() {
return this._formBuilder.group({ return this._formBuilder.group({
any_other_assets: ['', Validators.compose([Validators.required])], any_other_assets: [''],
name_of_the_owner:[''],
other_owner:[''],
relation:[''],
any_other_asset_value : [''],
any_other_asset_loan : [''],
other_asset_emi_amt : ['']
});
}
otherBusinessAssetsDescription() {
return this._formBuilder.group({
any_other_assets: [''],
any_other_asset_value : [''], any_other_asset_value : [''],
any_other_asset_loan : [''], any_other_asset_loan : [''],
other_asset_emi_amt : [''] other_asset_emi_amt : ['']
@ -477,32 +500,32 @@ public m_investmentType = [];
loadInsuranceDescription() { loadInsuranceDescription() {
return this._formBuilder.group({ return this._formBuilder.group({
//insurance_type: ['', Validators.compose([Validators.required])], //insurance_type: [''],
premium_paid: ['', Validators.compose([])], premium_paid: [''],
frequency_mode: ['', Validators.compose([])], frequency_mode: [''],
sum_assured: ['', Validators.compose([])], sum_assured: [''],
members_coverd: ['', Validators.compose([])] members_coverd: ['']
}); });
} }
loadInvestDescription() { loadInvestDescription() {
return this._formBuilder.group({ return this._formBuilder.group({
investments_type: ['', Validators.compose([])], investments_type: [''],
other_investments_type:[''], other_investments_type:[''],
amount_of_invest: ['', Validators.compose([])], amount_of_invest: [''],
bank_name: ['', Validators.compose([])] bank_name: ['']
}); });
} }
load_Four_Weeler() { load_Four_Weeler() {
return this._formBuilder.group({ return this._formBuilder.group({
manufacturer_model_four_weeler: ['', Validators.compose([])] manufacturer_model_four_weeler: ['']
}); });
} }
load_Two_Weeler() { load_Two_Weeler() {
return this._formBuilder.group({ return this._formBuilder.group({
manufacturer_model_two_weeler: ['', Validators.compose([Validators.required])] manufacturer_model_two_weeler: ['']
}); });
} }
@ -510,67 +533,74 @@ public m_investmentType = [];
loadPropertyWithData(data) { loadPropertyWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
property_type: [data.property_type, Validators.compose([Validators.required])] property_type: [data.property_type]
//property_type:['']
});
}
loadPropertyWithData2(data) {
return this._formBuilder.group({
property_type: [data.property_type, Validators.compose([Validators.required])]
//property_type:[''] //property_type:['']
}); });
} }
loadJwellDescriptionWithData(data) { loadJwellDescriptionWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
jwell_description: [data.jwell_description, Validators.compose([Validators.required])] jwell_description: [data.jwell_description]
}); });
} }
loadConsumerDurableDescriptionWithData(data) { loadConsumerDurableDescriptionWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
consumer_durable_description: [data.consumer_durable_description, Validators.compose([Validators.required])] consumer_durable_description: [data.consumer_durable_description]
}); });
} }
otherAssetsDescriptionWithData(data) { otherAssetsDescriptionWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
any_other_assets: [data.any_other_assets, Validators.compose([Validators.required])], any_other_assets: [data.any_other_assets],
name_of_the_owner:[data.name_of_the_owner],
other_owner:[data.other_owner],
relation:[data.relation],
any_other_asset_value : [data.any_other_asset_value], any_other_asset_value : [data.any_other_asset_value],
any_other_asset_loan : [data.any_other_asset_loan], any_other_asset_loan : [data.any_other_asset_loan],
other_asset_emi_amt : [data.other_asset_emi_amt] other_asset_emi_amt : [data.other_asset_emi_amt]
}); });
} }
otherBusinessAssetsDescriptionWithData(data) {
return this._formBuilder.group({
any_other_assets: [data.any_other_assets],
any_other_asset_value : [data.any_other_asset_value],
any_other_asset_loan : [data.any_other_asset_loan],
other_asset_emi_amt : [data.other_asset_emi_amt]
});
}
loadInsuranceDescriptionWithData(data) { loadInsuranceDescriptionWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
//insurance_type: [data.insurance_type, Validators.compose([Validators.required])], //insurance_type: [data.insurance_type],
premium_paid: [data.premium_paid, Validators.compose([Validators.required])], premium_paid: [data.premium_paid],
frequency_mode: [data.frequency_mode, Validators.compose([Validators.required])], frequency_mode: [data.frequency_mode],
sum_assured: [data.sum_assured, Validators.compose([Validators.required])], sum_assured: [data.sum_assured],
members_coverd: [data.members_coverd, Validators.compose([Validators.required])] members_coverd: [data.members_coverd]
}); });
} }
loadInvestDescriptionWithData(data) { loadInvestDescriptionWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
investments_type: [data.investments_type, Validators.compose([Validators.required])], investments_type: [data.investments_type],
other_investment_type : [data.other_investment_type], other_investments_type : [data.other_investments_type],
amount_of_invest: [data.amount_of_invest, Validators.compose([Validators.required])], amount_of_invest: [data.amount_of_invest],
bank_name: [data.bank_name, Validators.compose([Validators.required])] bank_name: [data.bank_name]
}); });
} }
load_Four_WeelerWithData(data) { load_Four_WeelerWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
manufacturer_model_four_weeler: [data.manufacturer_model_four_weeler, Validators.compose([Validators.required])] manufacturer_model_four_weeler: [data.manufacturer_model_four_weeler]
}); });
} }
load_Two_WeelerWithData(data) { load_Two_WeelerWithData(data) {
return this._formBuilder.group({ return this._formBuilder.group({
manufacturer_model_two_weeler: [data.manufacturer_model_two_weeler, Validators.compose([Validators.required])] manufacturer_model_two_weeler: [data.manufacturer_model_two_weeler]
}); });
} }
@ -578,14 +608,14 @@ public m_investmentType = [];
initDetailsWithdata(data) { initDetailsWithdata(data) {
return this._formBuilder.group({ return this._formBuilder.group({
assets_mode: [data.assets_mode, Validators.compose([Validators.required])], assets_mode: [data.assets_mode],
details: this._formBuilder.array([]), details: this._formBuilder.array([]),
approximate_market_value: [data.approximate_market_value, Validators.compose([])], approximate_market_value: [data.approximate_market_value],
name_of_the_owner: [data.name_of_the_owner, Validators.compose([])], name_of_the_owner: [data.name_of_the_owner],
other_owner:[data.other_owner || ''], other_owner:[data.other_owner || ''],
relation: [data.relation || ''], relation: [data.relation || ''],
// purchase_year: [data.purchase_year, Validators.compose([])], // purchase_year: [data.purchase_year],
// purchase_month: [data.purchase_month, Validators.compose([])], // purchase_month: [data.purchase_month],
emi: [data.emi || 0], emi: [data.emi || 0],
emi_paid: [data.emi_paid || ''], emi_paid: [data.emi_paid || ''],
original_loan_tenure: [data.original_loan_tenure || ''], original_loan_tenure: [data.original_loan_tenure || ''],
@ -595,14 +625,14 @@ public m_investmentType = [];
} }
initBusinessDetailsWithdata(data) { initBusinessDetailsWithdata(data) {
return this._formBuilder.group({ return this._formBuilder.group({
business_assets_mode: [data.business_assets_mode, Validators.compose([Validators.required])], business_assets_mode: [data.business_assets_mode],
business_details: this._formBuilder.array([]), business_details: this._formBuilder.array([]),
business_approximate_market_value: [data.business_approximate_market_value, Validators.compose([])], business_approximate_market_value: [data.business_approximate_market_value],
business_name_of_the_owner: [data.business_name_of_the_owner, Validators.compose([])], business_name_of_the_owner: [data.business_name_of_the_owner],
// other_owner:[data.other_owner || ''], // other_owner:[data.other_owner || ''],
// relation: [data.relation || ''], // relation: [data.relation || ''],
// purchase_year: [data.purchase_year, Validators.compose([])], // purchase_year: [data.purchase_year],
// purchase_month: [data.purchase_month, Validators.compose([])], // purchase_month: [data.purchase_month],
business_emi: [data.business_emi || 0], business_emi: [data.business_emi || 0],
business_emi_paid: [data.business_emi_paid || ''], business_emi_paid: [data.business_emi_paid || ''],
business_original_loan_tenure: [data.business_original_loan_tenure || ''], business_original_loan_tenure: [data.business_original_loan_tenure || ''],
@ -741,7 +771,7 @@ public m_investmentType = [];
switch (assets_details_mode) { switch (assets_details_mode) {
case '1': { case '1': {
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadPropertyWithData2(data)); control.push(this.loadPropertyWithData(data));
break; break;
} }
case '2': { case '2': {
@ -774,7 +804,7 @@ public m_investmentType = [];
} }
case '8': { case '8': {
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.otherAssetsDescriptionWithData(data)); control.push(this.otherBusinessAssetsDescriptionWithData(data));
break; break;
} }
default: { default: {
@ -791,7 +821,7 @@ public m_investmentType = [];
control.push(this.initDetails()); control.push(this.initDetails());
}else if(flag == 2){ }else if(flag == 2){
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details']; const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
control.push(this.initBusinessDetails()); control.push(this.initBusinessDetails(this.businessProfessionName));
} }
} }
removeLanguage(i: number,flag) { removeLanguage(i: number,flag) {

View File

@ -33,8 +33,7 @@
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.profession_name.value=='Others'"> <mat-form-field style="width: 45%;" *ngIf="businessForm.controls.profession_name.value=='Others'">
<input matInput placeholder="Other Name in Which The Business is Run" formControlName="profession_name_other" required> <input matInput placeholder="Other Name in Which The Business is Run" formControlName="profession_name_other" required>
</mat-form-field> </mat-form-field>
</div>
<div flexLayout="row wrap">
<mat-form-field style="width: 45%;"> <mat-form-field style="width: 45%;">
<mat-select placeholder="Business Entity Type" <mat-select placeholder="Business Entity Type"
formControlName="business_entity_type" required> formControlName="business_entity_type" required>
@ -44,6 +43,12 @@
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.business_entity_type.value=='Others'"> <mat-form-field style="width: 45%;" *ngIf="businessForm.controls.business_entity_type.value=='Others'">
<input matInput placeholder="Other Business Entity Type" formControlName="business_entity_type_other" required> <input matInput placeholder="Other Business Entity Type" formControlName="business_entity_type_other" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%">
<mat-select placeholder="Industry"
formControlName="industry">
<mat-option value="{{list.industry_classification_id}}" *ngFor="let list of industryData">{{list.name}}</mat-option>
</mat-select>
</mat-form-field>
</div> </div>
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none"> <!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field> <mat-form-field>
@ -54,12 +59,7 @@
</mat-form-field> </mat-form-field>
</div> --> </div> -->
<mat-form-field style="width: 45%">
<mat-select placeholder="Industry"
formControlName="industry">
<mat-option value="{{list.industry_classification_id}}" *ngFor="let list of industryData">{{list.name}}</mat-option>
</mat-select>
</mat-form-field>
<!--<mat-card> <!--<mat-card>
@ -242,7 +242,7 @@
<mat-card-content formArrayName="manufacturing_activity_details"> <mat-card-content formArrayName="manufacturing_activity_details">
<mat-card *ngFor="let manufacturing of businessForm.controls.manufacturing_activity_details['controls']; let m=index" [formGroupName]="m"> <mat-card *ngFor="let manufacturing of businessForm.controls.manufacturing_activity_details['controls']; let m=index" [formGroupName]="m">
<mat-card-content> <mat-card-content>
<mat-form-field style="width: 45%;"> <mat-form-field style="width: 35%;">
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required> <input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%;"> <mat-form-field style="width: 45%;">
@ -418,7 +418,7 @@
<mat-card-content formArrayName="wholesale_trading_activity_details"> <mat-card-content formArrayName="wholesale_trading_activity_details">
<mat-card *ngFor="let wholesale of businessForm.controls.wholesale_trading_activity_details['controls']; let w=index" [formGroupName]="w"> <mat-card *ngFor="let wholesale of businessForm.controls.wholesale_trading_activity_details['controls']; let w=index" [formGroupName]="w">
<mat-card-content> <mat-card-content>
<mat-form-field style="width: 45%;"> <mat-form-field style="width: 35%;">
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required> <input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%;"> <mat-form-field style="width: 45%;">

View File

@ -60,7 +60,8 @@ export class BusinessInfoComponent implements OnInit {
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.applicants = this.pd_all_details.pdapplicants_detials; this.applicants = this.pd_all_details.pdapplicants_detials;
this.form_id = 13; this.form_id = 13;
this.notifier = notifier; this.notifier = notifier;
} }
public viewerOptions: any = { public viewerOptions: any = {
navbar: false, navbar: false,
@ -971,7 +972,7 @@ export class BusinessInfoComponent implements OnInit {
filterCity(datasource: any,filterid:number) { filterCity(datasource: any,filterid:number) {
if(filterid){ if(filterid){
let filter = datasource.filter(x=>x.state_id==filterid); let filter = datasource.filter(x=>x.state_id==filterid);
return filter[0].cities; return filter.length > 0 ? filter[0].cities : [];
} }

View File

@ -17,7 +17,7 @@
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;">Raw Material #{{l+1}}</h6> <h6 style="margin: 12px;">Raw Material #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width:30%">
<mat-select placeholder="Manufacturing Product Name" formControlName="manufacturing_product_name"> <mat-select placeholder="Manufacturing Product Name" formControlName="manufacturing_product_name">
<mat-option *ngFor="let pm of m_manufacturingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_manufacturingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
@ -25,23 +25,23 @@
<!--<mat-form-field style="width: 100%"> <!--<mat-form-field style="width: 100%">
<input matInput placeholder="Raw Material Name" formControlName="manufacturing_raw_material_name"> <input matInput placeholder="Raw Material Name" formControlName="manufacturing_raw_material_name">
</mat-form-field>--> </mat-form-field>-->
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Client Name" formControlName="manufacturing_client_name"> <input matInput placeholder="Client Name" formControlName="manufacturing_client_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name"> <input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number"> <input matInput placeholder="Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type"> <mat-select placeholder="Payment Type" formControlName="manufacturing_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%" *ngIf="items.get('manufacturing_payment_type').value == 3"> <mat-form-field style="width: 30%" *ngIf="items.get('manufacturing_payment_type').value == 3">
<input matInput placeholder="Number of days of credit provided" formControlName="manufacturing_credit_days"> <input matInput placeholder="Number of days of credit provided" formControlName="manufacturing_credit_days">
</mat-form-field> </mat-form-field>
</div> </div>
@ -75,7 +75,7 @@
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;">Trading Product #{{l+1}}</h6> <h6 style="margin: 12px;">Trading Product #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<mat-select placeholder="Trading Product Name" formControlName="trade_product_name"> <mat-select placeholder="Trading Product Name" formControlName="trade_product_name">
<mat-option *ngFor="let pm of m_tradingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_tradingProducts[0]" [value]="pm.name">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
@ -83,23 +83,23 @@
<!--<mat-form-field style="width: 100%"> <!--<mat-form-field style="width: 100%">
<input matInput placeholder="Trade Product Name" formControlName="trade_product_name"> <input matInput placeholder="Trade Product Name" formControlName="trade_product_name">
</mat-form-field>--> </mat-form-field>-->
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Client Name" formControlName="trade_client_name"> <input matInput placeholder="Client Name" formControlName="trade_client_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name"> <input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number"> <input matInput placeholder="Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<mat-select placeholder="Payment Type" formControlName="trade_product_payment_type"> <mat-select placeholder="Payment Type" formControlName="trade_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%" *ngIf="items.get('trade_product_payment_type').value == 3"> <mat-form-field style="width: 30%" *ngIf="items.get('trade_product_payment_type').value == 3">
<input matInput placeholder="Number of days of credit provided" formControlName="trade_product_credit_days"> <input matInput placeholder="Number of days of credit provided" formControlName="trade_product_credit_days">
</mat-form-field> </mat-form-field>
</div> </div>
@ -142,18 +142,18 @@
<!--<mat-form-field style="width: 100%"> <!--<mat-form-field style="width: 100%">
<input matInput placeholder="Trade Product Name" formControlName="trade_product_name"> <input matInput placeholder="Trade Product Name" formControlName="trade_product_name">
</mat-form-field>--> </mat-form-field>-->
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Client Name" formControlName="service_provider_client_name"> <input matInput placeholder="Client Name" formControlName="service_provider_client_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Name" formControlName="service_provider_product_contact_person_name"> <input matInput placeholder="Contact Person Name" formControlName="service_provider_product_contact_person_name">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="service_provider_product_contact_person_mobile_number"> <input matInput placeholder="Contact Person Mobile Number" formControlName="service_provider_product_contact_person_mobile_number">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<mat-select placeholder="Payment Type" formControlName="service_provider_product_payment_type"> <mat-select placeholder="Payment Type" formControlName="service_provider_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>

View File

@ -22,7 +22,7 @@
<mat-card-content> <mat-card-content>
<mat-form-field style="width:60% !important;"> <mat-form-field style="width:60% !important;">
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Do you have any other existing loan" <mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Do you have any other existing loan"
formControlName="existing_loan" required> formControlName="existing_loan" >
<mat-option value="Yes">Yes</mat-option> <mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option> <mat-option value="No">No</mat-option>
</mat-select> </mat-select>
@ -38,45 +38,51 @@
<!-- {{frequencyData | json}} --> <!-- {{frequencyData | json}} -->
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select (selectionChange)="selectedfrequency($event.value,i)" placeholder="Frequency" <mat-select (selectionChange)="selectedfrequency($event.value,i)" placeholder="Frequency"
formControlName="frequency" required> formControlName="frequency" >
<mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option> <mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field *ngIf="details.get('frequency').value != ''" >
<input matInput [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Loan Type" formControlName="loan_type" required> <mat-select placeholder="Loan Type" formControlName="loan_type" >
<mat-option value="{{types.existing_loan_type_id}}" *ngFor="let types of loanTypeData">{{types.loan_type_name}}</mat-option>
</mat-select>
<!-- <input matInput autocomplete="off" placeholder="Loan Type" formControlName="loan_type" > -->
</mat-form-field>
<mat-form-field *ngIf="details.get('loan_type').value == 9 ">
<input matInput autocomplete="off" placeholder="Specify Others Loan Type" formControlName="others_loan_type">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" required> <mat-select placeholder="Loan Taken By" formControlName="loan_taken_by">
<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}}</mat-option>
<mat-option value="Others">Others</mat-option> <!-- <mat-option value= 0 >Others</mat-option> -->
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="details.get('loan_taken_by').value == 'Others'"> <mat-form-field *ngIf="details.get('loan_taken_by').value == 0">
<input matInput placeholder="Specify Others Loan Taken" formControlName="others_loan_taken"> <input matInput autocomplete="off" placeholder="Specify Others Loan Taken" formControlName="others_loan_taken">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Lender" formControlName="lender" required> <mat-select placeholder="Lender" formControlName="lender" >
<mat-option *ngFor="let btLen of lenderData" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option> <mat-option *ngFor="let btLen of lenderData" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="details.get('lender').value == 3"> <mat-form-field *ngIf="details.get('lender').value == 3">
<input matInput placeholder="Specify Others Loan Taken" formControlName="others_loan_taken"> <input matInput autocomplete="off" placeholder="Specify Others Lender" formControlName="others_lender" >
</mat-form-field> </mat-form-field>
<!-- <mat-form-field> <!-- <mat-form-field>
<input matInput placeholder="Lender" formControlName="lender" required> <input matInput autocomplete="off" placeholder="Lender" formControlName="lender" >
</mat-form-field> --> </mat-form-field> -->
<mat-form-field> <mat-form-field>
<input matInput placeholder="Original Tenure in Months" formControlName="original_tenure" required> <input matInput autocomplete="off" placeholder="Original Tenure in Months" formControlName="original_tenure" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" required> <input matInput autocomplete="off" placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" >
</mat-form-field> </mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Loan Details" matTooltipPosition="above" color="primary" (click)="addLoanDetails()" <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Loan Details" matTooltipPosition="above" color="primary" (click)="addLoanDetails()"
*ngIf="i==0"> *ngIf="i==0">
@ -210,7 +216,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left"> <div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%"> <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label> <mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="currentloan_remarks" required></textarea> <textarea matInput autocomplete="off" placeholder="Remarks" formControlName="currentloan_remarks" ></textarea>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="40" align="end"> <div fxFlex="40" align="end">
@ -231,7 +237,7 @@
<div fxFlex="60" class="pb-0 text-sm-left"> --> <div fxFlex="60" class="pb-0 text-sm-left"> -->
<!-- <mat-form-field style="width:60% !important;"> <!-- <mat-form-field style="width:60% !important;">
<mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Do you have any other existing loan" <mat-select (selectionChange)="selectedLoanChanges($event)" placeholder="Do you have any other existing loan"
formControlName="existing_loan" required> formControlName="existing_loan" >
<mat-option value="Yes">Yes</mat-option> <mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option> <mat-option value="No">No</mat-option>
</mat-select> </mat-select>
@ -250,45 +256,45 @@
<!-- {{frequencyData | json}} --> <!-- {{frequencyData | json}} -->
<!-- <mat-card-content class="matcard"> <!-- <mat-card-content class="matcard">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select (selectionChange)="selectedfrequency($event.value,i)" placeholder="Frequency" <mat-select (selectionChange)="selectedfrequency($event.value,i)" placeholder="Frequency"
formControlName="frequency" required> formControlName="frequency" >
<mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option> <mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Loan Type" formControlName="loan_type" required> <input matInput autocomplete="off" placeholder="Loan Type" formControlName="loan_type" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" required> <mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" >
<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}}</mat-option>
<mat-option value="Others">Others</mat-option> <mat-option value="Others">Others</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="details.get('loan_taken_by').value == 'Others'"> <mat-form-field *ngIf="details.get('loan_taken_by').value == 0">
<input matInput placeholder="Specify Others Loan Taken" formControlName="others_loan_taken"> <input matInput autocomplete="off" placeholder="Specify Others Loan Taken" formControlName="others_loan_taken">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Lender" formControlName="lender" required> <mat-select placeholder="Lender" formControlName="lender" >
<mat-option *ngFor="let btLen of lenderData" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option> <mat-option *ngFor="let btLen of lenderData" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="details.get('lender').value == 3"> <mat-form-field *ngIf="details.get('lender').value == 3">
<input matInput placeholder="Specify Others Loan Taken" formControlName="others_loan_taken"> <input matInput autocomplete="off" placeholder="Specify Others Loan Taken" formControlName="others_loan_taken">
</mat-form-field> --> </mat-form-field> -->
<!-- <mat-form-field> <!-- <mat-form-field>
<input matInput placeholder="Lender" formControlName="lender" required> <input matInput autocomplete="off" placeholder="Lender" formControlName="lender" >
</mat-form-field> --> </mat-form-field> -->
<!-- <mat-form-field> <!-- <mat-form-field>
<input matInput placeholder="Original Tenure in Months" formControlName="original_tenure" required> <input matInput autocomplete="off" placeholder="Original Tenure in Months" formControlName="original_tenure" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" required> <input matInput autocomplete="off" placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" >
</mat-form-field> </mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Loan Details" matTooltipPosition="above" color="primary" (click)="addLoanDetails()" <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Loan Details" matTooltipPosition="above" color="primary" (click)="addLoanDetails()"
*ngIf="i==0"> *ngIf="i==0">
@ -306,7 +312,7 @@
<div fxFlex="60" class="pb-0 text-sm-left"> <div fxFlex="60" class="pb-0 text-sm-left">
<mat-form-field appearance="outline" style="width: 100%"> <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label> <mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="currentloan_remarks" required></textarea> <textarea matInput autocomplete="off" placeholder="Remarks" formControlName="currentloan_remarks" ></textarea>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>

View File

@ -40,9 +40,11 @@ export class CurrentLoanComponent implements OnInit {
//@Input() applicant_details: any; //@Input() applicant_details: any;
lenderData: any = []; lenderData: any = [];
frequencyData: any = []; frequencyData: any = [];
loanTypeData: any = [];
applicants: any; applicants: any;
placeholderName : any = []; placeholderName : any = [];
IDXval : any; IDXval : any;
OtherFlag : boolean = false;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
@ -52,6 +54,7 @@ export class CurrentLoanComponent implements OnInit {
this.form_id = 8; this.form_id = 8;
this.notifier = notifier; this.notifier = notifier;
this.applicants = this.pd_all_details.pdapplicants_detials; this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
} }
public viewerOptions: any = { public viewerOptions: any = {
navbar: false, navbar: false,
@ -75,6 +78,7 @@ export class CurrentLoanComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.getMasterDetails('BTLENDERLIST',1); this.getMasterDetails('BTLENDERLIST',1);
this.getMasterDetails('FREQUENCY',2); this.getMasterDetails('FREQUENCY',2);
this.getMasterDetails('EXISTINGLOANTYPES',3);
this.initCurrentloanForm(); this.initCurrentloanForm();
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
@ -96,6 +100,7 @@ export class CurrentLoanComponent implements OnInit {
result.forEach((val,index) => { result.forEach((val,index) => {
control.push(this.createLoanDetail()); control.push(this.createLoanDetail());
this.selectedfrequency(val.frequency,index); this.selectedfrequency(val.frequency,index);
//this.selectedLoanTakenBy(val.loan_taken_by,index);
}); });
this.currentLoanForm.controls['loan_details'].setValue(result); this.currentLoanForm.controls['loan_details'].setValue(result);
} else { } else {
@ -103,28 +108,32 @@ export class CurrentLoanComponent implements OnInit {
} }
} }
} else { } else {
control.push(this.createLoanDetail()); // console.log('overall else');
// control.push(this.createLoanDetail());
} }
}) })
} }
public initCurrentloanForm(): void { public initCurrentloanForm(): void {
this.currentLoanForm = this.fb.group({ this.currentLoanForm = this.fb.group({
existing_loan: ['', Validators.compose([Validators.required])], existing_loan: [''],
currentloan_remarks: ['', Validators.compose([Validators.required])], currentloan_remarks: [''],
loan_details: this.fb.array([]), loan_details: this.fb.array([]),
}); });
} }
selectedLoanChanges(e): void { selectedLoanChanges(e): void {
console.log(e);
if (e.value == 'Yes') { if (e.value == 'Yes') {
// console.log('if()');
const control = <FormArray>this.currentLoanForm.controls['loan_details']; const control = <FormArray>this.currentLoanForm.controls['loan_details'];
control.push(this.createLoanDetail()); control.push(this.createLoanDetail());
} else if (e.value == 'No') { } else if (e.value == 'No') {
// console.log('else()');
const arr = <FormArray>this.currentLoanForm.controls.loan_details; const arr = <FormArray>this.currentLoanForm.controls.loan_details;
arr.removeAt(0); arr.removeAt(0);
} }
} }
selectedfrequency(e,i){ selectedfrequency(e,i){
switch(+e){ switch(+e){
@ -141,16 +150,17 @@ export class CurrentLoanComponent implements OnInit {
createLoanDetail() { createLoanDetail() {
return this.fb.group({ return this.fb.group({
loan_amount: ['', Validators.compose([Validators.required])], loan_amount: [''],
frequency:['', Validators.compose([Validators.required])], frequency:[''],
emi: ['', Validators.compose([Validators.required])], emi: [''],
loan_type: ['', Validators.compose([Validators.required])], loan_type: [''],
others_loan_type: [''],
loan_taken_by:[''], loan_taken_by:[''],
others_loan_taken:[''], others_loan_taken:[''],
lender: ['', Validators.compose([Validators.required])], lender: [''],
others_lender:[''], others_lender:[''],
original_tenure: ['', Validators.compose([Validators.required])], original_tenure: [''],
current_balance_tenure: ['', Validators.compose([Validators.required])], current_balance_tenure: [''],
}); });
} }
addLoanDetails() { addLoanDetails() {
@ -196,12 +206,15 @@ export class CurrentLoanComponent implements OnInit {
getMasterDetails(table:string,type:number){ getMasterDetails(table:string,type:number){
this._pd.getAllMasterDatas(table).subscribe(data => { this._pd.getAllMasterDatas(table).subscribe(data => {
data.records.forEach(val => { data.records.forEach(val => {
if (type==1 && val.isactive == 1) { if(type==1 && val.isactive == 1) {
this.lenderData.push(val); this.lenderData.push(val);
} }
else if(type==2 && val.isactive == 1){ else if(type==2 && val.isactive == 1){
this.frequencyData.push(val); this.frequencyData.push(val);
} }
else if(type==3 && val.isactive == 1){
this.loanTypeData.push(val);
}
}) })
}); });
} }
@ -214,4 +227,4 @@ export class CurrentLoanComponent implements OnInit {
event.preventDefault(); event.preventDefault();
} }
} }
} }

View File

@ -74,32 +74,34 @@
<mat-card-header> <mat-card-header>
<p>Salary Details<p> <p>Salary Details<p>
</mat-card-header> </mat-card-header>
<mat-card-content class="matcard"> <mat-card-content>
<mat-form-field> <div fxLayout="row wrap">
<div fxFlex="100">
<mat-form-field style="width: 33%">
<input matInput placeholder="Date of Salary" formControlName="which_date_the_salary_is_rcv" type="number" min='1' max='31'> <input matInput placeholder="Date of Salary" formControlName="which_date_the_salary_is_rcv" type="number" min='1' max='31'>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width: 33%">
<input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" (keypress)="keyPress($event)" required> <input matInput placeholder="Gross Monthly Salary" formControlName="gross_monthly_salary" (keypress)="keyPress($event)" required>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width:33%">
<input matInput placeholder="Net Monthly Salary" <input matInput placeholder="Net Monthly Salary"
formControlName="net_monthly_salary" (keypress)="keyPress($event)" required> formControlName="net_monthly_salary" (keypress)="keyPress($event)" required>
<!-- <input matInput placeholder="Net Take Home" <!-- <input matInput placeholder="Net Take Home"
formControlName="net_take_home"> --> formControlName="net_take_home"> -->
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width: 33%">
<input matInput placeholder="Bonus or Incentive" <input matInput placeholder="Bonus or Incentive"
formControlName="bonus_incentive" (keypress)="keyPress($event)" required> formControlName="bonus_incentive" (keypress)="keyPress($event)" required>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' "> <mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
<mat-select placeholder="Bonus Frequency" formControlName="bonus_frequency"> <mat-select placeholder="Bonus Frequency" formControlName="bonus_frequency">
<mat-option *ngFor="let fd of frequency_data" [value]="fd.frequency_id">{{ fd.name }}</mat-option> <mat-option *ngFor="let fd of frequency_data" [value]="fd.frequency_id">{{ fd.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' "> <mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_incentive'].value != '' && employmentForm.controls['bonus_incentive'].value != '0' ">
<mat-select placeholder="Type of Bonus" <mat-select placeholder="Type of Bonus"
formControlName="bonus_type"> formControlName="bonus_type">
<mat-option value="fixed">Fixed</mat-option> <mat-option value="fixed">Fixed</mat-option>
@ -107,10 +109,10 @@
<mat-option value="others">Others</mat-option> <mat-option value="others">Others</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="employmentForm.controls['bonus_type'].value == 'others'"> <mat-form-field style="width: 33%" *ngIf="employmentForm.controls['bonus_type'].value == 'others'">
<input matInput placeholder="Bonus Type Others" formControlName="bonus_type_other"> <input matInput placeholder="Bonus Type Others" formControlName="bonus_type_other">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width: 33%">
<mat-select placeholder="Any Delays" <mat-select placeholder="Any Delays"
formControlName="any_delays"> formControlName="any_delays">
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
@ -119,6 +121,8 @@
<!-- <input matInput placeholder="Any Delays" <!-- <input matInput placeholder="Any Delays"
formControlName="any_delays"> --> formControlName="any_delays"> -->
</mat-form-field> </mat-form-field>
</div>
</div>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</mat-card> </mat-card>

View File

@ -23,11 +23,11 @@
<p>Data as Per Financial Statements<p> <p>Data as Per Financial Statements<p>
</mat-card-header> </mat-card-header>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Starting Financial Year" formControlName="staring_financial_year" required> <input matInput autocomplete="off" placeholder="Starting Year Of Financial" formControlName="staring_financial_year" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Total Financial Year" formControlName="total_financial_year" required (change)="dynamicalFinYear($event)"> <input matInput autocomplete="off" placeholder="Number of Year in Financial" formControlName="total_financial_year" (change)="dynamicalFinYear($event)">
</mat-form-field> </mat-form-field>
<div *ngIf="total_financial_year != ''" formArrayName="date_per_financial"> <div *ngIf="total_financial_year != ''" formArrayName="date_per_financial">
<!-- <div formArrayName="date_per_financial"> --> <!-- <div formArrayName="date_per_financial"> -->
@ -35,45 +35,45 @@
[formGroupName]="i"> [formGroupName]="i">
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field> <mat-form-field>
<!-- <input matInput placeholder="Year (format: 2015-16)" formControlName="financial_year" required> --> <!-- <input matInput autocomplete="off" placeholder="Year (format: 2015-16)" formControlName="financial_year" > -->
<input matInput placeholder="Latest Financial Year" formControlName="financial_year" required> <input matInput autocomplete="off" placeholder="Latest Financial Year" formControlName="financial_year" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<!-- <input matInput placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calMargin(i, details)" type="number" required> --> <!-- <input matInput autocomplete="off" placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calMargin(i, details)" type="number" > -->
<input matInput placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calMargin(i, details)" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calMargin(i, details)" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<!-- <input matInput placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" required> --> <!-- <input matInput autocomplete="off" placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" > -->
<mat-select placeholder="Is there Net Profit or Net Loss?" formControlName="finanical_profit_or_loss" required> <mat-select placeholder="Is there Net Profit or Net Loss?" formControlName="finanical_profit_or_loss" >
<mat-option value="1" >Net Profit</mat-option> <mat-option value="1" >Net Profit</mat-option>
<mat-option value="2" >Net Loss</mat-option> <mat-option value="2" >Net Loss</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="details.get('finanical_profit_or_loss').value == 1 "> <span *ngIf="details.get('finanical_profit_or_loss').value == 1 ">
<mat-form-field> <mat-form-field>
<!-- <input matInput placeholder="Net Profit to Sales %" formControlName="financial_margin" (keypress)="keyPress($event)" required> --> <!-- <input matInput autocomplete="off" placeholder="Net Profit to Sales %" formControlName="financial_margin" (keypress)="keyPress($event)" > -->
<input matInput placeholder="Net Profit Amount" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Net Profit Amount" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Net Profit to Sales %" formControlName="financial_margin_of_profit" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Net Profit to Sales %" formControlName="financial_margin_of_profit" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
</span> </span>
<span *ngIf="details.get('finanical_profit_or_loss').value == 2 "> <span *ngIf="details.get('finanical_profit_or_loss').value == 2 ">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Net Loss Amount" formControlName="financial_net_loss" (change)="calMargin( i, details); calYearVariation( i, details)" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Net Loss Amount" formControlName="financial_net_loss" (change)="calMargin( i, details); calYearVariation( i, details)" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Net Loss to Sales %" formControlName="financial_margin_of_loss" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Net Loss to Sales %" formControlName="financial_margin_of_loss" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
</span> </span>
<mat-form-field *ngIf="i != 0" style="width:65%"> <mat-form-field *ngIf="i != 0" style="width:65%">
<input matInput [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Variation from Previous Year" formControlName="financial_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Variation from Previous Year" formControlName="financial_variation" (keypress)="keyPress($event)">
<!-- <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="end" *ngIf="i != 0" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" >{{SalesStatement[i]}}</mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="customerCommentsFlag" style="width:65%"> <mat-form-field *ngIf="customerCommentsFlag" style="width:65%">
<!-- <input matInput placeholder="Reason For Major Difference" formControlName="financial_reason" required> --> <!-- <input matInput autocomplete="off" placeholder="Reason For Major Difference" formControlName="financial_reason" > -->
<input matInput placeholder="Customer Comments on variances in Financials" formControlName="financial_reason" required> <input matInput autocomplete="off" placeholder="Customer Comments on variances in Financials" formControlName="financial_reason" >
</mat-form-field> </mat-form-field>
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addDate()" <!-- <button type="button" mat-raised-button mat-icon-button (click)="addDate()"
@ -109,43 +109,43 @@
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field> <mat-form-field>
<!-- <input matInput placeholder="Year (format: 2015-16)" formControlName="estimate_year" required> --> <!-- <input matInput autocomplete="off" placeholder="Year (format: 2015-16)" formControlName="estimate_year" > -->
<input matInput placeholder="Year" formControlName="estimate_year" required> <input matInput autocomplete="off" placeholder="Year" formControlName="estimate_year" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Annual Sale" formControlName="estimate_annual_sale" (change)="calMarginVal( i, details)" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Annual Sale" formControlName="estimate_annual_sale" (change)="calMarginVal( i, details)" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<!-- <input matInput placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" required> --> <!-- <input matInput autocomplete="off" placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" > -->
<mat-select placeholder="Is there Net Profit or Net Loss?" formControlName="estimate_profit_or_loss" required> <mat-select placeholder="Is there Net Profit or Net Loss?" formControlName="estimate_profit_or_loss" >
<mat-option value="1" >Net Profit</mat-option> <mat-option value="1" >Net Profit</mat-option>
<mat-option value="2" >Net Loss</mat-option> <mat-option value="2" >Net Loss</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="details.get('estimate_profit_or_loss').value == 1 "> <span *ngIf="details.get('estimate_profit_or_loss').value == 1 ">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Net Profit Amount" formControlName="estimate_net_profit" (change)="calMarginVal( i, details); calVariation( i, details)" required> <input matInput autocomplete="off" placeholder="Net Profit Amount" formControlName="estimate_net_profit" (change)="calMarginVal( i, details); calVariation( i, details)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput disabled placeholder="Margin" formControlName="estimate_margin_of_profit" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" disabled placeholder="Margin" formControlName="estimate_margin_of_profit" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
</span> </span>
<span *ngIf="details.get('estimate_profit_or_loss').value == 2 "> <span *ngIf="details.get('estimate_profit_or_loss').value == 2 ">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Net Loss" formControlName="estimate_net_loss" (change)="calMarginVal( i, details); calVariation( i, details)" required> <input matInput autocomplete="off" placeholder="Net Loss" formControlName="estimate_net_loss" (change)="calMarginVal( i, details); calVariation( i, details)" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput disabled placeholder="Margin" formControlName="estimate_margin_of_loss" (keypress)="keyPress($event)" (change)="calAmount( i, details); calVariation( i, details)" required> <input matInput autocomplete="off" disabled placeholder="Margin" formControlName="estimate_margin_of_loss" (keypress)="keyPress($event)" (change)="calAmount(i, details); calVariation( i, details)" >
</mat-form-field> </mat-form-field>
</span> </span>
<mat-form-field *ngIf="i != 0" style="width:65%"> <mat-form-field *ngIf="i != 0" style="width:65%">
<input matInput [ngClass]="{'highlight': details.controls['estimate_variation'].value >= 40 || details.controls['estimate_variation'].value >= -40}" placeholder="Variation from Previous Year" formControlName="estimate_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" [ngClass]="{'highlight': details.controls['estimate_variation'].value >= 40 || details.controls['estimate_variation'].value >= -40}" placeholder="Variation from Previous Year" formControlName="estimate_variation" (keypress)="keyPress($event)">
<mat-hint align="end" [ngClass]="{'highlight': (details.controls['estimate_variation'].value >= 40) || (details.controls['estimate_variation'].value < -40)}" > {{details.controls['estimate_variation'].value}} {{details.controls['estimate_year'].value}} <mat-hint align="end" [ngClass]="{'highlight': (details.controls['estimate_variation'].value >= 40) || (details.controls['estimate_variation'].value < -40)}" > {{details.controls['estimate_variation'].value}} {{details.controls['estimate_year'].value}}
<!-- 'details.controls['estimate_variation'].value <= 0' ? 'Decreases ' : 'Increases ' + 'in Sales in FY ' + curr_year + ' Over Sales in FY '+ prev_year + ' is ' + {{details.controls['estimate_variation'].value}} + '%'; --> <!-- 'details.controls['estimate_variation'].value <= 0' ? 'Decreases ' : 'Increases ' + 'in Sales in FY ' + curr_year + ' Over Sales in FY '+ prev_year + ' is ' + {{details.controls['estimate_variation'].value}} + '%'; -->
</mat-hint> </mat-hint>
</mat-form-field> </mat-form-field>
<!--<mat-form-field> <!--<mat-form-field>
<input matInput placeholder="Reason For Major Difference" formControlName="estimate_reason" required> <input matInput autocomplete="off" placeholder="Reason For Major Difference" formControlName="estimate_reason" >
</mat-form-field>--> </mat-form-field>-->
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods()" <!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods()"
matTooltip="Add More Estimated Value" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0"> matTooltip="Add More Estimated Value" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0">
@ -269,7 +269,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left"> <div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%"> <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label> <mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="financial_remarks" required></textarea> <textarea matInput autocomplete="off" placeholder="Remarks" formControlName="financial_remarks" ></textarea>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="40" align="end"> <div fxFlex="40" align="end">
@ -295,22 +295,22 @@
[formGroupName]="i"> [formGroupName]="i">
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Year (format: 2015-16)" formControlName="financial_year" required> <input matInput autocomplete="off" placeholder="Year (format: 2015-16)" formControlName="financial_year" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calMargin(i, details)" type="number" required> <input matInput autocomplete="off" placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calMargin(i, details)" type="number" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" required> <input matInput autocomplete="off" placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Net Profit to Sales %" formControlName="financial_margin" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Net Profit to Sales %" formControlName="financial_margin" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="i != 0"> <mat-form-field *ngIf="i != 0">
<input matInput [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Variation from Previous Year" formControlName="financial_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Variation from Previous Year" formControlName="financial_variation" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Reason For Major Difference" formControlName="financial_reason" required> <input matInput autocomplete="off" placeholder="Reason For Major Difference" formControlName="financial_reason" >
</mat-form-field> </mat-form-field>
<button type="button" mat-raised-button mat-icon-button (click)="addDate()" <button type="button" mat-raised-button mat-icon-button (click)="addDate()"
@ -334,22 +334,22 @@
[formGroupName]="i"> [formGroupName]="i">
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field> <mat-form-field>
<input matInput placeholder="Year (format: 2015-16)" formControlName="estimate_year" required> <input matInput autocomplete="off" placeholder="Year (format: 2015-16)" formControlName="estimate_year" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Annual Sale" formControlName="estimate_annual_sale" (change)="calMarginVal( i, details)" type="number" required> <input matInput autocomplete="off" placeholder="Annual Sale" formControlName="estimate_annual_sale" (change)="calMarginVal( i, details)" type="number" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Net Profit / Loss" formControlName="estimate_net_profit" (change)="calMarginVal( i, details); calVariation( i, details)" type="number" required> <input matInput autocomplete="off" placeholder="Net Profit / Loss" formControlName="estimate_net_profit" (change)="calMarginVal( i, details); calVariation( i, details)" type="number" >
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput disabled placeholder="Margin" formControlName="estimate_margin" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" disabled placeholder="Margin" formControlName="estimate_margin" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="i != 0"> <mat-form-field *ngIf="i != 0">
<input matInput [ngClass]="{'highlight': details.controls['estimate_variation'].value >= 40 || details.controls['estimate_variation'].value >= -40}" placeholder="Variation from Previous Year" formControlName="estimate_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" [ngClass]="{'highlight': details.controls['estimate_variation'].value >= 40 || details.controls['estimate_variation'].value >= -40}" placeholder="Variation from Previous Year" formControlName="estimate_variation" (keypress)="keyPress($event)">
</mat-form-field> </mat-form-field>
<!--<mat-form-field> <!--<mat-form-field>
<input matInput placeholder="Reason For Major Difference" formControlName="estimate_reason" required> <input matInput autocomplete="off" placeholder="Reason For Major Difference" formControlName="estimate_reason" >
</mat-form-field>--> </mat-form-field>-->
<!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods()" <!-- <button type="button" mat-raised-button mat-icon-button (click)="addGoods()"
matTooltip="Add More Estimated Value" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0"> matTooltip="Add More Estimated Value" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0">
@ -367,7 +367,7 @@
<div fxFlex="60" class="pb-0 text-sm-left"> <div fxFlex="60" class="pb-0 text-sm-left">
<mat-form-field appearance="outline" style="width: 100%"> <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label> <mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="financial_remarks" required></textarea> <textarea matInput autocomplete="off" placeholder="Remarks" formControlName="financial_remarks" ></textarea>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>

View File

@ -119,9 +119,9 @@ export class FinancialInfoComponent implements OnInit {
pdid: this.pdid, pdid: this.pdid,
formid: this.form_id, formid: this.form_id,
fk_createdby: this.pdid, fk_createdby: this.pdid,
financial_remarks: ['', Validators.compose([Validators.required])], financial_remarks: [''],
staring_financial_year : ['', Validators.compose([Validators.required])], staring_financial_year : [''],
total_financial_year : ['', Validators.compose([Validators.required])], total_financial_year : [''],
same_as_financial_statements:[''], same_as_financial_statements:[''],
date_per_financial: this.fb.array([]), date_per_financial: this.fb.array([]),
estimated_value: this.fb.array([]) estimated_value: this.fb.array([])
@ -132,36 +132,36 @@ export class FinancialInfoComponent implements OnInit {
// financial_year: ['', Validators.compose([Validators.required, Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])], // financial_year: ['', Validators.compose([Validators.required, Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])],
// financial_annual_sale: ['', Validators.compose([Validators.required, Validators.pattern(/^[0-9\(\)]+$/)])], // financial_annual_sale: ['', Validators.compose([Validators.required, Validators.pattern(/^[0-9\(\)]+$/)])],
// financial_net_profit: ['', Validators.compose([Validators.required, Validators.pattern(/^-?[1-9]\d*|0$/)])], // financial_net_profit: ['', Validators.compose([Validators.required, Validators.pattern(/^-?[1-9]\d*|0$/)])],
// financial_margin: ['', Validators.compose([Validators.required])], // financial_margin: [''],
// financial_variation: [''], // financial_variation: [''],
// financial_reason: ['', Validators.compose([Validators.required])], // financial_reason: [''],
// }); // });
// } // }
createDate(date) { createDate(date) {
return this.fb.group({ return this.fb.group({
financial_year: [date, Validators.compose([Validators.required, Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])], financial_year: [date, Validators.compose([Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])],
financial_annual_sale: ['', Validators.compose([Validators.required, Validators.pattern(/^[0-9\(\)]+$/)])], financial_annual_sale: ['', Validators.compose([Validators.pattern(/^[0-9\(\)]+$/)])],
finanical_profit_or_loss:['', Validators.compose([Validators.required])], finanical_profit_or_loss:[''],
financial_net_profit: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])], financial_net_profit: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
financial_net_loss: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])], financial_net_loss: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
financial_margin_of_profit: [''], financial_margin_of_profit: [''],
financial_margin_of_loss: [''], financial_margin_of_loss: [''],
financial_variation: [''], financial_variation: [''],
financial_reason: ['', Validators.compose([Validators.required])], financial_reason: [''],
}); });
} }
createValue(date) { createValue(date) {
return this.fb.group({ return this.fb.group({
estimate_year: [date, Validators.compose([Validators.required, Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])], estimate_year: [date, Validators.compose([Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])],
estimate_annual_sale: ['', Validators.compose([Validators.required, Validators.pattern(/^[0-9\(\)]+$/)])], estimate_annual_sale: ['', Validators.compose([Validators.pattern(/^[0-9\(\)]+$/)])],
estimate_profit_or_loss:['', Validators.compose([Validators.required])], estimate_profit_or_loss:[''],
estimate_net_profit: ['', Validators.compose([Validators.required, Validators.pattern(/^-?[1-9]\d*|0$/)])], estimate_net_profit: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
estimate_net_loss: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])], estimate_net_loss: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
//estimate_margin: ['', Validators.compose([Validators.required])], //estimate_margin: [''],
estimate_margin_of_profit: [''], estimate_margin_of_profit: [''],
estimate_margin_of_loss: [''], estimate_margin_of_loss: [''],
estimate_variation: [''], estimate_variation: [''],
// estimate_reason: ['', Validators.compose([Validators.required])], // estimate_reason: [''],
}); });
} }
@ -169,14 +169,14 @@ export class FinancialInfoComponent implements OnInit {
return this.fb.group({ return this.fb.group({
estimate_year: [value.estimate_year, Validators.compose([Validators.required, Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])], estimate_year: [value.estimate_year, Validators.compose([Validators.required, Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])],
estimate_annual_sale: [value.estimate_annual_sale, Validators.compose([Validators.required, Validators.pattern(/^[0-9\(\)]+$/)])], estimate_annual_sale: [value.estimate_annual_sale, Validators.compose([Validators.required, Validators.pattern(/^[0-9\(\)]+$/)])],
estimate_profit_or_loss:[value.estimate_profit_or_loss, Validators.compose([Validators.required])], estimate_profit_or_loss:[value.estimate_profit_or_loss],
estimate_net_loss: [value.estimate_net_loss, Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])], estimate_net_loss: [value.estimate_net_loss, Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
estimate_net_profit: [value.estimate_net_profit, Validators.compose([Validators.required, Validators.pattern(/^-?[1-9]\d*|0$/)])], estimate_net_profit: [value.estimate_net_profit, Validators.compose([Validators.required, Validators.pattern(/^-?[1-9]\d*|0$/)])],
//estimate_margin: [value., Validators.compose([Validators.required])], //estimate_margin: [value.],
estimate_margin_of_profit: [value.estimate_margin_of_profit], estimate_margin_of_profit: [value.estimate_margin_of_profit],
estimate_margin_of_loss: [value.estimate_margin_of_loss], estimate_margin_of_loss: [value.estimate_margin_of_loss],
estimate_variation: [value.estimate_variation], estimate_variation: [value.estimate_variation],
// estimate_reason: ['', Validators.compose([Validators.required])], // estimate_reason: [''],
}); });
} }

View File

@ -35,8 +35,9 @@
<mat-card-title>{{relation.controls.applicant_name.value | titlecase}}</mat-card-title> <mat-card-title>{{relation.controls.applicant_name.value | titlecase}}</mat-card-title>
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<mat-form-field style="width: 50%" *ngIf="relation.controls.company_name.value"> <mat-form-field style="width: 50%" *ngIf="relation.controls.company_name.value">
<input matInput placeholder="Company / Firm" formControlName="company_name" type="text"> <input matInput placeholder="Company / Firm" formControlName="company_name" [readonly]="true" type="text">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 40%" *ngIf="relation.controls.company_name.value"> <mat-form-field style="width: 40%" *ngIf="relation.controls.company_name.value">
<mat-select placeholder="Relation" formControlName="company_relationship"> <mat-select placeholder="Relation" formControlName="company_relationship">
@ -66,7 +67,17 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<div align="end" *ngIf="relation.controls.pd_co_applicant_id.value==0">
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeOthers(r,relation.value)"
matTooltip="Delete" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</div>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</div> </div>
</div> </div>

View File

@ -127,7 +127,7 @@ export class GeneralInfoComponent implements OnInit {
return this._fb.group({ return this._fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id], pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_name: [elementValue.applicant_name], applicant_name: [elementValue.applicant_name],
company_name: [elementValue.company_name], company_name: [elementValue.company_name,],
exist_status:[elementValue.exist_status==1 && elementValue.pd_co_applicant_id > 0 ? true : false] exist_status:[elementValue.exist_status==1 && elementValue.pd_co_applicant_id > 0 ? true : false]
}); });
} }
@ -192,6 +192,18 @@ export class GeneralInfoComponent implements OnInit {
} }
} }
// remove other details
removeOthers(index, item: any){
console.log(item)
if(item.pd_co_applicant_id==0){
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
relationControl.removeAt(index);
// remove related to details
let pos_name=this.fetch_related_details.indexOf(item.applicant_name);
this.fetch_related_details.splice(pos_name, 1);
}
}
// submit form details // submit form details
submitGeneralForm(formData:any) { submitGeneralForm(formData:any) {
if (this._generalForm.invalid) { if (this._generalForm.invalid) {

View File

@ -17,11 +17,15 @@
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">
<mat-card> <mat-card>
<mat-form-field style="width: 25%"> <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"> <input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 25%"> </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" required>
<mat-option *ngFor="let enduse of m_endUseofLoad" [value]="enduse.subproduct_id">{{ enduse.name }}</mat-option> <mat-option *ngFor="let enduse of m_endUseofLoad" [value]="enduse.subproduct_id">{{ enduse.name }}</mat-option>
</mat-select> </mat-select>
@ -37,52 +41,64 @@
<mat-option value="other">Other purpose</mat-option> <mat-option value="other">Other purpose</mat-option>
</mat-select>--> </mat-select>-->
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="isOtherPurpose" style="width: 25%"> </div>
<div fxFlex="33">
<mat-form-field *ngIf="isOtherPurpose" style="width: 80%">
<input matInput placeholder="Specify End Use" formControlName="end_use_other" autocomplete="off"> <input matInput placeholder="Specify End Use" formControlName="end_use_other" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 30%"> </div>
</div>
<div fxLayout="row wrap">
<div fxFlex="33">
<mat-form-field style="width: 80%">
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)" <mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)"
formControlName="is_transfer" required > formControlName="is_transfer" required >
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div>
</div>
<div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''"> <div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
<mat-form-field style="width: 50%"> <mat-form-field style="width: 60%">
<input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off"> <input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:20%"> <mat-form-field style="width:30%">
<mat-select placeholder="Is there a Top Up" <mat-select placeholder="Is there a Top Up"
formControlName="is_topup" required> formControlName="is_topup" required>
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 50%"> <mat-form-field style="width: 60%">
<mat-select placeholder="Lender from where balance transfer done" <mat-select placeholder="Lender from where balance transfer done"
formControlName="lender"> formControlName="lender">
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option> <mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 3" style="width: 25%"> <mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 3" style="width: 30%">
<input matInput placeholder="Specify Others Lender" formControlName="other_bt_lender" autocomplete="off"> <input matInput placeholder="Specify Others Lender" formControlName="other_bt_lender" autocomplete="off">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 20%"> <mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 60%">
<input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)" autocomplete="off"> <input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' "> <div *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' ">
<mat-form-field style="width: 35%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)" autocomplete="off"> <input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)" autocomplete="off">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 35%"> <mat-form-field style="width: 30%">
<mat-select placeholder="Source" formControlName="source" required> <mat-select placeholder="Source" formControlName="source" required>
<mat-option *ngFor="let sour of m_sourceofamount" [value]="sour.id">{{ sour.name }}</mat-option> <mat-option *ngFor="let sour of m_sourceofamount" [value]="sour.id">{{ sour.name }}</mat-option>
</mat-select> </mat-select>
@ -102,7 +118,7 @@
</div> </div>
<mat-form-field style="width: 50%"> <mat-form-field style="width: 30%">
<input matInput placeholder="EMI Comfort Level" formControlName="emi_level" (keypress)="keyPress($event)" required autocomplete="off"> <input matInput placeholder="EMI Comfort Level" formControlName="emi_level" (keypress)="keyPress($event)" required autocomplete="off">
</mat-form-field> </mat-form-field>
<!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> --> <!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> -->

View File

@ -378,10 +378,10 @@ getM_sourceofamount() {
} }
submitLoanDetails() { submitLoanDetails() {
console.log('formData', this.loanDetailsForm.value); console.log('formData', this.loanDetailsForm.value);
if (!this.loanDetailsForm.valid) { // if (!this.loanDetailsForm.valid) {
//this.notifier.notify('warning', 'Form Invaild Check all requried Field .!'); // //this.notifier.notify('warning', 'Form Invaild Check all requried Field .!');
return; // return;
} // }
let records: any = {}; let records: any = {};
records.pdid = this.pdid; records.pdid = this.pdid;
records.formid = this.form_id; records.formid = this.form_id;

View File

@ -57,11 +57,15 @@
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<input matInput placeholder="Name" formControlName="reference_name" type="text"> <input matInput placeholder="Name" formControlName="reference_name" type="text">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 24%">
<input matInput placeholder="Mobile Number" formControlName="mobile" type="text" (keypress)="keyPress($event)"> <input matInput placeholder="Mobile Number" formControlName="mobile" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="reference['controls'].mobile.hasError('maxlength') || reference['controls'].mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error> <mat-error *ngIf="reference['controls'].mobile.hasError('maxlength') || reference['controls'].mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 10%">
<input matInput placeholder="STD" formControlName="std_code" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="reference['controls'].std_code.hasError('maxlength') || reference['controls'].std_code.hasError('minlength')">Enter Valid STD Code. </mat-error>
</mat-form-field><span>-</span>
<mat-form-field style="width: 20%">
<input matInput placeholder="Landline Number" formControlName="landline" type="text" (keypress)="keyPress($event)"> <input matInput placeholder="Landline Number" formControlName="landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="reference['controls'].landline.hasError('maxlength') || reference['controls'].landline.hasError('minlength')">Enter Valid Landline Number. </mat-error> <mat-error *ngIf="reference['controls'].landline.hasError('maxlength') || reference['controls'].landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
</mat-form-field> </mat-form-field>
@ -77,7 +81,7 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%" *ngIf="reference.controls.relationship_with.value==5"> <mat-form-field style="width: 30%" *ngIf="reference.controls.relationship_with.value==5">
<input matInput placeholder="Others" formControlName="others" type="text"> <input matInput placeholder="Others" formControlName="others" type="text">
</mat-form-field> </mat-form-field>
<p #period_paragraph>Period of Relationship</p> <p #period_paragraph>Period of Relationship</p>

View File

@ -16,7 +16,7 @@ export class NeighbourHoodComponent implements OnInit {
form_id:number; form_id:number;
private notifier: NotifierService; private notifier: NotifierService;
check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}] check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}]
default_reference_details: any= {'reference_name':'','mobile':'','landline':'','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''}; default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''};
default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know':'','is_applicant_owner':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know':'','is_applicant_owner':''};
busineesRelationshipList:any=[]; busineesRelationshipList:any=[];
@ -128,10 +128,14 @@ export class NeighbourHoodComponent implements OnInit {
// create reference check form array // create reference check form array
createReerenceCheck(elementValue:any){ createReerenceCheck(elementValue:any){
let stdcodesearch = elementValue.landline.search("-");
let stdcode = elementValue.landline.substr(0,stdcodesearch);
let landline = elementValue.landline.substr(+stdcodesearch + 1,8);
return this._fb.group({ return this._fb.group({
reference_name: [elementValue.reference_name, Validators.required], reference_name: [elementValue.reference_name, Validators.required],
mobile: [elementValue.mobile,Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(10)])], mobile: [elementValue.mobile,Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(10)])],
landline: [elementValue.landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], 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], location:[elementValue.location,Validators.required],
relationship_with:[elementValue.relationship_with,Validators.required], relationship_with:[elementValue.relationship_with,Validators.required],
others: [elementValue.others], others: [elementValue.others],
@ -217,7 +221,7 @@ export class NeighbourHoodComponent implements OnInit {
referencecheck_list.push({ referencecheck_list.push({
"reference_name":element.reference_name, "reference_name":element.reference_name,
"mobile":element.mobile, "mobile":element.mobile,
"landline":element.landline, "landline":element.std_code+'-'+element.landline,
"location":element.location, "location":element.location,
"relationship_with":element.relationship_with, "relationship_with":element.relationship_with,
"others":element.others, "others":element.others,

View File

@ -104,7 +104,7 @@ public viewerOptions: any = {
} }
} }
} else { } else {
control.push(this.createDetail()); //control.push(this.createDetail());
} }
}) })
} }

View File

@ -27,43 +27,43 @@
<mat-card-title> <p>{{a+1}} . Raw Material </p> </mat-card-title> <mat-card-title> <p>{{a+1}} . Raw Material </p> </mat-card-title>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Name" formControlName="raw_name" required> <input matInput autocomplete="off" placeholder="Name" formControlName="raw_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Stock is Observed ?" formControlName="stock_observed" required> <mat-select placeholder="is the Stock is Observed ?" formControlName="stock_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="mrm.get('stock_observed').value == 'no'" > <span *ngIf="mrm.get('stock_observed').value == 'no'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Estimated Quantity" formControlName="raw_quantity" required> <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="raw_quantity" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="Unit of Mearsurement" <mat-select placeholder="Unit of Mearsurement"
formControlName="raw_uom" required> formControlName="raw_uom" >
<mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option> <mat-option value="{{uom.uom_id}}" *ngFor="let uom of uomData">{{uom.name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="mrm.get('raw_uom').value == 61" style="width:30%"> <mat-form-field *ngIf="mrm.get('raw_uom').value == 61" style="width:30%">
<input matInput placeholder="Specify Other UOM" formControlName="other_uom" required> <input matInput autocomplete="off" placeholder="Specify Other UOM" formControlName="other_uom" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" required> <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;"}} {{rawValueInWords}} Only</mat-hint> (keyup)="inWords($event,1)" --> <mat-hint align="end" *ngIf="mrm.get('raw_value').value != ''">{{"&#8377;"}} {{M_rawValueInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw" required> <mat-select placeholder="Is the stock of Raw Materials observed, sufficient considering the size of operations" formControlName="is_sufficiant_raw" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="mrm.get('is_sufficiant_raw').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="mrm.get('is_sufficiant_raw').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the stock level observed?</mat-label> <mat-label>Please comment on the stock level observed?</mat-label>
<textarea matInput placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the stock level observed" formControlName="rawmaterial_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
<button type="button" mat-raised-button mat-icon-button (click)="addRawMaterials(1)" <button type="button" mat-raised-button mat-icon-button (click)="addRawMaterials(1)"
@ -83,34 +83,34 @@
<mat-card-title> <p> {{b+1}} Finished Goods </p> </mat-card-title> <mat-card-title> <p> {{b+1}} Finished Goods </p> </mat-card-title>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Name" formControlName="goods_name" required> <input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" required> <mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="mfg.get('goods_observed').value == 'no'" > <span *ngIf="mfg.get('goods_observed').value == 'no'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Estimated Quantity" formControlName="goods_quantity" required> <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required> <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;"}} {{goodsValueInWords}} Only</mat-hint> (keyup)="inWords($event,2)" --> <mat-hint align="end" *ngIf="mfg.get('goods_value').value != ''">{{"&#8377;"}} {{M_goodsValueInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required> <mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="mfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%"> <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>Please comment on the finished goods stock level observed?</mat-label>
<textarea matInput placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -131,35 +131,35 @@
<mat-card-title> <p>{{c+1}} Traded Goods </p> </mat-card-title> <mat-card-title> <p>{{c+1}} Traded Goods </p> </mat-card-title>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Name" formControlName="traded_goods_name" required> <input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" required > <mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="mtg.get('traded_goods_observed').value == 'no'" > <span *ngIf="mtg.get('traded_goods_observed').value == 'no'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Estimated Quantity" formControlName="traded_goods_quantity" required> <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required> <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;"}} {{tradedGoodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,3)" --> <mat-hint align="end" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{M_tradedGoodsValueInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<!-- <input matInput placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required> --> <!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > -->
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" required> <mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="mtg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="mtg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the Traded Goods stock level observed?</mat-label> <mat-label>Please comment on the Traded Goods stock level observed?</mat-label>
<textarea matInput placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -191,35 +191,35 @@
<mat-card-title> <p>{{d+1}} Finished Goods </p> </mat-card-title> <mat-card-title> <p>{{d+1}} Finished Goods </p> </mat-card-title>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Name" formControlName="goods_name" required> <input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" required> <mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="retailfg.get('goods_observed').value == 'no'" > <span *ngIf="retailfg.get('goods_observed').value == 'no'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Estimated Quantity" formControlName="goods_quantity" required> <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required> <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;"}} {{goodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,2)" --> <mat-hint align="end" *ngIf="retailfg.get('goods_value').value != ''">{{"&#8377;"}} {{R_goodsValueInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required> <mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="retailfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="retailfg.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the finished goods stock level observed?</mat-label> <mat-label>Please comment on the finished goods stock level observed?</mat-label>
<textarea matInput placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -240,35 +240,35 @@
<mat-card-title> <p>{{e+1}} Traded Goods </p> </mat-card-title> <mat-card-title> <p>{{e+1}} Traded Goods </p> </mat-card-title>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Name" formControlName="traded_goods_name" required> <input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" required> <mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="item.get('traded_goods_observed').value == 'no'" > <span *ngIf="item.get('traded_goods_observed').value == 'no'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Estimated Quantity" formControlName="traded_goods_quantity" required> <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required> <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;"}} {{tradedGoodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,3)" --> <mat-hint align="end" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{R_tradedGoodsValueInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" required> <mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="item.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="item.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the Traded Goods stock level observed?</mat-label> <mat-label>Please comment on the Traded Goods stock level observed?</mat-label>
<textarea matInput placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -301,35 +301,35 @@
<mat-card-title> <p>{{f+1}} Finished Goods </p> </mat-card-title> <mat-card-title> <p>{{f+1}} Finished Goods </p> </mat-card-title>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Name" formControlName="goods_name" required> <input matInput autocomplete="off" placeholder="Name" formControlName="goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" required > <mat-select placeholder="is the Goods is Observed ?" formControlName="goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="tradesubdetail.get('goods_observed').value == 'no'" > <span *ngIf="tradesubdetail.get('goods_observed').value == 'no'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Estimated Quantity" formControlName="goods_quantity" required> <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="goods_quantity" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required> <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;"}} {{goodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,2)" --> <mat-hint align="end" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"&#8377;"}} {{T_goodsValueInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required> <mat-select placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="tradesubdetail.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="tradesubdetail.get('is_sufficiant_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the finished goods stock level observed?</mat-label> <mat-label>Please comment on the finished goods stock level observed?</mat-label>
<textarea matInput placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the finished goods observed" formControlName="finishedgoods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -351,35 +351,35 @@
<mat-card-title> <p>{{g+1}} Traded Goods </p> </mat-card-title> <mat-card-title> <p>{{g+1}} Traded Goods </p> </mat-card-title>
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Name" formControlName="traded_goods_name" required> <input matInput autocomplete="off" placeholder="Name" formControlName="traded_goods_name" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" required> <mat-select placeholder="is the Traded Goods is Observed ?" formControlName="traded_goods_observed" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="tradetg.get('traded_goods_observed').value == 'no'" > <span *ngIf="tradetg.get('traded_goods_observed').value == 'no'" >
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput placeholder="Estimated Quantity" formControlName="traded_goods_quantity" required> <input matInput autocomplete="off" placeholder="Estimated Quantity" formControlName="traded_goods_quantity" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required> <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;"}} {{tradedGoodsValueInWords}} Only</mat-hint> (keyup)="inWords($event,3)" --> <mat-hint align="end" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"&#8377;"}} {{T_tradedGoodsValueInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:76%"> <mat-form-field style="width:76%">
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required> <input matInput autocomplete="off" placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
<mat-form-field style="width:90%"> <mat-form-field style="width:90%">
<!-- <input matInput placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" required> --> <!-- <input matInput autocomplete="off" placeholder="Is the stock of finished goods observed ?" formControlName="is_sufficiant_goods" > -->
<mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" required> <mat-select placeholder="Is the stock of Traded goods observed ?" formControlName="is_sufficiant_traded_goods" >
<mat-option value="yes" >Yes</mat-option> <mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option> <mat-option value="no" >No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="tradetg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%"> <mat-form-field *ngIf="tradetg.get('is_sufficiant_traded_goods').value == 'no'" appearance="outline" style="width: 90%">
<mat-label>Please comment on the Traded Goods stock level observed?</mat-label> <mat-label>Please comment on the Traded Goods stock level observed?</mat-label>
<textarea matInput placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Please comment on the traded goods stock level observed" formControlName="traded_goods_remarks"></textarea>
</mat-form-field> </mat-form-field>
</span> </span>
@ -399,6 +399,13 @@
</div> </div>
</mat-card> </mat-card>
<mat-card *ngIf="serviceProviderForm">
<mat-card-header>
<p>Service Provider</p>
</mat-card-header>
<div style="text-align: center; margin: 12px;">Service Provider Details Not applicable here !!</div>
</mat-card>
</div> </div>
</div> </div>
@ -509,7 +516,7 @@
<div fxFlex="60" class="pb-0 text-sm-left" align="left"> <div fxFlex="60" class="pb-0 text-sm-left" align="left">
<mat-form-field appearance="outline" style="width: 100%"> <mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label> <mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="stock_remarks"></textarea> <textarea matInput autocomplete="off" placeholder="Remarks" formControlName="stock_remarks"></textarea>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxFlex="40" align="end"> <div fxFlex="40" align="end">

View File

@ -40,14 +40,23 @@ export class StockComponent implements OnInit {
public uomData : any = []; public uomData : any = [];
rawmaterial : any; rawmaterial : any;
goodsValueInWords : any;
rawValueInWords : any; M_rawValueInWords : any;
tradedGoodsValueInWords : any;
M_goodsValueInWords : any;
R_goodsValueInWords : any;
T_goodsValueInWords : any;
M_tradedGoodsValueInWords : any;
R_tradedGoodsValueInWords : any;
T_tradedGoodsValueInWords : any;
rawMaterialAccess: boolean; rawMaterialAccess: boolean;
finishedGoodsAccess: boolean; finishedGoodsAccess: boolean;
tradeConcernAccess: boolean; tradeConcernAccess: boolean;
public submitted = false; public submitted = false;
noRecordsFound: Boolean = false; noRecordsFound: Boolean = false;
serviceProviderForm: Boolean = false;
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
@ -85,37 +94,27 @@ export class StockComponent implements OnInit {
// this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!'); // this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!');
// }) // })
this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => { //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(
// if(data.dataStatus === undefined){ this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => {
let datas = {
"profession_name": "Others", if(data.dataStatus == true){
"type_of_activity": [ let datas = data.records;
{ if(datas.type_of_activity != undefined){
"type_of_activity_id": 1, this.initstockForms(datas.type_of_activity)
"name": "Manufacturing Details" }
}, else{
{ this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!');
"type_of_activity_id": 2, }
"name": "Retail trading" }else if(data.dataStatus == false)
}, {
{ this.notifier.notify('warning', data.msg);
"type_of_activity_id": 3, return;
"name": "Trading Concern" }
}, else{
{ return;
"type_of_activity_id": 4, }
"name": "Service Provider"
}
]
};
this.initstockForms(datas.type_of_activity);
// }else {
// this.notifier.notify('warning', 'No Category Records Found.!');
// this.noRecordsFound = false;
// }
}, err => { }, err => {
this.notifier.notify('warning', 'Business Type Of Activity Not Available Please Check Business Information.!');
this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!');
this.noRecordsFound = false; this.noRecordsFound = false;
}) })
@ -123,7 +122,7 @@ export class StockComponent implements OnInit {
} }
public initstockForms(record){ public initstockForms(record){
console.log(record);
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
params.pd_form_id = this.form_id; params.pd_form_id = this.form_id;
@ -133,7 +132,7 @@ export class StockComponent implements OnInit {
let dataForm = value.records; let dataForm = value.records;
if(dataForm !== undefined) { if(dataForm !== undefined) {
console.log('dtaForm',dataForm);
this.stockForms = this.fb.group({ this.stockForms = this.fb.group({
pdid: [this.pdid], pdid: [this.pdid],
formid: [this.form_id], formid: [this.form_id],
@ -142,7 +141,12 @@ export class StockComponent implements OnInit {
retail_details : this.fb.array([this.retailFormCreation(record)]), retail_details : this.fb.array([this.retailFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]),
}); });
let arr = record.filter(data => data.type_of_activity_id === 1);
let arr0 = Object.keys(record).map(function (key) {
return record[key];
});
let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) { if(arr.length > 0) {
let retail_finished_goods; let retail_finished_goods;
let manufacturing_raw_materials; let manufacturing_raw_materials;
@ -175,7 +179,7 @@ export class StockComponent implements OnInit {
manufacturing_temparr['manufacturing_traded_goods'] = manufacturing_traded_goods;manufacturing_temparr['manufacturing_finished_goods'] = manufacturing_finished_goods;manufacturing_temparr['manufacturing_raw_materials'] = manufacturing_raw_materials; manufacturing_temparr['manufacturing_traded_goods'] = manufacturing_traded_goods;manufacturing_temparr['manufacturing_finished_goods'] = manufacturing_finished_goods;manufacturing_temparr['manufacturing_raw_materials'] = manufacturing_raw_materials;
this.initManufacturingDetails(manufacturing_temparr); this.initManufacturingDetails(manufacturing_temparr);
} }
let arr1 = record.filter(data => data.type_of_activity_id === 2); let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) { if(arr1.length > 0) {
let retail_finished_goods; let retail_finished_goods;
let retail_traded_goods; let retail_traded_goods;
@ -199,7 +203,7 @@ export class StockComponent implements OnInit {
retail_temparr['retail_finished_goods'] = retail_finished_goods; retail_temparr['retail_finished_goods'] = retail_finished_goods;
this.initRetailDetails(retail_temparr); this.initRetailDetails(retail_temparr);
} }
let arr2 = record.filter(data => data.type_of_activity_id === 3); let arr2 = record.filter(data => data.type_of_activity_id == 3);
if(arr2.length > 0) { if(arr2.length > 0) {
let trading_finished_goods; let trading_finished_goods;
let trading_traded_goods; let trading_traded_goods;
@ -223,10 +227,14 @@ export class StockComponent implements OnInit {
trading_temparr['trading_traded_goods'] = trading_traded_goods; trading_temparr['trading_traded_goods'] = trading_traded_goods;
this.initTradingDetails(trading_temparr); this.initTradingDetails(trading_temparr);
} }
let arr3 = record.filter(data => data.type_of_activity_id == 4);
if(arr3.length > 0) {
this.serviceProviderForm = true;
}
this.noRecordsFound = true; this.noRecordsFound = true;
} }
else{ else{
console.log('dataForm',dataForm); // console.log('dataForm',dataForm);
this.stockForms = this.fb.group({ this.stockForms = this.fb.group({
pdid: [this.pdid], pdid: [this.pdid],
formid: [this.form_id], formid: [this.form_id],
@ -235,21 +243,21 @@ export class StockComponent implements OnInit {
retail_details : this.fb.array([this.retailFormCreation(record)]), retail_details : this.fb.array([this.retailFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]),
}); });
let arr = record.filter(data => data.type_of_activity_id === 1); let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) { if(arr.length > 0) {
this.initManufacturingDetails(null); this.initManufacturingDetails(null);
} }
let arr1 = record.filter(data => data.type_of_activity_id === 2); let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) { if(arr1.length > 0) {
this.initRetailDetails(null); this.initRetailDetails(null);
} }
let arr2 = record.filter(data => data.type_of_activity_id === 3); let arr2 = record.filter(data => data.type_of_activity_id == 3);
if(arr2.length > 0) { if(arr2.length > 0) {
this.initTradingDetails(null); this.initTradingDetails(null);
} }
let arr3 = record.filter(data => data.type_of_activity_id === 4); let arr3 = record.filter(data => data.type_of_activity_id == 4);
if(arr3.length > 0) { if(arr3.length > 0) {
//this.serviceProviderForm = true; this.serviceProviderForm = true;
} }
this.noRecordsFound = true; this.noRecordsFound = true;
} }
@ -263,21 +271,21 @@ export class StockComponent implements OnInit {
retail_details : this.fb.array([this.retailFormCreation(record)]), retail_details : this.fb.array([this.retailFormCreation(record)]),
trade_details: this.fb.array([this.tradingFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]),
}); });
let arr = record.filter(data => data.type_of_activity_id === 1); let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) { if(arr.length > 0) {
this.initManufacturingDetails(null); this.initManufacturingDetails(null);
} }
let arr1 = record.filter(data => data.type_of_activity_id === 2); let arr1 = record.filter(data => data.type_of_activity_id == 2);
if(arr1.length > 0) { if(arr1.length > 0) {
this.initRetailDetails(null); this.initRetailDetails(null);
} }
let arr2 = record.filter(data => data.type_of_activity_id === 3); let arr2 = record.filter(data => data.type_of_activity_id == 3);
if(arr2.length > 0) { if(arr2.length > 0) {
this.initTradingDetails(null); this.initTradingDetails(null);
} }
let arr3 = record.filter(data => data.type_of_activity_id === 4); let arr3 = record.filter(data => data.type_of_activity_id == 4);
if(arr3.length > 0) { if(arr3.length > 0) {
//this.serviceProviderForm = true; this.serviceProviderForm = true;
} }
this.noRecordsFound = true; this.noRecordsFound = true;
} }
@ -292,9 +300,12 @@ export class StockComponent implements OnInit {
} }
manufacturingForm: Boolean = false; manufacturingForm: Boolean = false;
manufacturingFormCreation(val) { manufacturingFormCreation(record) {
let arr = val.filter(data => data.type_of_activity_id === 1); console.log(record);
let arr = record.filter(data => data.type_of_activity_id == 1);
console.log(arr);
if (arr.length > 0) { if (arr.length > 0) {
console.log(arr.length);
this.manufacturingForm = true; this.manufacturingForm = true;
return this.fb.group({ return this.fb.group({
manufacturing_raw_materials: this.fb.array([]), manufacturing_raw_materials: this.fb.array([]),
@ -309,7 +320,8 @@ export class StockComponent implements OnInit {
retailForm: Boolean = false; retailForm: Boolean = false;
retailFormCreation(val) { retailFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 2);
let arr = val.filter(data => data.type_of_activity_id == 2);
if (arr.length > 0) { if (arr.length > 0) {
this.retailForm = true; this.retailForm = true;
return this.fb.group({ return this.fb.group({
@ -324,7 +336,7 @@ export class StockComponent implements OnInit {
tradingForm: Boolean = false; tradingForm: Boolean = false;
tradingFormCreation(val) { tradingFormCreation(val) {
let arr = val.filter(data => data.type_of_activity_id === 3); let arr = val.filter(data => data.type_of_activity_id == 3);
if (arr.length > 0) { if (arr.length > 0) {
this.tradingForm = true; this.tradingForm = true;
return this.fb.group({ return this.fb.group({
@ -350,32 +362,39 @@ export class StockComponent implements OnInit {
const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; const control = <FormArray>this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials'];
if(datas === null){ if(datas === null){
console.log(299,'if'); // console.log(299,'if');
// rawMaterial.push(this.createRawmaterial(null)); // rawMaterial.push(this.createRawmaterial(null));
// finishedGoods.push(this.createGoods(null)); // finishedGoods.push(this.createGoods(null));
// tradedGoods.push(this.createTradedGoods(null)); // tradedGoods.push(this.createTradedGoods(null));
} else { } else {
console.log(305,'else') // console.log(305,'else')
for (let val of datas.manufacturing_raw_materials) { for (let val of datas.manufacturing_raw_materials) {
console.log(val); // console.log(val);
if(val.raw_value){
this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value);
}
rawMaterial.push(this.createRawmaterial(val)); rawMaterial.push(this.createRawmaterial(val));
} }
for (let val of datas.manufacturing_finished_goods) { for (let val of datas.manufacturing_finished_goods) {
console.log(val); // console.log(val);
if(val.goods_value){
this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
}
finishedGoods.push(this.createGoods(val)); finishedGoods.push(this.createGoods(val));
} }
for (let val of datas.manufacturing_traded_goods) { for (let val of datas.manufacturing_traded_goods) {
console.log(val); // console.log(val);
if(val.estimated_traded_goods_value){
this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val)); tradedGoods.push(this.createTradedGoods(val));
} }
console.log(310,rawMaterial); // console.log(310,rawMaterial);
} }
} }
@ -439,13 +458,19 @@ export class StockComponent implements OnInit {
} else { } else {
for (let val of datas.retail_finished_goods) { for (let val of datas.retail_finished_goods) {
console.log(val); // console.log(val);
if(val.goods_value){
this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
}
finishedGoods.push(this.createGoods(val)); finishedGoods.push(this.createGoods(val));
} }
for (let val of datas.retail_traded_goods) { for (let val of datas.retail_traded_goods) {
console.log(val); // console.log(val);
if(val.estimated_traded_goods_value){
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val)); tradedGoods.push(this.createTradedGoods(val));
} }
@ -521,13 +546,18 @@ export class StockComponent implements OnInit {
// } // }
for (let val of datas.trading_finished_goods) { for (let val of datas.trading_finished_goods) {
console.log(val); // console.log(val);
if(val.goods_value){
this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
}
finishedGoods.push(this.createGoods(val)); finishedGoods.push(this.createGoods(val));
} }
for (let val of datas.trading_traded_goods) { for (let val of datas.trading_traded_goods) {
console.log(val); // console.log(val);
if(val.estimated_traded_goods_value){
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
}
tradedGoods.push(this.createTradedGoods(val)); tradedGoods.push(this.createTradedGoods(val));
} }
@ -749,15 +779,28 @@ export class StockComponent implements OnInit {
/** To Convert Amount into Words */ /** To Convert Amount into Words */
inWords(e,flag:number){ inWords(e,flag:number){
switch(flag){ switch(flag){
case 1 : case 1 :
this.rawValueInWords = this._pd.convertNumberToWords(e.target.value); this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
case 2 : case 2 :
this.goodsValueInWords = this._pd.convertNumberToWords(e.target.value); this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
case 3 : case 3 :
this.tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 4 :
this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 5 :
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 6 :
this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 7 :
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
default: default:
break; break;

View File

@ -17,26 +17,26 @@
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;">Raw Material #{{l+1}}</h6> <h6 style="margin: 12px;">Raw Material #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Raw Material Name" formControlName="manufacturing_raw_material_name"> <input matInput placeholder="Raw Material Name" formControlName="manufacturing_raw_material_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Supplier Name" formControlName="manufacturing_supplier_name"> <input matInput placeholder="Supplier Name" formControlName="manufacturing_supplier_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name"> <input matInput placeholder="Contact Person Name" formControlName="manufacturing_contact_person_name">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number"> <input matInput placeholder="Contact Person Mobile Number" formControlName="manufacturing_contact_person_mobile_number">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="manufacturing_payment_type"> <mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="manufacturing_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%" *ngIf="items.get('manufacturing_payment_type').value == 3"> <mat-form-field style="width: 30%" *ngIf="items.get('manufacturing_payment_type').value == 3">
<input matInput placeholder="Number of days of credit provided" formControlName="manufacturing_credit_days"> <input matInput placeholder="Number of days of credit provided" formControlName="manufacturing_credit_days">
</mat-form-field> </mat-form-field>
</div> </div>
@ -70,26 +70,26 @@
<mat-card style="margin: 12px;"> <mat-card style="margin: 12px;">
<h6 style="margin: 12px;">Trading Product #{{l+1}}</h6> <h6 style="margin: 12px;">Trading Product #{{l+1}}</h6>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Trade Product Name" formControlName="trade_product_name"> <input matInput placeholder="Trade Product Name" formControlName="trade_product_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Supplier Name" formControlName="trade_supplier_name"> <input matInput placeholder="Supplier Name" formControlName="trade_supplier_name">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name"> <input matInput placeholder="Contact Person Name" formControlName="trade_product_contact_person_name">
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<input matInput placeholder="Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number"> <input matInput placeholder="Contact Person Mobile Number" formControlName="trade_product_contact_person_mobile_number">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 30%">
<mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="trade_product_payment_type"> <mat-select (selectionChange)="selectedPM($event)" placeholder="Payment Type" formControlName="trade_product_payment_type">
<mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option> <mat-option *ngFor="let pm of m_paymentModeType" [value]="pm.id">{{ pm.name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%" *ngIf="items.get('trade_product_payment_type').value == 3"> <mat-form-field style="width: 30%" *ngIf="items.get('trade_product_payment_type').value == 3">
<input matInput placeholder="Number of days of credit provided" formControlName="trade_product_credit_days"> <input matInput placeholder="Number of days of credit provided" formControlName="trade_product_credit_days">
</mat-form-field> </mat-form-field>
</div> </div>

View File

@ -24,12 +24,11 @@
<div fxFlex="20" align="end"> <div fxFlex="20" align="end">
<span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span> <span style="padding: 2px 9px 3px 9px !important;" class="menu-badge mat-purple ng-star-inserted" align="center">{{quesIndex+1}}</span>
</div> </div>
<!-- <mat-card-subtitle>Karthi Kms</mat-card-subtitle> -->
</mat-card-header> </mat-card-header>
</mat-card> </mat-card>
</div> </div>
</mat-card-content> </mat-card-content>
<!-- <mat-card-actions align="end"> <mat-card-actions align="end">
<button _ngcontent-c21="" matTooltip="Complete Question" matTooltipPosition="above" [disabled]="actualQuestions!=answeredQuestions" class="compose-btn mat-warn mat-raised-button mb-1" (click)="changePDStatus(pdStatusCheck.COMPLETED);" style="margin-top:10px;"><span>{{currentPDStatus==pdStatusCheck.INPROGRESS ? 'COMPLETE':(currentPDStatus==pdStatusCheck.QC_COMPLETED ? 'QC COMPLETED' : currentPDStatus ) }}</span></button> <button matTooltip="Complete Question" matTooltipPosition="above" [disabled]="actualQuestions==0 || actualQuestions!=answeredQuestions || currentPDStatus!=pdStatusCheck.INPROGRESS" mat-raised-button color="primary" (click)="changePDStatus(pdStatusCheck.COMPLETED);"><span>{{currentPDStatus==pdStatusCheck.INPROGRESS ? 'COMPLETE':(currentPDStatus==pdStatusCheck.QC_COMPLETED ? 'QC COMPLETED' : currentPDStatus ) }}</span></button>
</mat-card-actions> --> </mat-card-actions>
</mat-card> </mat-card>

View File

@ -60,7 +60,7 @@ mat-card .child_mat_card > mat-card {
transition: box-shadow 0.5s, transform 0.5s; transition: box-shadow 0.5s, transform 0.5s;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
background-color: #e00201 !important; // background-color: #e00201 !important;
transform: scale(1); transform: scale(1);
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
} }

View File

@ -40,141 +40,10 @@ export class StartPdComponent implements OnInit, OnDestroy {
selectedCategory: any = []; selectedCategory: any = [];
categoryList: any = []; categoryList: any = [];
pdMasterList: any = []; pdMasterList: any = [];
optionsForm: FormGroup; pdFullDetails:any=[];
checkBoxForm: FormGroup;
textBoxForm: FormGroup;
next: number;
previous: number;
selectedCategoryIndex: number;
selectedQuestionIndex: number;
getQuestionsLength: number;
answerList: any = [];
ansPDList: any = [];
relationDetails: any = [1];
rentalDetail: any = { form_id: "16", form_name: "Rental Information", isAnswered: true}
// errorMessage:any;
// selectedCategory:any=[];
// categoryList: any=[];
// pdMasterList: any=[];
// optionsForm: FormGroup;
// checkBoxForm:FormGroup;
// textBoxForm:FormGroup;
// next:number;
// previous:number;
// selectedCategoryIndex:number;
// selectedQuestionIndex:number;
// getQuestionsLength:number;
// answerList:any=[];
// ansPDList:any=[];
// category static form buttons
// categoryFormButtons: any = [
// {
// "form_id": 1,
// "form_name": "Supplier Details"
// },
// {
// "form_id": 2,
// "form_name": "Client Details",
// },
// {
// "form_id": 3,
// "form_name": "Personal Details",
// },
// {
// "form_id":4,
// "form_name":"Asset Details",
// },
// {
// "form_id": 5,
// "form_name": "Address"
// },
// {
// "form_id": 6,
// "form_name": "Family",
// },
// {
// "form_id": 7,
// "form_name": "Banking",
// },
// {
// "form_id": 8,
// "form_name": "Current Loan",
// },
// {
// "form_id": 9,
// "form_name": "Other Income",
// },
// {
// "form_id": 10,
// "form_name": "Loan Details",
// },
// {
// "form_id": 11,
// "form_name": "Stock",
// },
// {
// "form_id": 12,
// "form_name": "Employmet Info",
// },
// {
// "form_id": 13,
// "form_name": "Business Info",
// },
// {
// "form_id": 14,
// "form_name": "Financial Info",
// },
// ];
pdFullDetails:any=[];
// category static form buttons // category static form buttons
categoryFormButtons: any; categoryFormButtons: any;
// = [
// {
// "form_id": 1,
// "form_name": "Supplier Details"
// },
// {
// "form_id": 2,
// "form_name": "Client Details",
// },
// {
// "form_id": 3,
// "form_name": "Personal Details",
// },
// {
// "form_id":4,
// "form_name":"Asset Details",
// },
// {
// "form_id": 5,
// "form_name": "Address"
// },
// {
// "form_id": 6,
// "form_name": "Family",
// },
// {
// "form_id": 7,
// "form_name": "Banking",
// },
// {
// "form_id": 8,
// "form_name": "Current Loan",
// },
// {
// "form_id": 9,
// "form_name": "Other Income",
// },
// {
// "form_id": 10,
// "form_name": "Loan Details",
// },
// ];
formsCategoryEnable: boolean = false; formsCategoryEnable: boolean = false;
selectedFormsCategory: any; selectedFormsCategory: any;
// create values for status check // create values for status check
@ -190,15 +59,8 @@ pdFullDetails:any=[];
currentPDStatus: string; currentPDStatus: string;
actualQuestions: number; actualQuestions: number;
answeredQuestions: number; answeredQuestions: number;
// start
// end
private notifier: NotifierService; private notifier: NotifierService;
constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
private listPDComponent: ListPdComponent, private _pd: PdTrigerService,) { private listPDComponent: ListPdComponent, private _pd: PdTrigerService,) {
@ -221,8 +83,6 @@ pdFullDetails:any=[];
} }
this.loadTemplates(this.startPD); this.loadTemplates(this.startPD);
this.next = 1;
this.previous = 2;
} }
// start // start
@ -237,93 +97,23 @@ pdFullDetails:any=[];
return bool; return bool;
} }
// load pd template details
// loadTemplates(startID: string) {
// this._pd.loadPDTemplates(startID).subscribe(
// data => {
// if (data.status == 200) {
// this.pdMasterList = data.records.pdmaster_details;
// this.categoryList = data.records.question_answers;
// let filterApplicantName = data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
// this.mainApplicantName = filterApplicantName[0].applicant_name;
// this.currentPDStatus = data.records.pdmaster_details.pd_status;
//
// this.actualQuestions = data.records.counts.overall_question_count;
// this.answeredQuestions = data.records.counts.overall_answered_count;
//
// }
// else {
// this.pdMasterList = "";
// this.mainApplicantName = "";
// this.categoryList = [];
// this.currentPDStatus = "";
// }
// }, error => this.errorMessage = <any> error);
// }
// loadTemplates(startID: string) {
// this._pd.loadPDTemplates(startID).subscribe(
// data => {
// if (data.status == 200) {
// this.pdMasterList = data.records.pdmaster_details;
// this.categoryList = data.records.question_answers;
// // this.categoryFormButtons = data.records.template_forms;
// let filterApplicantName = data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
// this.mainApplicantName = filterApplicantName[0].applicant_name;
// this.currentPDStatus = data.records.pdmaster_details.pd_status;
//
// this.actualQuestions = data.records.counts.overall_question_count;
// this.answeredQuestions = data.records.counts.overall_answered_count;
//
// this.pdFullDetails = data.records
// }
// else {
// this.pdMasterList = "";
// this.mainApplicantName = "";
// this.categoryList = [];
// this.currentPDStatus = "";
// }
// }, error => this.errorMessage = <any> error);
// }
ngOnDestroy(): void {
this.listPDComponent.showListView(true);
}
isOver(): boolean { isOver(): boolean {
return window.matchMedia(`(max-width: 960px)`).matches; return window.matchMedia(`(max-width: 960px)`).matches;
} }
OnSelectDirectQuestions(selectedQuestions: any, categoryIndex: number, questionsIndex: number) {
this.formsCategoryEnable = false;
this.selectedCategory = selectedQuestions;
this.selectedCategoryIndex = categoryIndex;
this.selectedQuestionIndex = questionsIndex;
let serachQuestions = {
"question_id": selectedQuestions.fk_question_id,
"pd_id": this.startPD,
"template_id": selectedQuestions.fk_template_id,
"category_id": selectedQuestions.fk_template_question_category_id
}
this.getAnswers(serachQuestions);
}
loadTemplates(startID:string){ loadTemplates(startID:string){
this._pd.loadPDTemplates(startID).subscribe( this._pd.loadPDTemplates(startID).subscribe(
data => { data => {
if (data.status == 200) { if (data.status == 200) {
this.pdMasterList=data.records.pdmaster_details; this.pdMasterList=data.records.pdmaster_details;
this.categoryList=data.records.question_answers; // this.categoryList=data.records.question_answers;
this.categoryFormButtons = data.records.template_forms;
let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1); let filterApplicantName= data.records.pdapplicants_detials.filter(item => item.applicant_type == 1);
this.mainApplicantName = filterApplicantName[0].applicant_name; this.mainApplicantName = filterApplicantName[0].applicant_name;
this.currentPDStatus = data.records.pdmaster_details.pd_status; this.currentPDStatus = data.records.pdmaster_details.pd_status;
this.categoryFormButtons = Object.keys(data.records.template_forms).map((item)=>data.records.template_forms[item]);
this.actualQuestions = data.records.counts.overall_question_count; this.actualQuestions = this.categoryFormButtons.length;
this.answeredQuestions = data.records.counts.overall_answered_count; let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered==true);
this.answeredQuestions = getAnsweredFormsCount.length;
this.pdFullDetails = data.records this.pdFullDetails = data.records
@ -339,292 +129,7 @@ pdFullDetails:any=[];
}); });
} }
// load question based answer list
getAnswers(serachList: any) {
this.answerList = [];
this._pd.getAnswersForPD(serachList).subscribe(
data => {
if (data.status == 200) {
this.answerList = data.records.answers;
this.ansPDList = data.records;
this.actualQuestions = data.records.counts.overall_question_count,
this.answeredQuestions = data.records.counts.overall_answered_count
// this for options type questions
if (this.selectedCategory.fk_question_answertype == 1) {
this.loadOtionsForm(this.selectedCategory, this.answerList);
}
//this for text box type questions
else if (this.selectedCategory.fk_question_answertype == 2) {
this.loadTextBoxForm(this.selectedCategory, this.answerList);
}
//this for check box type questions
else if (this.selectedCategory.fk_question_answertype == 3) {
this.loadCheckBoxForm(this.selectedCategory, this.answerList);
}
}
}, error => this.errorMessage = <any> error);
}
// load check box form
loadCheckBoxForm(selectedCategory: any, ansItem: any) {
// create checkbox group
let checkboxGroup = new FormArray(ansItem.map(item => new FormGroup({
fk_pd_id: new FormControl(this.startPD),
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
pd_answer_id: new FormControl(item.question_answer_id),
pd_answer: new FormControl(item.answer),
pd_answer_weightage: new FormControl(item.template_answer_weightage),
checkbox: new FormControl(item.isactive == null ? false : true)
})));
// create documents group
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
pd_document_title: new FormControl(item.pd_document_title),
pd_document_url: new FormControl(item.pd_document_name),
})));
// create a hidden reuired formControl to keep status of checkbox group
let hiddenControl = new FormControl(this.mapItems(checkboxGroup.value), Validators.required);
// update checkbox group's value to hidden formcontrol
checkboxGroup.valueChanges.subscribe((v) => {
hiddenControl.setValue(this.mapItems(v));
});
this.checkBoxForm = new FormGroup({
pd_detail_id: new FormControl(this.ansPDList.pd_detail_id),
fk_pd_id: new FormControl(this.startPD),
fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id),
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
pd_question: new FormControl(this.selectedCategory.question),
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
items: checkboxGroup,
selectedItems: hiddenControl,
documents: documentsGroup
});
}
// map options form group values
mapItems(items) {
let selectedItems = items.filter((item) => item.checkbox).map((item) => item);
return selectedItems.length ? selectedItems : null;
}
// load Options form
loadOtionsForm(selectedCategory: any, ansItem: any) {
// create options type group
let optionsGroup = new FormArray(ansItem.map(item => new FormGroup({
fk_pd_id: new FormControl(this.startPD),
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
pd_answer_id: new FormControl(item.question_answer_id),
pd_answer: new FormControl(item.answer),
pd_answer_weightage: new FormControl(item.template_answer_weightage),
options: new FormControl(item.isactive == null ? false : true)
})));
// create documents group
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
pd_document_title: new FormControl(item.pd_document_title),
pd_document_url: new FormControl(item.pd_document_name),
})));
// create a hidden reuired formControl to keep status of checkbox group
let hiddenControl = new FormControl(this.optionsMapItems(optionsGroup.value), Validators.required);
let checkedItem = hiddenControl.value != null ? new FormControl(hiddenControl.value[0].pd_answer_id) : new FormControl(null);
this.optionsForm = new FormGroup({
pd_detail_id: new FormControl(this.ansPDList.pd_detail_id),
fk_pd_id: new FormControl(this.startPD),
fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id),
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
pd_question: new FormControl(this.selectedCategory.question),
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
items: optionsGroup,
selectedItems: hiddenControl,
modelValue: checkedItem,
documents: documentsGroup
});
this.optionsForm.controls.modelValue.valueChanges.subscribe((v) => {
hiddenControl.setValue(this.updateOptionsMapItems(v, optionsGroup.value));
});
}
// map option type group values
optionsMapItems(items) {
let optionSelectedItems = items.filter((item) => item.options == true).map((item) => item);
return optionSelectedItems.length ? optionSelectedItems : null;
}
// map options type while change options
updateOptionsMapItems(key, items) {
let updateSelectedItems = items.filter((item) => item.pd_answer_id == key).map((item) => item);
return updateSelectedItems.length ? updateSelectedItems : null;
}
// load text box form
loadTextBoxForm(selectedCategory: any, ansItem: any) {
// create text box type group
let textGroup = new FormArray(ansItem.map(item => new FormGroup({
fk_pd_id: new FormControl(this.startPD),
pd_detail_answer_id: new FormControl(item.pd_detail_answer_id),
pd_answer_id: new FormControl(item.question_answer_id),
pd_answer: new FormControl(item.pd_answer),
pd_answer_weightage: new FormControl(item.template_answer_weightage),
text: new FormControl(item.pd_detail_answer_id == null ? false : true)
})));
// create documents group
let documentsGroup = new FormArray(this.ansPDList.images.map(item => new FormGroup({
pd_document_title: new FormControl(item.pd_document_title),
pd_document_url: new FormControl(item.pd_document_name),
})));
this.textBoxForm = new FormGroup({
pd_detail_id: new FormControl(this.ansPDList.pd_detail_id),
fk_pd_id: new FormControl(this.startPD),
fk_category_id: new FormControl(this.selectedCategory.fk_template_question_category_id),
fk_question_id: new FormControl(this.selectedCategory.fk_question_id),
pd_question: new FormControl(this.selectedCategory.question),
pd_question_weightage: new FormControl(this.selectedCategory.question_weightage),
pd_answer_remark: new FormControl(this.ansPDList.question_remark),
items: textGroup,
documents: documentsGroup
});
}
// next save and previous save for options and check box type questions
saveNextPrevious(details: any, type: number) {
let fetchAns = [];
details.selectedItems.value.forEach((itemElement, itemIndex) => {
let obj1 = {
fk_pd_detail_id: details.pd_detail_id.value,
fk_pd_id: itemElement.fk_pd_id,
pd_detail_answer_id: itemElement.pd_detail_answer_id,
pd_answer_id: itemElement.pd_answer_id,
pd_answer: itemElement.pd_answer,
pd_answer_weightage: itemElement.pd_answer_weightage,
}
fetchAns.push(obj1)
});
let pd_details: any = [{
"pd_detail_id": details.pd_detail_id.value,
"fk_pd_id": details.fk_pd_id.value,
"fk_category_id": details.fk_category_id.value,
"fk_question_id": details.fk_question_id.value,
"pd_question": details.pd_question.value,
"pd_question_weightage": details.pd_question_weightage.value,
"question_remark": details.pd_answer_remark.value,
"answers": fetchAns,
"images": []
}];
this._pd.savePDQuestions(pd_details).subscribe(result => {
if (result.status == 200) {
if (type == 1) {
this.skipNextPrevious(this.next);
}
else {
this.skipNextPrevious(this.previous);
}
}
}, error => {
});
}
// next save and previous save for text type questions
saveNextPreviousText(details: any, type: number) {
let fetchAns = [];
details.items.value.forEach((itemElement, itemIndex) => {
let obj1 = {
fk_pd_detail_id: details.pd_detail_id.value,
fk_pd_id: itemElement.fk_pd_id,
pd_detail_answer_id: itemElement.pd_detail_answer_id,
pd_answer_id: itemElement.pd_answer_id,
pd_answer: itemElement.pd_answer,
pd_answer_weightage: itemElement.pd_answer_weightage,
}
fetchAns.push(obj1)
});
let pd_details: any = [{
"pd_detail_id": details.pd_detail_id.value,
"fk_pd_id": details.fk_pd_id.value,
"fk_category_id": details.fk_category_id.value,
"fk_question_id": details.fk_question_id.value,
"pd_question": details.pd_question.value,
"pd_question_weightage": details.pd_question_weightage.value,
"question_remark": details.pd_answer_remark.value,
"answers": fetchAns,
"images": []
}];
this._pd.savePDQuestions(pd_details).subscribe(result => {
if (result.status == 200) {
if (type == 1) {
this.skipNextPrevious(this.next);
}
else {
this.skipNextPrevious(this.previous);
}
}
}, error => {
});
}
// skip to previous and next questions
skipNextPrevious(type: number) {
// for skip to next
if (type == 1) {
if (this.categoryList.length > this.selectedCategoryIndex) {
let nextCatList = this.categoryList[this.selectedCategoryIndex];
this.selectedQuestionIndex = this.selectedQuestionIndex < nextCatList.questions.length - 1 ? this.selectedQuestionIndex + 1 : this.selectedQuestionIndex;
let nextQuesList = nextCatList.questions[this.selectedQuestionIndex];
this.selectedCategory = nextQuesList;
this.selectedCategoryIndex = this.selectedCategoryIndex;
this.selectedQuestionIndex = this.selectedQuestionIndex;
let serachQuestions = {
"question_id": nextQuesList.fk_question_id,
"pd_id": this.startPD,
"template_id": nextQuesList.fk_template_id,
"category_id": nextQuesList.fk_template_question_category_id
}
this.getAnswers(serachQuestions);
}
}
// for skip to previous
else if (type == 2) {
if (this.categoryList.length > this.selectedCategoryIndex) {
let preCatList = this.categoryList[this.selectedCategoryIndex];
this.selectedQuestionIndex = this.selectedQuestionIndex == 0 ? this.selectedQuestionIndex : this.selectedQuestionIndex - 1;
let preQuesList = preCatList.questions[this.selectedQuestionIndex];
this.selectedCategory = preQuesList;
this.selectedCategoryIndex = this.selectedCategoryIndex;
this.selectedQuestionIndex = this.selectedQuestionIndex;
let serachQuestions = {
"question_id": preQuesList.fk_question_id,
"pd_id": this.startPD,
"template_id": preQuesList.fk_template_id,
"category_id": preQuesList.fk_template_question_category_id
}
this.getAnswers(serachQuestions);
}
}
}
//change pd status //change pd status
changePDStatus(status: string) { changePDStatus(status: string) {
@ -916,12 +421,12 @@ pdFullDetails:any=[];
} }
ngOnDestroy(): void {
this.listPDComponent.showListView(true);
}
// load pd view component // load pd view component
loadPdViewCompoent() { loadPdViewCompoent() {
this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route}); this.router.navigate(['../../viewpd', this.startPD], {relativeTo: this.route});
} }
// end
} }

View File

@ -82,10 +82,18 @@
<mat-list *ngFor="let applicant of pdApplicantData"> <mat-list *ngFor="let applicant of pdApplicantData">
<mat-list-item style="height:68px !important;"> <mat-list-item style="height:68px !important;">
<p><span *ngIf="applicant.applicant_name!=null" class="mb-2 text-center hover-icon"> <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"></i>
&nbsp;{{applicant.applicant_name}} </span> &nbsp;&nbsp;&nbsp;<span *ngIf="applicant.mobile_no!=''" class="mb-2 text-center hover-icon"> &nbsp;{{applicant.applicant_name}}
<i class="fa-1x fa fa-phone"></i> </span> &nbsp;&nbsp;&nbsp;
&nbsp;{{applicant.mobile_no}} </span> <br><span *ngIf="applicant.applicant_type=='1';else codetails" style="font-size:12px;">Main Applicant </span> <span *ngIf="applicant.mobile_no != '' && applicant.mobile_no != null" class="mb-2 text-center hover-icon">
<i class="fa-1x fa fa-phone"></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>
&nbsp;{{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> <ng-template #codetails><span>{{applicant.relation_name}}</span></ng-template>
</p> </p>
</mat-list-item> </mat-list-item>

View File

@ -40,14 +40,12 @@ export class PdTrigerService {
// get add pd master details // get add pd master details
getAllMasterDatas(TableName: string): Observable<any> { getAllMasterDatas(TableName: string): Observable<any> {
console.log('table', TableName);
return this._http.post(this.apiUrl + 'getListOfMaster', {"master_name": TableName}) return this._http.post(this.apiUrl + 'getListOfMaster', {"master_name": TableName})
.pipe( .pipe(
catchError(this.handleError('role', [])) catchError(this.handleError('role', []))
) )
} }
saveForm(records: any): Observable<any> { saveForm(records: any): Observable<any> {
console.log('table', records);
records.fk_createdby = this._aws.getlocale(); records.fk_createdby = this._aws.getlocale();
let params = {records} let params = {records}
return this._http.post(this.apiUrl + 'savePDFormDetails', params) return this._http.post(this.apiUrl + 'savePDFormDetails', params)
@ -56,7 +54,6 @@ export class PdTrigerService {
) )
} }
retriveForm(params): Observable<any> { retriveForm(params): Observable<any> {
console.log('data', params);
return this._http.post(this.apiUrl + 'getPDFormDetails', params) return this._http.post(this.apiUrl + 'getPDFormDetails', params)
.pipe( .pipe(
catchError(this.handleError('role', [])) catchError(this.handleError('role', []))

View File

@ -11,7 +11,7 @@
<div *ngFor="let master of pdMasterData" class="ml-xs mr-xs pt-1" fxFlex="55" style="text-align:right;" > <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.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.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.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.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" 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.DRAFT && currentPDStatus!=pdStatusCheck.TRIGGERED && 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 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> <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> <br>
<span *ngIf="master.pd_allocated_to" 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> &nbsp;&nbsp; <span *ngIf="master.pd_allocated_to" 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> &nbsp;&nbsp;
@ -80,6 +80,30 @@
<ng-template #noApplicant><mat-card-content><p>No Applicant</p></mat-card-content></ng-template> <ng-template #noApplicant><mat-card-content><p>No Applicant</p></mat-card-content></ng-template>
</mat-card> </mat-card>
</div> </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 || currentPDStatus==pdStatusCheck.COMPLETED">
<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>
<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>
<p>{{requirement.add_requirement}}</p>
</mat-list-item>
</mat-list>
</mat-card-content>
<ng-template #noRequirement><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"> <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="50" fxFlex.lg="50" fxFlex.xl="50" class="m-gap p-gap">
<!-- pd documents card --> <!-- pd documents card -->
<mat-expansion-panel *ngIf="pdDocumentsData.length>0; else nodocument"> <mat-expansion-panel *ngIf="pdDocumentsData.length>0; else nodocument">

View File

@ -11,7 +11,8 @@ import { TelePdAllocationComponent } from './../../../personal-discussion/manage
import { SchedulePdComponent } from './../../../personal-discussion/manage-pd/list-pd/schedule-pd/schedule-pd.component'; import { SchedulePdComponent } from './../../../personal-discussion/manage-pd/list-pd/schedule-pd/schedule-pd.component';
import { EditPdApplicantComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component'; import { EditPdApplicantComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component';
import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component'; import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component';
import { PdRequirementComponent } from './../../../personal-discussion/manage-pd/list-pd/pd-requirement/pd-requirement.component';
import {DatePipe } from '@angular/common';
@Component({ @Component({
selector: 'app-qc-view', selector: 'app-qc-view',
templateUrl: './qc-view.component.html', templateUrl: './qc-view.component.html',
@ -19,6 +20,7 @@ import { EditPdMasterComponent } from './../../../personal-discussion/manage-pd/
encapsulation: ViewEncapsulation.None encapsulation: ViewEncapsulation.None
}) })
export class QcViewComponent implements OnInit, OnDestroy { export class QcViewComponent implements OnInit, OnDestroy {
pipe = new DatePipe('en-US');
public selectedMoment = new Date(); public selectedMoment = new Date();
private notifier:NotifierService; private notifier:NotifierService;
errorMessage: any; errorMessage: any;
@ -31,7 +33,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
viewParams:any; viewParams:any;
destroyType:number=1; destroyType:number=1;
currentPDStatus:string; currentPDStatus:string;
pdAdditionalReqData: any=[];
enableStartPD: boolean;
// create values for status check // create values for status check
pdStatusCheck :any={ pdStatusCheck :any={
"DRAFT" :'DRAFT', "DRAFT" :'DRAFT',
@ -46,6 +49,7 @@ export class QcViewComponent implements OnInit, OnDestroy {
constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder, constructor(notifier:NotifierService,private dialog: MatDialog,private _fb: FormBuilder,
private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent) { private _qc: QcService,private route: ActivatedRoute,private router: Router, private QcListComponent: QcListComponent) {
this.notifier=notifier this.notifier=notifier
this.enableStartPD=false;
} }
ngOnInit() { ngOnInit() {
@ -64,8 +68,25 @@ export class QcViewComponent implements OnInit, OnDestroy {
this.pdApplicantData= data.records.applicants_details; this.pdApplicantData= data.records.applicants_details;
this.pdDocumentsData=data.records.pd_documnets; this.pdDocumentsData=data.records.pd_documnets;
this.masterPdLogsData=data.records.pd_logs.master; this.masterPdLogsData=data.records.pd_logs.master;
this.pdAdditionalReqData = data.records.pd_additional_requirements;
//this.applicantPDLogsData= data.records.pd_logs.master; //this.applicantPDLogsData= data.records.pd_logs.master;
this.currentPDStatus = data.records.pd_master_details[0].pd_status; this.currentPDStatus = data.records.pd_master_details[0].pd_status;
// enable pd start time
if(data.records.pd_master_details[0].scheduled_on_for_validation){
let courrentDateTime: string = this.pipe.transform(new Date(), 'yyyy-MM-dd HH:mm');
let scheduledDateTime: string=data.records.pd_master_details[0].scheduled_on_for_validation;
let diffInMs: number = Date.parse(courrentDateTime) - Date.parse(scheduledDateTime);
let diffInHours: number = Math.floor(diffInMs / 1000 / 60 / 60);
if(diffInHours>=-4){
this.enableStartPD=true;
}
else {
this.enableStartPD=false;
}
}
else {
this.enableStartPD=false;
}
} }
}, error => this.errorMessage = <any> error); }, error => this.errorMessage = <any> error);
@ -84,6 +105,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
} }
const dialogPDMaster = this.dialog.open(EditPdMasterComponent, { const dialogPDMaster = this.dialog.open(EditPdMasterComponent, {
data: record, data: record,
position: { right: '0'},
width: '80%',
disableClose: true disableClose: true
}); });
dialogPDMaster.afterClosed() dialogPDMaster.afterClosed()
@ -99,6 +122,8 @@ export class QcViewComponent implements OnInit, OnDestroy {
} }
const dialogApplicant = this.dialog.open(EditPdApplicantComponent, { const dialogApplicant = this.dialog.open(EditPdApplicantComponent, {
data: setPdDetails, data: setPdDetails,
position: { right: '0'},
width: '60%',
disableClose: true disableClose: true
}); });
dialogApplicant.afterClosed() dialogApplicant.afterClosed()
@ -107,6 +132,24 @@ export class QcViewComponent implements OnInit, OnDestroy {
this.viewPdDetails(this.viewID) this.viewPdDetails(this.viewID)
}); });
} }
// edit pd addtional requirements
editAdditionalRequirement(requirementData:any){
let setPdDetails = {
"pdID":this.viewID,
"records":requirementData
}
const dialogRequirement = this.dialog.open(PdRequirementComponent, {
data: setPdDetails,
position: { right: '0'},
width: '60%',
disableClose: true
});
dialogRequirement.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.viewPdDetails(this.viewID)
});
}
// pd allocation to // pd allocation to
pdAllocationTo(pdData:any) { pdAllocationTo(pdData:any) {
if(pdData.fk_pd_type == 1){ if(pdData.fk_pd_type == 1){

View File

@ -11,10 +11,10 @@ import { environment } from 'environments/environment';
/** Imported Service Files Are., */ /** Imported Service Files Are., */
import { AwsService } from '../../../AwsService/aws.service'; import { AwsService } from '../../../AwsService/aws.service';
/** Consant Value For Created Date And Updated Date */ /** Consant Value For Created Date And Updated Date */
const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' '); const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' ');
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
@ -24,6 +24,7 @@ const currentdate = new Date().toJSON().slice(0, 19).replace('T', ' ');
* Kdk * Kdk
*/ */
export class EntityService { export class EntityService {
private apiUrl = environment.apiEndpoint; private apiUrl = environment.apiEndpoint;
private serviceUrl = 'https://jsonplaceholder.typicode.com/users'; private serviceUrl = 'https://jsonplaceholder.typicode.com/users';