New Form STOCK, FINANCE, EMP-INFO, BUSINESS-INFO
This commit is contained in:
parent
8f3a7e8673
commit
aeb2bab356
@ -1,3 +1,4 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
<p>Address</p>
|
<p>Address</p>
|
||||||
<form class="address" [formGroup]="addressForm">
|
<form class="address" [formGroup]="addressForm">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
@ -104,4 +105,4 @@
|
|||||||
<button mat-raised-button type="submit" class="button" (click)="onSubmit()">Submit
|
<button mat-raised-button type="submit" class="button" (click)="onSubmit()">Submit
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<notifier-container></notifier-container>
|
</mat-card>
|
||||||
@ -1,16 +1,17 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
<form [formGroup]="bankingForm" class="bankForm">
|
<form [formGroup]="bankingForm" class="bankForm">
|
||||||
<div formArrayName="itemRows">
|
<div formArrayName="itemRows">
|
||||||
<mat-accordion
|
<mat-accordion
|
||||||
*ngFor="let itemrow of bankingForm.controls.itemRows.controls; let i=index"
|
*ngFor="let itemrow of bankingForm.controls.itemRows.controls; let i=index"
|
||||||
[formGroupName]="i">
|
[formGroupName]="i">
|
||||||
<mat-expansion-panel class="banlFields" [expanded]="step == i">
|
<mat-expansion-panel class="banlFields" [expanded]="step == i" (opened)="setStep(i)">
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title>
|
<mat-panel-title>
|
||||||
<h4>{{i+1}} Banking details<span *ngIf="i==0" style="float: right;">
|
<h4>{{i+1}} Banking details<span *ngIf="i==0" style="float: right;">
|
||||||
<mat-icon (click)="addBankdetails(i)">add</mat-icon>
|
<mat-icon (click)="addBankdetails($event)">add</mat-icon>
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="i > 0">
|
<span *ngIf="i > 0">
|
||||||
<mat-icon (click)="deleteBankdetails(i)">delete</mat-icon>
|
<mat-icon (click)="deleteBankdetails(i, $event)">delete</mat-icon>
|
||||||
</span></h4>
|
</span></h4>
|
||||||
</mat-panel-title>
|
</mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
@ -63,4 +64,4 @@
|
|||||||
<button mat-raised-button class="button" (click)="bankSubmit()">Submit
|
<button mat-raised-button class="button" (click)="bankSubmit()">Submit
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
<notifier-container></notifier-container>
|
</mat-card>
|
||||||
@ -81,16 +81,21 @@ export class BankingDetailsComponent implements OnInit {
|
|||||||
vintage: ['', Validators.compose([Validators.required])],
|
vintage: ['', Validators.compose([Validators.required])],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
addBankdetails(i) {
|
addBankdetails(event) {
|
||||||
this.step = i++;
|
event.stopPropagation();
|
||||||
const control = <FormArray>this.bankingForm.controls['itemRows'];
|
const control = <FormArray>this.bankingForm.controls['itemRows'];
|
||||||
|
let length = control.length;
|
||||||
|
this.step = length;
|
||||||
control.push(this.createBankarray());
|
control.push(this.createBankarray());
|
||||||
}
|
}
|
||||||
deleteBankdetails(index: number) {
|
deleteBankdetails(index: number, event) {
|
||||||
|
event.stopPropagation();
|
||||||
const control = <FormArray>this.bankingForm.controls['itemRows'];
|
const control = <FormArray>this.bankingForm.controls['itemRows'];
|
||||||
control.removeAt(index);
|
control.removeAt(index);
|
||||||
}
|
}
|
||||||
|
setStep(index: number) {
|
||||||
|
this.step = index;
|
||||||
|
}
|
||||||
bankSubmit() {
|
bankSubmit() {
|
||||||
if (!this.bankingForm.valid) {
|
if (!this.bankingForm.valid) {
|
||||||
this.validateAllFormFields(this.bankingForm);
|
this.validateAllFormFields(this.bankingForm);
|
||||||
|
|||||||
@ -0,0 +1,306 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
|
<p>Business Details</p>
|
||||||
|
<form [formGroup]="businessForm" class="address">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Name of Business / Profession" formControlName="profession_name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="How many years in Business" formControlName="business_years">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<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-form-field>
|
||||||
|
<mat-select placeholder="Type of Activity"
|
||||||
|
formControlName="type_of_activity">
|
||||||
|
<mat-option value="{{type.type_of_activity_id}}" *ngFor="let type of activityData">{{type.name}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Seasonality" formControlName="seasonality">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Designation
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="designation">
|
||||||
|
<div *ngFor="let members of businessForm.get('designation').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="card">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Name" formControlName="sec_name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Designation" formControlName="sec_designation">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addDesignation()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteDesignation(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Who started the business / professions"
|
||||||
|
formControlName="who_started">
|
||||||
|
<mat-option value="applicant">Started by Applicant</mat-option>
|
||||||
|
<mat-option value="family_business">Family Business</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Main person running the businesss"
|
||||||
|
formControlName="main_person">
|
||||||
|
<mat-option value="applicants">One of the applicants</mat-option>
|
||||||
|
<mat-option value="Relative">Relative of an applicant</mat-option>
|
||||||
|
<mat-option value="Others">Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="businessForm.controls['main_person'].value == 'Others'">
|
||||||
|
<input matInput placeholder="Specify other persion"
|
||||||
|
formControlName="other_main_person">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select multiple placeholder="Other family members invovled"
|
||||||
|
formControlName="other_main_person"formControlName="family_members_involved" (selectionChange)="relationChanged($event, i)">
|
||||||
|
<mat-option value="{{member.relationship_id}}" *ngFor="let member of relationData">{{member.name}}</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Any other business before"
|
||||||
|
formControlName="before_business">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Any delays"
|
||||||
|
formControlName="any_delays">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Partners / Directors / Shareholders
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="partners">
|
||||||
|
<div *ngFor="let members of businessForm.get('partners').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="card">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Name"
|
||||||
|
formControlName="partner_name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Share of Profit / Shareholding"
|
||||||
|
formControlName="shareholding">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="No. of yrs in this business"
|
||||||
|
formControlName="current_business_experiance">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Total Business experience"
|
||||||
|
formControlName="total_business_experiance">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addPartnerDetails()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deletePartnerDetails(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Employees As per applicant
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Total"
|
||||||
|
formControlName="employees_total">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Permanent"
|
||||||
|
formControlName="employees_permanent">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Temporary"
|
||||||
|
formControlName="employees_temporary">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>As per PD Officer
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Total"
|
||||||
|
formControlName="officer_total">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Permanent"
|
||||||
|
formControlName="officer_permanent">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Temporary"
|
||||||
|
formControlName="officer_temporary">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Investments
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Amount invested by applicant"
|
||||||
|
formControlName="invested_amount">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Monthly Working capital needed"
|
||||||
|
formControlName="working_capital">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Location
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select
|
||||||
|
placeholder="Is the location of the business / profession suited to the nature of business / service provided? "
|
||||||
|
formControlName="is_service_provided">
|
||||||
|
<mat-option value="well_suited.">Well Suited.</mat-option>
|
||||||
|
<mat-option value="fairly_suited">Fairly Suited</mat-option>
|
||||||
|
<mat-option value="not_suited">Not Suited</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Business Setup
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="What is the Ownership of the setup ?"
|
||||||
|
formControlName="ownership_setup">
|
||||||
|
<mat-option value="self_owned">self owned</mat-option>
|
||||||
|
<mat-option value="rented">Rented</mat-option>
|
||||||
|
<mat-option value="family_owned">Family Owned</mat-option>
|
||||||
|
<mat-option value="others">others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="businessForm.controls['ownership_setup'].value == 'others'">
|
||||||
|
<input matInput placeholder="please specify"
|
||||||
|
formControlName="ownership_others">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="businessForm.controls['ownership_setup'].value == 'rented'">
|
||||||
|
<input matInput placeholder="provide rent paid?"
|
||||||
|
formControlName="rent_paid">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Is the below documents seen and photo captured ?
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Shop and Eat Act Cert"
|
||||||
|
formControlName="shop_eat_act_cert">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="GST Regn cert"
|
||||||
|
formControlName="gst_Regn_cert">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Export / import cert"
|
||||||
|
formControlName="export_import_cert">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="FactoryCert"
|
||||||
|
formControlName="factory_cert">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Cert of practice"
|
||||||
|
formControlName="practice_cert">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="PF Regn"
|
||||||
|
formControlName="pf_regn">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="ESIC Regn"
|
||||||
|
formControlName="esic_regn">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="do you want to add other documents?"
|
||||||
|
formControlName="other_documents">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<div formArrayName="documents" *ngIf="businessForm.controls['other_documents'].value == 'yes'">
|
||||||
|
<div *ngFor="let members of businessForm.get('documents').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Specify Document Details"
|
||||||
|
formControlName="document">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addDocuments()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteDocuments(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Remarks" formControlName="business_remarks">
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="submitDetails()">Submit</button>
|
||||||
|
</form>
|
||||||
|
</mat-card>
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard > * {
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
.card mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,290 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
FormArray, FormControl, AbstractControl,
|
||||||
|
} from '@angular/forms';
|
||||||
|
|
||||||
|
import { NotifierService } from 'angular-notifier';
|
||||||
|
|
||||||
|
import {
|
||||||
|
MatDialog,
|
||||||
|
MatDialogRef,
|
||||||
|
MAT_DIALOG_DATA
|
||||||
|
} from '@angular/material';
|
||||||
|
/** Service */
|
||||||
|
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||||
|
import {ActivatedRoute, Router} from "@angular/router";
|
||||||
|
@Component({
|
||||||
|
selector: 'app-business-info',
|
||||||
|
templateUrl: './business-info.component.html',
|
||||||
|
styleUrls: ['./business-info.component.scss']
|
||||||
|
})
|
||||||
|
export class BusinessInfoComponent implements OnInit {
|
||||||
|
@Input() pdid: number;
|
||||||
|
@Input() form_id: number;
|
||||||
|
relationData: any = [];
|
||||||
|
industryData: any = [];
|
||||||
|
activityData: any = [];
|
||||||
|
relativeNames: any;
|
||||||
|
public businessForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
this.notifier = notifier;
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.getRelation();
|
||||||
|
this.getIndustry();
|
||||||
|
this.getActivity();
|
||||||
|
this.initBusinessForm();
|
||||||
|
// const Desgn = <FormArray>this.businessForm.controls['designation'];
|
||||||
|
// const Partnr = <FormArray>this.businessForm.controls['partners'];
|
||||||
|
// const otherDoc = <FormArray>this.businessForm.controls['documents'];
|
||||||
|
let params: any = {};
|
||||||
|
params.pd_id = this.pdid;
|
||||||
|
params.pd_form_id = this.form_id;
|
||||||
|
this._pd.retriveForm(params).subscribe(data => {
|
||||||
|
let businessVal = data.records;
|
||||||
|
console.log('data', businessVal);
|
||||||
|
let constVal: any;
|
||||||
|
const Desgn = <FormArray>this.businessForm.controls['designation'];
|
||||||
|
const Partnr = <FormArray>this.businessForm.controls['partners'];
|
||||||
|
const otherDoc = <FormArray>this.businessForm.controls['documents'];
|
||||||
|
|
||||||
|
if (data.status == 200) {
|
||||||
|
let DocArray: any;
|
||||||
|
let DesgnArray = Object.keys(data.records.designation).map(function (key) {
|
||||||
|
return data.records.designation[key];
|
||||||
|
});
|
||||||
|
let PartnrArray = Object.keys(data.records.partners).map(function (key) {
|
||||||
|
return data.records.partners[key];
|
||||||
|
});
|
||||||
|
|
||||||
|
let selectedMembers = Object.keys(data.records.family_members_involved).map(function (key) {
|
||||||
|
return data.records.family_members_involved[key];
|
||||||
|
});
|
||||||
|
let enduse: any = [];
|
||||||
|
selectedMembers.forEach(val => {
|
||||||
|
enduse.push(val.member);
|
||||||
|
});
|
||||||
|
if (DesgnArray.length == 0) {
|
||||||
|
Desgn.push(this.createDesignation());
|
||||||
|
} else {
|
||||||
|
Desgn.push(this.createDesignation());
|
||||||
|
}
|
||||||
|
if (PartnrArray.length == 0) {
|
||||||
|
Partnr.push(this.createPartners());
|
||||||
|
} else {
|
||||||
|
PartnrArray.forEach(datas => {
|
||||||
|
Partnr.push(this.createPartners());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (data.other_documents == 'yes') {
|
||||||
|
DocArray = Object.keys(data.records.documents).map(function (key) {
|
||||||
|
return data.records.documents[key];
|
||||||
|
});
|
||||||
|
DocArray.forEach(datas => {
|
||||||
|
otherDoc.push(this.createDocument());
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
DocArray = [{document: ''}];
|
||||||
|
otherDoc.push(this.createDocument());
|
||||||
|
}
|
||||||
|
if (data.records.ownership_setup != 'others') {
|
||||||
|
businessVal.ownership_others = '';
|
||||||
|
}
|
||||||
|
if (data.records.ownership_setup != 'rented') {
|
||||||
|
businessVal.rent_paid = '';
|
||||||
|
}
|
||||||
|
businessVal.family_members_involved = enduse;
|
||||||
|
businessVal.pdid = this.pdid;
|
||||||
|
businessVal.formid = this.form_id;
|
||||||
|
businessVal.fk_createdby = this.pdid;
|
||||||
|
businessVal.designation = DesgnArray;
|
||||||
|
businessVal.partners = PartnrArray;
|
||||||
|
businessVal.documents = DocArray;
|
||||||
|
console.log('businessVal', businessVal);
|
||||||
|
|
||||||
|
this.businessForm.setValue(businessVal);
|
||||||
|
} else {
|
||||||
|
Desgn.push(this.createDesignation());
|
||||||
|
Partnr.push(this.createPartners());
|
||||||
|
otherDoc.push(this.createDocument());
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
// Desgn.push(this.createDesignation());
|
||||||
|
// Partnr.push(this.createPartners());
|
||||||
|
// otherDoc.push(this.createDocument());
|
||||||
|
}
|
||||||
|
public initBusinessForm(): void {
|
||||||
|
this.businessForm = this.fb.group({
|
||||||
|
pdid: this.pdid,
|
||||||
|
formid: this.form_id,
|
||||||
|
fk_createdby: this.pdid,
|
||||||
|
profession_name: ['', Validators.compose([Validators.required])],
|
||||||
|
business_years: ['', Validators.compose([Validators.required])],
|
||||||
|
industry: ['', Validators.compose([Validators.required])],
|
||||||
|
type_of_activity: ['', Validators.compose([Validators.required])],
|
||||||
|
seasonality: ['', Validators.compose([Validators.required])],
|
||||||
|
designation: this.fb.array([]),
|
||||||
|
partners: this.fb.array([]),
|
||||||
|
employees_total: ['', Validators.compose([Validators.required])],
|
||||||
|
employees_permanent: ['', Validators.compose([Validators.required])],
|
||||||
|
employees_temporary: ['', Validators.compose([Validators.required])],
|
||||||
|
officer_total: ['', Validators.compose([Validators.required])],
|
||||||
|
officer_permanent: ['', Validators.compose([Validators.required])],
|
||||||
|
officer_temporary: ['', Validators.compose([Validators.required])],
|
||||||
|
invested_amount: ['', Validators.compose([Validators.required])],
|
||||||
|
working_capital: ['', Validators.compose([Validators.required])],
|
||||||
|
is_service_provided: ['', Validators.compose([Validators.required])],
|
||||||
|
ownership_setup: ['', Validators.compose([Validators.required])],
|
||||||
|
ownership_others: [''],
|
||||||
|
rent_paid: [''],
|
||||||
|
shop_eat_act_cert: ['', Validators.compose([Validators.required])],
|
||||||
|
gst_Regn_cert: ['', Validators.compose([Validators.required])],
|
||||||
|
export_import_cert: ['', Validators.compose([Validators.required])],
|
||||||
|
factory_cert: ['', Validators.compose([Validators.required])],
|
||||||
|
practice_cert: ['', Validators.compose([Validators.required])],
|
||||||
|
pf_regn: ['', Validators.compose([Validators.required])],
|
||||||
|
esic_regn: ['', Validators.compose([Validators.required])],
|
||||||
|
other_documents: ['', Validators.compose([Validators.required])],
|
||||||
|
documents: this.fb.array([]),
|
||||||
|
business_remarks: ['', Validators.compose([Validators.required])],
|
||||||
|
who_started: ['', Validators.compose([Validators.required])],
|
||||||
|
main_person: ['', Validators.compose([Validators.required])],
|
||||||
|
other_main_person: [''],
|
||||||
|
family_members_involved: ['', Validators.compose([Validators.required])],
|
||||||
|
before_business: ['', Validators.compose([Validators.required])],
|
||||||
|
any_delays: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createDesignation(): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
sec_name: ['', Validators.compose([Validators.required])],
|
||||||
|
sec_designation: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createPartners(): FormGroup {
|
||||||
|
return this.fb.group({
|
||||||
|
partner_name: ['', Validators.compose([Validators.required])],
|
||||||
|
shareholding: ['', Validators.compose([Validators.required])],
|
||||||
|
current_business_experiance: ['', Validators.compose([Validators.required])],
|
||||||
|
total_business_experiance: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createDocument() {
|
||||||
|
return this.fb.group({
|
||||||
|
document: ['']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addDesignation() {
|
||||||
|
const control = <FormArray>this.businessForm.controls['designation'];
|
||||||
|
control.push(this.createDesignation());
|
||||||
|
}
|
||||||
|
deleteDesignation(index) {
|
||||||
|
const control = <FormArray>this.businessForm.controls['designation'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
addPartnerDetails() {
|
||||||
|
const control = <FormArray>this.businessForm.controls['partners'];
|
||||||
|
control.push(this.createPartners());
|
||||||
|
}
|
||||||
|
deletePartnerDetails(index) {
|
||||||
|
const control = <FormArray>this.businessForm.controls['partners'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
addDocuments() {
|
||||||
|
const control = <FormArray>this.businessForm.controls['documents'];
|
||||||
|
control.push(this.createDocument());
|
||||||
|
}
|
||||||
|
deleteDocuments(index) {
|
||||||
|
const control = <FormArray>this.businessForm.controls['documents'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
getRelation() {
|
||||||
|
let master_name = 'RELATIONSHIPS';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.relationData.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
relationChanged(event) {
|
||||||
|
this.relativeNames = [];
|
||||||
|
event.value.forEach(option => {
|
||||||
|
this.relativeNames.push({member: option});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getIndustry() {
|
||||||
|
let master_name = 'INDUSTRYCLASSIFICATION';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.industryData.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getActivity() {
|
||||||
|
let master_name = 'TYPEOFACTIVITY';
|
||||||
|
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
data.records.forEach(val => {
|
||||||
|
if (val.isactive == 1) {
|
||||||
|
this.activityData.push(val);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
submitDetails() {
|
||||||
|
let family: any = [];
|
||||||
|
if (!this.businessForm.valid) {
|
||||||
|
console.log('form', this.businessForm)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let design: any;
|
||||||
|
let records = this.businessForm.value;
|
||||||
|
if (records.other_documents == 'no') {
|
||||||
|
delete records.documents;
|
||||||
|
}
|
||||||
|
if (records.rent_paid == '') {
|
||||||
|
delete records.rent_paid;
|
||||||
|
}
|
||||||
|
if (records.ownership_others == '') {
|
||||||
|
delete records.ownership_others;
|
||||||
|
}
|
||||||
|
records.family_members_involved = this.relativeNames;
|
||||||
|
console.log('recordss', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
}, error => {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
validateAllFormFields(formGroup: FormGroup) {
|
||||||
|
Object.keys(formGroup.controls).forEach(field => {
|
||||||
|
const control = formGroup.get(field);
|
||||||
|
if (control instanceof FormControl) {
|
||||||
|
control.markAsTouched({onlySelf: true});
|
||||||
|
} else if (control instanceof FormGroup) {
|
||||||
|
this.validateAllFormFields(control);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -200,13 +200,11 @@ var result = Object.keys(supp_data).map(function(key) {
|
|||||||
this.paymentModeTextBox = e.value;
|
this.paymentModeTextBox = e.value;
|
||||||
// this.f.supplier_details.controls.get('payment_mode_value');
|
// this.f.supplier_details.controls.get('payment_mode_value');
|
||||||
}
|
}
|
||||||
|
|
||||||
public freqPurchaseTextBox: number;
|
public freqPurchaseTextBox: number;
|
||||||
selectedFreqPurchase(e){
|
selectedFreqPurchase(e){
|
||||||
this.freqPurchaseTextBox = e.value;
|
this.freqPurchaseTextBox = e.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** To Save/Edited Popup Data */
|
/** To Save/Edited Popup Data */
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
this.submitted = true;
|
this.submitted = true;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
<p>Current Loan Details</p>
|
<p>Current Loan Details</p>
|
||||||
<form [formGroup]="currentLoanForm" class="address">
|
<form [formGroup]="currentLoanForm" class="address">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
@ -45,5 +46,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<button mat-raised-button type="submit" class="button" (click)="submitCurrentloan()"></button>
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Remarks" formControlName="currentloan_remarks">
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="submitCurrentloan()">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
</mat-card>
|
||||||
@ -12,7 +12,6 @@
|
|||||||
}
|
}
|
||||||
.address .button {
|
.address .button {
|
||||||
float: right;
|
float: right;
|
||||||
height: 10px;
|
|
||||||
width: 10px;
|
width: 10px;
|
||||||
background: #62B013;
|
background: #62B013;
|
||||||
color: white;
|
color: white;
|
||||||
|
|||||||
@ -52,6 +52,7 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
return value.records.loan_details[key];
|
return value.records.loan_details[key];
|
||||||
});
|
});
|
||||||
this.currentLoanForm.controls['existing_loan'].setValue(value.records.existing_loan);
|
this.currentLoanForm.controls['existing_loan'].setValue(value.records.existing_loan);
|
||||||
|
this.currentLoanForm.controls['currentloan_remarks'].setValue(value.records.currentloan_remarks);
|
||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
result.forEach(val => {
|
result.forEach(val => {
|
||||||
control.push(this.createLoanDetail());
|
control.push(this.createLoanDetail());
|
||||||
@ -68,7 +69,8 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
public initCurrentloanForm(): void {
|
public initCurrentloanForm(): void {
|
||||||
this.currentLoanForm = this.fb.group({
|
this.currentLoanForm = this.fb.group({
|
||||||
existing_loan: ['', Validators.compose([Validators.required])],
|
existing_loan: ['', Validators.compose([Validators.required])],
|
||||||
loan_details: this.fb.array([])
|
currentloan_remarks: ['', Validators.compose([Validators.required])],
|
||||||
|
loan_details: this.fb.array([]),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
createLoanDetail() {
|
createLoanDetail() {
|
||||||
@ -99,6 +101,7 @@ export class CurrentLoanComponent implements OnInit {
|
|||||||
records.formid = this.form_id;
|
records.formid = this.form_id;
|
||||||
records.fk_createdby = this.pdid;
|
records.fk_createdby = this.pdid;
|
||||||
records.existing_loan = this.currentLoanForm.controls['existing_loan'].value;
|
records.existing_loan = this.currentLoanForm.controls['existing_loan'].value;
|
||||||
|
records.currentloan_remarks = this.currentLoanForm.controls['currentloan_remarks'].value;
|
||||||
records.loan_details = this.currentLoanForm.controls['loan_details'].value;
|
records.loan_details = this.currentLoanForm.controls['loan_details'].value;
|
||||||
console.log('data', records);
|
console.log('data', records);
|
||||||
this._pd.saveForm(records).subscribe(data => {
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
|||||||
@ -0,0 +1,71 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
|
<form [formGroup]="employmentForm" class="address">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Name of employer" formControlName="employer_name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Since how long working with this employer?" formControlName="how_long">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Was the employer met?"
|
||||||
|
formControlName="was_met">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="employmentForm.controls['was_met'].value == 'yes'">
|
||||||
|
<input matInput placeholder="Name and Designation of person met" formControlName="name_designation">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Salary amount confirmed ?"
|
||||||
|
formControlName="confirm_salary">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="employmentForm.controls['confirm_salary'].value == 'yes'">
|
||||||
|
<input matInput placeholder="What is the salary amount confirmed?" formControlName="confirm_salary_amount">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Attendance Register seen ?"
|
||||||
|
formControlName="attendance_seen">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Salary register seen ?"
|
||||||
|
formControlName="sal_reg_seen">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Salary Details<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Gross" formControlName="gross">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Net Take home"
|
||||||
|
formControlName="net_take_home">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Bonus or incentive"
|
||||||
|
formControlName="bonus_incentive">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Any delays"
|
||||||
|
formControlName="any_delays">
|
||||||
|
</mat-form-field>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Remarks" formControlName="employment_remarks">
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="submitDetails()">Submit</button>
|
||||||
|
</form>
|
||||||
|
</mat-card>
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard > * {
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
FormArray, FormControl,
|
||||||
|
} from '@angular/forms';
|
||||||
|
|
||||||
|
import { NotifierService } from 'angular-notifier';
|
||||||
|
|
||||||
|
import {
|
||||||
|
MatDialog,
|
||||||
|
MatDialogRef,
|
||||||
|
MAT_DIALOG_DATA
|
||||||
|
} from '@angular/material';
|
||||||
|
/** Service */
|
||||||
|
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||||
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
|
@Component({
|
||||||
|
selector: 'app-employment-info',
|
||||||
|
templateUrl: './employment-info.component.html',
|
||||||
|
styleUrls: ['./employment-info.component.scss']
|
||||||
|
})
|
||||||
|
export class EmploymentInfoComponent implements OnInit {
|
||||||
|
@Input() pdid: number;
|
||||||
|
@Input() form_id: number;
|
||||||
|
public employmentForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
this.notifier = notifier;
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.initemploymentForm();
|
||||||
|
let params: any = {};
|
||||||
|
params.pd_id = this.pdid;
|
||||||
|
params.pd_form_id = this.form_id;
|
||||||
|
this._pd.retriveForm(params).subscribe(value => {
|
||||||
|
console.log('value', value);
|
||||||
|
if (value.status == 200) {
|
||||||
|
this.employmentForm.controls['employer_name'].setValue(value.records.employer_name);
|
||||||
|
this.employmentForm.controls['how_long'].setValue(value.records.how_long);
|
||||||
|
this.employmentForm.controls['was_met'].setValue(value.records.was_met);
|
||||||
|
if (value.records.name_designation) {
|
||||||
|
this.employmentForm.controls['name_designation'].setValue(value.records.name_designation);
|
||||||
|
}
|
||||||
|
this.employmentForm.controls['confirm_salary'].setValue(value.records.confirm_salary);
|
||||||
|
if (value.records.confirm_salary_amount) {
|
||||||
|
this.employmentForm.controls['confirm_salary_amount'].setValue(value.records.confirm_salary_amount);
|
||||||
|
}
|
||||||
|
this.employmentForm.controls['attendance_seen'].setValue(value.records.attendance_seen);
|
||||||
|
this.employmentForm.controls['sal_reg_seen'].setValue(value.records.sal_reg_seen);
|
||||||
|
this.employmentForm.controls['gross'].setValue(value.records.gross);
|
||||||
|
this.employmentForm.controls['net_take_home'].setValue(value.records.net_take_home);
|
||||||
|
this.employmentForm.controls['bonus_incentive'].setValue(value.records.bonus_incentive);
|
||||||
|
this.employmentForm.controls['any_delays'].setValue(value.records.any_delays);
|
||||||
|
this.employmentForm.controls['employment_remarks'].setValue(value.records.employment_remarks);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
public initemploymentForm(): void {
|
||||||
|
this.employmentForm = this.fb.group({
|
||||||
|
employer_name: ['', Validators.compose([Validators.required])],
|
||||||
|
how_long: ['', Validators.compose([Validators.required])],
|
||||||
|
was_met: ['', Validators.compose([Validators.required])],
|
||||||
|
name_designation: [''],
|
||||||
|
confirm_salary: ['', Validators.compose([Validators.required])],
|
||||||
|
confirm_salary_amount: [''],
|
||||||
|
attendance_seen: ['', Validators.compose([Validators.required])],
|
||||||
|
sal_reg_seen: ['', Validators.compose([Validators.required])],
|
||||||
|
gross: ['', Validators.compose([Validators.required])],
|
||||||
|
net_take_home: ['', Validators.compose([Validators.required])],
|
||||||
|
bonus_incentive: ['', Validators.compose([Validators.required])],
|
||||||
|
any_delays: ['', Validators.compose([Validators.required])],
|
||||||
|
employment_remarks: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
submitDetails() {
|
||||||
|
if (!this.employmentForm.valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let records: any = {};
|
||||||
|
records.pdid = this.pdid;
|
||||||
|
records.formid = this.form_id;
|
||||||
|
records.fk_createdby = this.pdid;
|
||||||
|
records.employer_name = this.employmentForm.controls['employer_name'].value;
|
||||||
|
records.how_long = this.employmentForm.controls['how_long'].value;
|
||||||
|
records.was_met = this.employmentForm.controls['was_met'].value;
|
||||||
|
if (this.employmentForm.controls['was_met'].value == 'yes') {
|
||||||
|
records.name_designation = this.employmentForm.controls['name_designation'].value;
|
||||||
|
}
|
||||||
|
records.confirm_salary = this.employmentForm.controls['confirm_salary'].value;
|
||||||
|
if (this.employmentForm.controls['confirm_salary'].value == 'yes') {
|
||||||
|
records.confirm_salary_amount = this.employmentForm.controls['confirm_salary_amount'].value;
|
||||||
|
}
|
||||||
|
records.attendance_seen = this.employmentForm.controls['attendance_seen'].value;
|
||||||
|
records.sal_reg_seen = this.employmentForm.controls['sal_reg_seen'].value;
|
||||||
|
records.gross = this.employmentForm.controls['gross'].value;
|
||||||
|
records.net_take_home = this.employmentForm.controls['net_take_home'].value;
|
||||||
|
records.bonus_incentive = this.employmentForm.controls['bonus_incentive'].value;
|
||||||
|
records.any_delays = this.employmentForm.controls['any_delays'].value;
|
||||||
|
records.employment_remarks = this.employmentForm.controls['employment_remarks'].value;
|
||||||
|
console.log('data', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
}, error => {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
<p>Family</p>
|
<p>Family</p>
|
||||||
<form class="address" [formGroup]="familyForm">
|
<form class="address" [formGroup]="familyForm">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
@ -132,4 +133,4 @@
|
|||||||
</mat-card>
|
</mat-card>
|
||||||
<button mat-raised-button class="button" (click)="submitFamily()">Submit</button>
|
<button mat-raised-button class="button" (click)="submitFamily()">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
<notifier-container></notifier-container>
|
</mat-card>
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
|
<form [formGroup]="financialForm" class="address">
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Data as per Financial statements<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="date_per_financial">
|
||||||
|
<div *ngFor="let details of financialForm.get('date_per_financial').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Year (format: 2015-16)" formControlName="financial_year">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Annual Sale" formControlName="financial_annual_sale">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin($event, i)">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput disabled placeholder="Margin" formControlName="financial_margin">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Variation from Previous Year" formControlName="financial_variation">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Reason for major difference" formControlName="financial_reason">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addDate()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteDate(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Estimated Value<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="estimated_value">
|
||||||
|
<div *ngFor="let details of financialForm.get('estimated_value').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Year (format: 2015-16)" formControlName="estimate_year">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Annual Sale" formControlName="estimate_annual_sale">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Net Profit / Loss" formControlName="estimate_net_profit">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Margin" formControlName="estimate_margin">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Variation from Previous Year" formControlName="estimate_variation">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Reason for major difference" formControlName="estimate_reason">
|
||||||
|
</mat-form-field>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addGoods()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Remarks" formControlName="financial_remarks">
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="submitDetails()">Submit</button>
|
||||||
|
</form>
|
||||||
|
</mat-card>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,163 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
FormArray, FormControl, AbstractControl,
|
||||||
|
} from '@angular/forms';
|
||||||
|
|
||||||
|
import { NotifierService } from 'angular-notifier';
|
||||||
|
|
||||||
|
import {
|
||||||
|
MatDialog,
|
||||||
|
MatDialogRef,
|
||||||
|
MAT_DIALOG_DATA
|
||||||
|
} from '@angular/material';
|
||||||
|
/** Service */
|
||||||
|
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||||
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
|
@Component({
|
||||||
|
selector: 'app-financial-info',
|
||||||
|
templateUrl: './financial-info.component.html',
|
||||||
|
styleUrls: ['./financial-info.component.scss']
|
||||||
|
})
|
||||||
|
export class FinancialInfoComponent implements OnInit {
|
||||||
|
@Input() pdid: number;
|
||||||
|
@Input() form_id: number;
|
||||||
|
public financialForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
marginVal: any = [] ;
|
||||||
|
setmargin: AbstractControl;
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
this.notifier = notifier;
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.initstockForm();
|
||||||
|
let params: any = {};
|
||||||
|
params.pd_id = this.pdid;
|
||||||
|
params.pd_form_id = this.form_id;
|
||||||
|
this._pd.retriveForm(params).subscribe(value => {
|
||||||
|
console.log('value', value);
|
||||||
|
// const rawMaterial = <FormArray>this.financialForm.controls['raw_materials'];
|
||||||
|
// const finishedGoods = <FormArray>this.financialForm.controls['finished_goods'];
|
||||||
|
// if (value.status == 200) {
|
||||||
|
// let result = Object.keys(value.records.raw_materials).map(function(key) {
|
||||||
|
// return value.records.raw_materials[key];
|
||||||
|
// });
|
||||||
|
// let result_Goods = Object.keys(value.records.finished_goods).map(function(key) {
|
||||||
|
// return value.records.finished_goods[key];
|
||||||
|
// });
|
||||||
|
// this.stockForm.controls['stock_remarks'].setValue(value.records.stock_remarks);
|
||||||
|
// if (result.length > 0) {
|
||||||
|
// result.forEach(val => {
|
||||||
|
// rawMaterial.push(this.createRawmaterial());
|
||||||
|
// });
|
||||||
|
// this.stockForm.controls['raw_materials'].setValue(result);
|
||||||
|
// } else {
|
||||||
|
// rawMaterial.push(this.createRawmaterial());
|
||||||
|
// }
|
||||||
|
// if (result_Goods.length > 0) {
|
||||||
|
// result_Goods.forEach(val => {
|
||||||
|
// finishedGoods.push(this.createGoods());
|
||||||
|
// });
|
||||||
|
// this.stockForm.controls['finished_goods'].setValue(result_Goods);
|
||||||
|
// } else {
|
||||||
|
// finishedGoods.push(this.createGoods());
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// rawMaterial.push(this.createRawmaterial());
|
||||||
|
// finishedGoods.push(this.createGoods());
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
public initstockForm(): void {
|
||||||
|
this.financialForm = this.fb.group({
|
||||||
|
financial_remarks: ['', Validators.compose([Validators.required])],
|
||||||
|
date_per_financial: this.fb.array([this.createDate()]),
|
||||||
|
estimated_value: this.fb.array([this.createValue()])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createDate() {
|
||||||
|
return this.fb.group({
|
||||||
|
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_net_profit: ['', Validators.compose([Validators.required, Validators.pattern(/^-?[1-9]\d*|0$/)])],
|
||||||
|
financial_margin: ['', Validators.compose([Validators.required])],
|
||||||
|
financial_variation: ['', Validators.compose([Validators.required])],
|
||||||
|
financial_reason: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createValue() {
|
||||||
|
return this.fb.group({
|
||||||
|
estimate_year: ['', Validators.compose([Validators.required, Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])],
|
||||||
|
estimate_annual_sale: ['', Validators.compose([Validators.required, Validators.pattern(/^[0-9]$/)])],
|
||||||
|
estimate_net_profit: ['', Validators.compose([Validators.required, Validators.pattern(/^-?[1-9]\d*|0$/)])],
|
||||||
|
estimate_margin: ['', Validators.compose([Validators.required])],
|
||||||
|
estimate_variation: ['', Validators.compose([Validators.required])],
|
||||||
|
estimate_reason: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addDate() {
|
||||||
|
const control = <FormArray>this.financialForm.controls['date_per_financial'];
|
||||||
|
control.push(this.createDate());
|
||||||
|
}
|
||||||
|
deleteDate(index) {
|
||||||
|
const control = <FormArray>this.financialForm.controls['date_per_financial'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
addGoods() {
|
||||||
|
const control = <FormArray>this.financialForm.controls['estimated_value'];
|
||||||
|
control.push(this.createValue());
|
||||||
|
}
|
||||||
|
deleteGoods(index) {
|
||||||
|
const control = <FormArray>this.financialForm.controls['estimated_value'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
calMargin(event, index) {
|
||||||
|
let salary = this.financialForm.controls['date_per_financial'].value[index].financial_annual_sale;
|
||||||
|
console.log(event.target.value);
|
||||||
|
console.log('salary', salary);
|
||||||
|
let margin = event.target.value / salary * 100;
|
||||||
|
this.financialForm.controls['date_per_financial'].value[index].financial_annual_sale = margin.toFixed(2);
|
||||||
|
this.financialForm.controls['date_per_financial'].setValue(this.financialForm.controls['date_per_financial']);
|
||||||
|
}
|
||||||
|
submitDetails() {
|
||||||
|
if (!this.financialForm.valid) {
|
||||||
|
this.validateAllFormFields(this.financialForm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// let records: any = {};
|
||||||
|
// records.pdid = this.pdid;
|
||||||
|
// records.formid = this.form_id;
|
||||||
|
// records.fk_createdby = this.pdid;
|
||||||
|
// records.raw_materials = this.stockForm.controls['raw_materials'].value;
|
||||||
|
// records.stock_remarks = this.stockForm.controls['stock_remarks'].value;
|
||||||
|
// records.finished_goods = this.stockForm.controls['finished_goods'].value;
|
||||||
|
// console.log('data', records);
|
||||||
|
// this._pd.saveForm(records).subscribe(data => {
|
||||||
|
// console.log('data', data);
|
||||||
|
// this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
// }, error => {
|
||||||
|
// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
validateAllFormFields(formGroup: FormGroup) {
|
||||||
|
Object.keys(formGroup.controls).forEach(field => {
|
||||||
|
const control = formGroup.get(field);
|
||||||
|
if (control instanceof FormControl) {
|
||||||
|
control.markAsTouched({onlySelf: true});
|
||||||
|
} else if (control instanceof FormGroup) {
|
||||||
|
this.validateAllFormFields(control);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,48 +1,120 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
<form [formGroup]="loanDetailsForm" class="address">
|
<form [formGroup]="loanDetailsForm" class="address">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput placeholder="Loan Amount applied" formControlName="loan_amount">
|
<input matInput placeholder="Loan Amount applied" formControlName="loan_amount">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select placeholder="What is the end use"
|
<mat-select multiple placeholder="What is the end use"
|
||||||
formControlName="other_income">
|
formControlName="end_use" (selectionChange)="endUserChange($event)">
|
||||||
<mat-option value="Yes">Yes</mat-option>
|
<mat-option value="purchase_of_property"> Puchase of property</mat-option>
|
||||||
<mat-option value="No">No</mat-option>
|
<mat-option value="construction">Construction</mat-option>
|
||||||
|
<mat-option value="extention">Extention</mat-option>
|
||||||
|
<mat-option value="improvement">Improvement</mat-option>
|
||||||
|
<mat-option value="working_capital">Working capital</mat-option>
|
||||||
|
<mat-option value="purchase_of_business_asset">Purchase of business asset</mat-option>
|
||||||
|
<mat-option value="to_close_an_existing_debt">to close an existing debt</mat-option>
|
||||||
|
<mat-option value="other">Other purpose</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
|
<mat-form-field *ngIf="isOtherPurpose">
|
||||||
<mat-card-header>
|
<input matInput placeholder="Specify end use" formControlName="end_use_other">
|
||||||
<p>Loan Details<p>
|
</mat-form-field>
|
||||||
</mat-card-header>
|
<mat-form-field>
|
||||||
<div formArrayName="income_details">
|
<mat-select placeholder="Is there a Balance Transfer"
|
||||||
<div *ngFor="let details of otherIncomeForm.get('income_details').controls; let i=index"
|
formControlName="is_transfer">
|
||||||
[formGroupName]="i">
|
<mat-option value="yes">Yes</mat-option>
|
||||||
<mat-card-content class="matcard">
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Is there a Top/Up"
|
||||||
|
formControlName="is_topup">
|
||||||
|
<mat-option value="yes">Yes</mat-option>
|
||||||
|
<mat-option value="no">No</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes'">
|
||||||
|
<input matInput placeholder="Balance Transfer Amount" formControlName="balance_transfer_amount">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes'">
|
||||||
|
<input matInput placeholder="Top Up Amt" formControlName="topup_amount">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' || loanDetailsForm.controls['is_transfer'].value == 'yes'">
|
||||||
|
<input matInput placeholder="Lender from where Balance Transfer done" formControlName="lender">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Amount of own contribution" formControlName="own_contribution">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select placeholder="Source"
|
<mat-select placeholder="Source"
|
||||||
formControlName="source">
|
formControlName="source">
|
||||||
<mat-option value="rental_income">Rental Income</mat-option>
|
<mat-option value="borrowed">Borrowed from Relatives & Friends</mat-option>
|
||||||
<mat-option value="interest_income">Interest Income</mat-option>
|
<mat-option value="own_money">Own money</mat-option>
|
||||||
<mat-option value="agricultural_income">Agricultural Income</mat-option>
|
<mat-option value="other">Loan from another lender</mat-option>
|
||||||
<mat-option value="dividend_income">Dividend Income and Others</mat-option>
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="loanDetailsForm.controls['source'].value =='other'">
|
||||||
|
<input matInput placeholder="Specify lender name and type" formControlName="lender_name_type">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="EMI comfort level" formControlName="emi_level">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Mortgage
|
||||||
|
<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select placeholder="Type of property" formControlName="property_type">
|
||||||
|
<mat-option value="bungalow">Bungalow</mat-option>
|
||||||
|
<mat-option value="flat">Flat</mat-option>
|
||||||
|
<mat-option value="row_house">Row House</mat-option>
|
||||||
|
<mat-option value="floor">Floor</mat-option>
|
||||||
|
<mat-option value="chawl">Chawl</mat-option>
|
||||||
|
<mat-option value="shed">Shed</mat-option>
|
||||||
|
<mat-option value="office">Office</mat-option>
|
||||||
|
<mat-option value="shop_in_market">Shop in a market</mat-option>
|
||||||
|
<mat-option value="shop_in_mall">shop in a mall</mat-option>
|
||||||
|
<mat-option value="standalone_shop">standalone shop</mat-option>
|
||||||
|
<mat-option value="clinic">clinic</mat-option>
|
||||||
|
<mat-option value="factory">Factory</mat-option>
|
||||||
|
<mat-option value="vacant_land">Vacant Land</mat-option>
|
||||||
|
<mat-option value="others">Others</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field *ngIf="loanDetailsForm.controls['property_type'].value =='others'">
|
||||||
|
<input matInput placeholder="Please specify type of property" formControlName="ownershipOther">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-select multiple placeholder="Name of owner"
|
||||||
|
formControlName="owner_name" (selectionChange)="ownerNameChange($event)">
|
||||||
|
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput placeholder="Amount" formControlName="amount">
|
<mat-select placeholder="Status of construction"
|
||||||
|
formControlName="construction_status">
|
||||||
|
<mat-option value="other_purpose">Under-construction</mat-option>
|
||||||
|
<mat-option value="other_purpose">Complete</mat-option>
|
||||||
|
<mat-option value="other_purpose">Vacant Land</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="EMV as per customer"
|
||||||
|
formControlName="emv_per_customer">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput placeholder="Frequency" formControlName="frequency">
|
<input matInput placeholder="Value as per agreement"
|
||||||
|
formControlName="value_per_agreement">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<button type="button" mat-raised-button mat-icon-button (click)="addIncomeDetails()"
|
|
||||||
*ngIf="i==0">
|
|
||||||
<mat-icon>add</mat-icon>
|
|
||||||
</button>
|
|
||||||
<button type="button" mat-raised-button mat-icon-button (click)="deleteIncomeDetails(i)"
|
|
||||||
*ngIf="i>0">
|
|
||||||
<mat-icon>close</mat-icon>
|
|
||||||
</button>
|
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<button type="submit" (click)="submitCurrentDetails()"></button>
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Remarks" formControlName="loandetails_remarks">
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="submitLoanDetails()">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
</mat-card>
|
||||||
@ -7,6 +7,9 @@
|
|||||||
.address > * {
|
.address > * {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.matcard > * {
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
.matcard mat-form-field {
|
.matcard mat-form-field {
|
||||||
margin: 0 2%;
|
margin: 0 2%;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,74 +30,168 @@ import {ActivatedRoute, Router} from '@angular/router';
|
|||||||
export class LoanDetailsComponent implements OnInit {
|
export class LoanDetailsComponent implements OnInit {
|
||||||
public loanDetailsForm: FormGroup;
|
public loanDetailsForm: FormGroup;
|
||||||
private notifier: NotifierService;
|
private notifier: NotifierService;
|
||||||
frequencyData: any;
|
@Input() pdid: number;
|
||||||
|
@Input() form_id: number;
|
||||||
|
@Input() applicant_details: any;
|
||||||
|
applicants: any;
|
||||||
|
isOtherPurpose: boolean = false;
|
||||||
|
isSource: boolean = false;
|
||||||
|
endUserList: any = [];
|
||||||
|
ownerNames: any = [];
|
||||||
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private _pd: PdTrigerService) {
|
private _pd: PdTrigerService) {
|
||||||
|
|
||||||
|
this.notifier = notifier;
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.applicants = this.applicant_details.pdapplicants_detials;
|
||||||
this.initloanDetailsForm();
|
this.initloanDetailsForm();
|
||||||
// this.getFrequency();
|
let params: any = {};
|
||||||
|
params.pd_id = this.pdid;
|
||||||
|
params.pd_form_id = this.form_id;
|
||||||
|
this._pd.retriveForm(params).subscribe(value => {
|
||||||
|
console.log('value', value);
|
||||||
|
if (value.status == 200) {
|
||||||
|
let result = Object.keys(value.records.end_use_group).map(function(key) {
|
||||||
|
return value.records.end_use_group[key];
|
||||||
|
});
|
||||||
|
let owner = Object.keys(value.records.owner_name_group).map(function(key) {
|
||||||
|
return value.records.owner_name_group[key];
|
||||||
|
});
|
||||||
|
|
||||||
|
let enduse: any = [];
|
||||||
|
result.forEach(val => {
|
||||||
|
enduse.push(val.end_use);
|
||||||
|
});
|
||||||
|
let ownername: any = [];
|
||||||
|
owner.forEach(val => {
|
||||||
|
ownername.push(val.owner_name);
|
||||||
|
});
|
||||||
|
console.log('enduse', enduse);
|
||||||
|
console.log('ownername', ownername);
|
||||||
|
this.loanDetailsForm.controls['loan_amount'].setValue(value.records.loan_amount);
|
||||||
|
this.loanDetailsForm.controls['end_use'].setValue(enduse);
|
||||||
|
if (value.records.end_use_other) {
|
||||||
|
this.loanDetailsForm.controls['end_use_other'].setValue(value.records.end_use_other);
|
||||||
|
}
|
||||||
|
this.loanDetailsForm.controls['is_transfer'].setValue(value.records.is_transfer);
|
||||||
|
this.loanDetailsForm.controls['is_topup'].setValue(value.records.is_topup);
|
||||||
|
if (value.records.balance_transfer_amount) {
|
||||||
|
this.loanDetailsForm.controls['balance_transfer_amount'].setValue(value.records.balance_transfer_amount);
|
||||||
|
}
|
||||||
|
if (value.records.topup_amount) {
|
||||||
|
this.loanDetailsForm.controls['topup_amount'].setValue(value.records.topup_amount);
|
||||||
|
}
|
||||||
|
if (value.records.lender) {
|
||||||
|
this.loanDetailsForm.controls['lender'].setValue(value.records.lender);
|
||||||
|
}
|
||||||
|
this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution);
|
||||||
|
this.loanDetailsForm.controls['source'].setValue(value.records.source);
|
||||||
|
if (value.records.lender_name_type) {
|
||||||
|
this.loanDetailsForm.controls['lender_name_type'].setValue(value.records.lender_name_type);
|
||||||
|
}
|
||||||
|
this.loanDetailsForm.controls['emi_level'].setValue(value.records.emi_level);
|
||||||
|
this.loanDetailsForm.controls['property_type'].setValue(value.records.property_type);
|
||||||
|
this.loanDetailsForm.controls['owner_name'].setValue(ownername);
|
||||||
|
this.loanDetailsForm.controls['construction_status'].setValue(value.records.construction_status);
|
||||||
|
this.loanDetailsForm.controls['emv_per_customer'].setValue(value.records.emv_per_customer);
|
||||||
|
this.loanDetailsForm.controls['value_per_agreement'].setValue(value.records.value_per_agreement);
|
||||||
|
this.loanDetailsForm.controls['loandetails_remarks'].setValue(value.records.loandetails_remarks);
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
public initloanDetailsForm(): void {
|
public initloanDetailsForm(): void {
|
||||||
this.loanDetailsForm = this.fb.group({
|
this.loanDetailsForm = this.fb.group({
|
||||||
other_income: ['', Validators.compose([Validators.required])],
|
loan_amount: ['', Validators.compose([Validators.required])],
|
||||||
// income_details: this.fb.array([this.createDetail()])
|
end_use: ['', Validators.compose([Validators.required])],
|
||||||
|
end_use_other: [''],
|
||||||
|
is_transfer: ['', Validators.compose([Validators.required])],
|
||||||
|
is_topup: ['', Validators.compose([Validators.required])],
|
||||||
|
balance_transfer_amount: [''],
|
||||||
|
topup_amount: [''],
|
||||||
|
lender: [''],
|
||||||
|
own_contribution: ['', Validators.compose([Validators.required])],
|
||||||
|
source: ['', Validators.compose([Validators.required])],
|
||||||
|
lender_name_type: [''],
|
||||||
|
emi_level: ['', Validators.compose([Validators.required])],
|
||||||
|
property_type: ['', Validators.compose([Validators.required])],
|
||||||
|
owner_name: ['', Validators.compose([Validators.required])],
|
||||||
|
construction_status: ['', Validators.compose([Validators.required])],
|
||||||
|
emv_per_customer: ['', Validators.compose([Validators.required])],
|
||||||
|
value_per_agreement: ['', Validators.compose([Validators.required])],
|
||||||
|
loandetails_remarks: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
endUserChange(event) {
|
||||||
|
this.endUserList = [];
|
||||||
|
event.value.forEach(option => {
|
||||||
|
this.endUserList.push({end_use: option});
|
||||||
|
if (option == 'other') {
|
||||||
|
this.isOtherPurpose = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
ownerNameChange(event) {
|
||||||
|
this.ownerNames = [];
|
||||||
|
event.value.forEach(option => {
|
||||||
|
this.ownerNames.push({owner_name: option});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
submitLoanDetails() {
|
||||||
|
console.log('formData', this.loanDetailsForm.value);
|
||||||
|
if (!this.loanDetailsForm.valid) {
|
||||||
|
this.validateAllFormFields(this.loanDetailsForm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let records: any = {};
|
||||||
|
records.pdid = this.pdid;
|
||||||
|
records.formid = this.form_id;
|
||||||
|
records.fk_createdby = this.pdid;
|
||||||
|
records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value;
|
||||||
|
records.end_use_group = this.endUserList;
|
||||||
|
if (this.isOtherPurpose) {
|
||||||
|
records.end_use_other = this.loanDetailsForm.controls['end_use_other'].value;
|
||||||
|
}
|
||||||
|
records.is_transfer = this.loanDetailsForm.controls['is_transfer'].value;
|
||||||
|
records.is_topup = this.loanDetailsForm.controls['is_topup'].value;
|
||||||
|
if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||||
|
records.balance_transfer_amount = this.loanDetailsForm.controls['balance_transfer_amount'].value;
|
||||||
|
}
|
||||||
|
if (this.loanDetailsForm.controls['is_topup'].value == 'yes') {
|
||||||
|
records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value;
|
||||||
|
}
|
||||||
|
if (this.loanDetailsForm.controls['is_topup'].value == 'yes' || this.loanDetailsForm.controls['is_transfer'].value == 'yes') {
|
||||||
|
records.lender = this.loanDetailsForm.controls['lender'].value;
|
||||||
|
}
|
||||||
|
records.own_contribution = this.loanDetailsForm.controls['own_contribution'].value;
|
||||||
|
records.source = this.loanDetailsForm.controls['source'].value;
|
||||||
|
if (this.loanDetailsForm.controls['source'].value == 'other') {
|
||||||
|
records.lender_name_type = this.loanDetailsForm.controls['lender_name_type'].value;
|
||||||
|
}
|
||||||
|
records.emi_level = this.loanDetailsForm.controls['emi_level'].value;
|
||||||
|
records.property_type = this.loanDetailsForm.controls['property_type'].value;
|
||||||
|
records.owner_name_group = this.ownerNames;
|
||||||
|
records.construction_status = this.loanDetailsForm.controls['construction_status'].value;
|
||||||
|
records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value;
|
||||||
|
records.value_per_agreement = this.loanDetailsForm.controls['value_per_agreement'].value;
|
||||||
|
records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value;
|
||||||
|
console.log('data', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
}, error => {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
validateAllFormFields(formGroup: FormGroup) {
|
||||||
|
Object.keys(formGroup.controls).forEach(field => {
|
||||||
|
const control = formGroup.get(field);
|
||||||
|
if (control instanceof FormControl) {
|
||||||
|
control.markAsTouched({onlySelf: true});
|
||||||
|
} else if (control instanceof FormGroup) {
|
||||||
|
this.validateAllFormFields(control);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// createDetail() {
|
|
||||||
// return this.fb.group({
|
|
||||||
// source: ['', Validators.compose([Validators.required])],
|
|
||||||
// amount: ['', Validators.compose([Validators.required])],
|
|
||||||
// frequency: ['', Validators.compose([Validators.required])],
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// getFrequency() {
|
|
||||||
// let master_name = 'FREQUENCY';
|
|
||||||
// this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
|
||||||
// console.log('data', data);
|
|
||||||
// data.records.forEach(val => {
|
|
||||||
// if (val.isactive == 1) {
|
|
||||||
// this.frequencyData.push(val);
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// addIncomeDetails() {
|
|
||||||
// const control = <FormArray>this.otherIncomeForm.controls['income_details'];
|
|
||||||
// control.push(this.createDetail());
|
|
||||||
// }
|
|
||||||
// deleteIncomeDetails(index) {
|
|
||||||
// const control = <FormArray>this.otherIncomeForm.controls['income_details'];
|
|
||||||
// control.removeAt(index);
|
|
||||||
// }
|
|
||||||
// submitCurrentDetails() {
|
|
||||||
// if (!this.otherIncomeForm.valid) {
|
|
||||||
// this.validateAllFormFields(this.otherIncomeForm);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// let records: any = {};
|
|
||||||
// records.pdid = '254';
|
|
||||||
// records.formid = '254';
|
|
||||||
// records.fk_createdby = '254';
|
|
||||||
// records.other_income = this.otherIncomeForm.controls['other_income'].value;
|
|
||||||
// records.income_details = this.otherIncomeForm.controls['income_details'].value;
|
|
||||||
// console.log('data', records);
|
|
||||||
// this._pd.saveForm(records).subscribe(data => {
|
|
||||||
// console.log('data', data);
|
|
||||||
// this.notifier.notify('success', 'Saved Successfully.');
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// validateAllFormFields(formGroup: FormGroup) {
|
|
||||||
// Object.keys(formGroup.controls).forEach(field => {
|
|
||||||
// const control = formGroup.get(field);
|
|
||||||
// if (control instanceof FormControl) {
|
|
||||||
// control.markAsTouched({onlySelf: true});
|
|
||||||
// } else if (control instanceof FormGroup) {
|
|
||||||
// this.validateAllFormFields(control);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
<form [formGroup]="otherIncomeForm" class="address">
|
<form [formGroup]="otherIncomeForm" class="address">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select placeholder="Other Income"
|
<mat-select placeholder="Other Income"
|
||||||
@ -43,5 +44,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
<button mat-raised-button type="submit" class="button" (click)="submitCurrentDetails()"></button>
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Remarks" formControlName="otherincome_remarks">
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="submitCurrentDetails()">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
|
</mat-card>
|
||||||
@ -13,7 +13,6 @@
|
|||||||
.address .button {
|
.address .button {
|
||||||
float: right;
|
float: right;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 10px;
|
|
||||||
background: #62B013;
|
background: #62B013;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
@ -53,6 +53,7 @@ export class OtherIncomeComponent implements OnInit {
|
|||||||
return value.records.income_details[key];
|
return value.records.income_details[key];
|
||||||
});
|
});
|
||||||
this.otherIncomeForm.controls['other_income'].setValue(value.records.other_income);
|
this.otherIncomeForm.controls['other_income'].setValue(value.records.other_income);
|
||||||
|
this.otherIncomeForm.controls['otherincome_remarks'].setValue(value.records.otherincome_remarks);
|
||||||
if (result.length > 0) {
|
if (result.length > 0) {
|
||||||
result.forEach(val => {
|
result.forEach(val => {
|
||||||
control.push(this.createDetail());
|
control.push(this.createDetail());
|
||||||
@ -69,6 +70,7 @@ export class OtherIncomeComponent implements OnInit {
|
|||||||
public initOtherincomeForm(): void {
|
public initOtherincomeForm(): void {
|
||||||
this.otherIncomeForm = this.fb.group({
|
this.otherIncomeForm = this.fb.group({
|
||||||
other_income: ['', Validators.compose([Validators.required])],
|
other_income: ['', Validators.compose([Validators.required])],
|
||||||
|
otherincome_remarks: ['', Validators.compose([Validators.required])],
|
||||||
income_details: this.fb.array([])
|
income_details: this.fb.array([])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -108,6 +110,7 @@ export class OtherIncomeComponent implements OnInit {
|
|||||||
records.formid = this.form_id;
|
records.formid = this.form_id;
|
||||||
records.fk_createdby = this.pdid;
|
records.fk_createdby = this.pdid;
|
||||||
records.other_income = this.otherIncomeForm.controls['other_income'].value;
|
records.other_income = this.otherIncomeForm.controls['other_income'].value;
|
||||||
|
records.otherincome_remarks = this.otherIncomeForm.controls['otherincome_remarks'].value;
|
||||||
records.income_details = this.otherIncomeForm.controls['income_details'].value;
|
records.income_details = this.otherIncomeForm.controls['income_details'].value;
|
||||||
console.log('data', records);
|
console.log('data', records);
|
||||||
this._pd.saveForm(records).subscribe(data => {
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
|||||||
@ -0,0 +1,81 @@
|
|||||||
|
<mat-card style="padding: 12px;">
|
||||||
|
<form [formGroup]="stockForm" class="address">
|
||||||
|
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Raw Materials<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="raw_materials">
|
||||||
|
<div *ngFor="let details of stockForm.get('raw_materials').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Name" formControlName="raw_name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Quantity" formControlName="raw_quantity">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Value" formControlName="raw_value">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Value of Rawmaterials as per Financial Statements" formControlName="rawmaterial_value">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Is the Stock of Raw Materials Sufficient ?" formControlName="is_sufficiant_raw">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addRawMaterials()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteRawMaterials(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-header>
|
||||||
|
<p>Finished Goods<p>
|
||||||
|
</mat-card-header>
|
||||||
|
<div formArrayName="finished_goods">
|
||||||
|
<div *ngFor="let details of stockForm.get('finished_goods').controls; let i=index"
|
||||||
|
[formGroupName]="i">
|
||||||
|
<mat-card-content class="matcard">
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Name" formControlName="goods_name">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Quantity" formControlName="goods_quantity">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Value" formControlName="goods_value">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Value of Finished Goods as per Financial Statements" formControlName="finished_goods_value">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Is the Stock of Finished Goods Sufficient ?" formControlName="is_sufficiant_goods">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="addGoods()"
|
||||||
|
*ngIf="i==0">
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
<button type="button" mat-raised-button mat-icon-button (click)="deleteGoods(i)"
|
||||||
|
*ngIf="i>0">
|
||||||
|
<mat-icon>close</mat-icon>
|
||||||
|
</button>
|
||||||
|
</mat-card-content>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-card>
|
||||||
|
<mat-form-field>
|
||||||
|
<input matInput placeholder="Remarks" formControlName="stock_remarks">
|
||||||
|
</mat-form-field>
|
||||||
|
<button mat-raised-button type="submit" class="button" (click)="submitDetails()">Submit</button>
|
||||||
|
</form>
|
||||||
|
</mat-card>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
.address {
|
||||||
|
display: flex;
|
||||||
|
padding: 0 2%;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address > * {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.matcard mat-form-field {
|
||||||
|
margin: 0 2%;
|
||||||
|
}
|
||||||
|
.address .button {
|
||||||
|
float: right;
|
||||||
|
width: 10px;
|
||||||
|
background: #62B013;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -0,0 +1,151 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
OnInit,
|
||||||
|
Inject,
|
||||||
|
Input
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
|
import {
|
||||||
|
FormBuilder,
|
||||||
|
FormGroup,
|
||||||
|
Validators,
|
||||||
|
FormArray, FormControl,
|
||||||
|
} from '@angular/forms';
|
||||||
|
|
||||||
|
import { NotifierService } from 'angular-notifier';
|
||||||
|
|
||||||
|
import {
|
||||||
|
MatDialog,
|
||||||
|
MatDialogRef,
|
||||||
|
MAT_DIALOG_DATA
|
||||||
|
} from '@angular/material';
|
||||||
|
/** Service */
|
||||||
|
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
|
||||||
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
|
@Component({
|
||||||
|
selector: 'app-stock',
|
||||||
|
templateUrl: './stock.component.html',
|
||||||
|
styleUrls: ['./stock.component.scss']
|
||||||
|
})
|
||||||
|
export class StockComponent implements OnInit {
|
||||||
|
@Input() pdid: number;
|
||||||
|
@Input() form_id: number;
|
||||||
|
public stockForm: FormGroup;
|
||||||
|
private notifier: NotifierService;
|
||||||
|
|
||||||
|
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
|
||||||
|
private router: Router,
|
||||||
|
private _pd: PdTrigerService) {
|
||||||
|
this.notifier = notifier;
|
||||||
|
}
|
||||||
|
ngOnInit() {
|
||||||
|
this.initstockForm();
|
||||||
|
let params: any = {};
|
||||||
|
params.pd_id = this.pdid;
|
||||||
|
params.pd_form_id = this.form_id;
|
||||||
|
this._pd.retriveForm(params).subscribe(value => {
|
||||||
|
console.log('value', value);
|
||||||
|
const rawMaterial = <FormArray>this.stockForm.controls['raw_materials'];
|
||||||
|
const finishedGoods = <FormArray>this.stockForm.controls['finished_goods'];
|
||||||
|
if (value.status == 200) {
|
||||||
|
let result = Object.keys(value.records.raw_materials).map(function(key) {
|
||||||
|
return value.records.raw_materials[key];
|
||||||
|
});
|
||||||
|
let result_Goods = Object.keys(value.records.finished_goods).map(function(key) {
|
||||||
|
return value.records.finished_goods[key];
|
||||||
|
});
|
||||||
|
this.stockForm.controls['stock_remarks'].setValue(value.records.stock_remarks);
|
||||||
|
if (result.length > 0) {
|
||||||
|
result.forEach(val => {
|
||||||
|
rawMaterial.push(this.createRawmaterial());
|
||||||
|
});
|
||||||
|
this.stockForm.controls['raw_materials'].setValue(result);
|
||||||
|
} else {
|
||||||
|
rawMaterial.push(this.createRawmaterial());
|
||||||
|
}
|
||||||
|
if (result_Goods.length > 0) {
|
||||||
|
result_Goods.forEach(val => {
|
||||||
|
finishedGoods.push(this.createGoods());
|
||||||
|
});
|
||||||
|
this.stockForm.controls['finished_goods'].setValue(result_Goods);
|
||||||
|
} else {
|
||||||
|
finishedGoods.push(this.createGoods());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rawMaterial.push(this.createRawmaterial());
|
||||||
|
finishedGoods.push(this.createGoods());
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
public initstockForm(): void {
|
||||||
|
this.stockForm = this.fb.group({
|
||||||
|
stock_remarks: ['', Validators.compose([Validators.required])],
|
||||||
|
raw_materials: this.fb.array([]),
|
||||||
|
finished_goods: this.fb.array([])
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createRawmaterial() {
|
||||||
|
return this.fb.group({
|
||||||
|
raw_name: ['', Validators.compose([Validators.required])],
|
||||||
|
raw_quantity: ['', Validators.compose([Validators.required])],
|
||||||
|
raw_value: ['', Validators.compose([Validators.required])],
|
||||||
|
rawmaterial_value: ['', Validators.compose([Validators.required])],
|
||||||
|
is_sufficiant_raw: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
createGoods() {
|
||||||
|
return this.fb.group({
|
||||||
|
goods_name: ['', Validators.compose([Validators.required])],
|
||||||
|
goods_quantity: ['', Validators.compose([Validators.required])],
|
||||||
|
goods_value: ['', Validators.compose([Validators.required])],
|
||||||
|
finished_goods_value: ['', Validators.compose([Validators.required])],
|
||||||
|
is_sufficiant_goods: ['', Validators.compose([Validators.required])],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
addRawMaterials() {
|
||||||
|
const control = <FormArray>this.stockForm.controls['raw_materials'];
|
||||||
|
control.push(this.createRawmaterial());
|
||||||
|
}
|
||||||
|
deleteRawMaterials(index) {
|
||||||
|
const control = <FormArray>this.stockForm.controls['raw_materials'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
addGoods() {
|
||||||
|
const control = <FormArray>this.stockForm.controls['finished_goods'];
|
||||||
|
control.push(this.createGoods());
|
||||||
|
}
|
||||||
|
deleteGoods(index) {
|
||||||
|
const control = <FormArray>this.stockForm.controls['finished_goods'];
|
||||||
|
control.removeAt(index);
|
||||||
|
}
|
||||||
|
submitDetails() {
|
||||||
|
if (!this.stockForm.valid) {
|
||||||
|
this.validateAllFormFields(this.stockForm);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let records: any = {};
|
||||||
|
records.pdid = this.pdid;
|
||||||
|
records.formid = this.form_id;
|
||||||
|
records.fk_createdby = this.pdid;
|
||||||
|
records.raw_materials = this.stockForm.controls['raw_materials'].value;
|
||||||
|
records.stock_remarks = this.stockForm.controls['stock_remarks'].value;
|
||||||
|
records.finished_goods = this.stockForm.controls['finished_goods'].value;
|
||||||
|
console.log('data', records);
|
||||||
|
this._pd.saveForm(records).subscribe(data => {
|
||||||
|
console.log('data', data);
|
||||||
|
this.notifier.notify('success', 'Saved Successfully.');
|
||||||
|
}, error => {
|
||||||
|
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
validateAllFormFields(formGroup: FormGroup) {
|
||||||
|
Object.keys(formGroup.controls).forEach(field => {
|
||||||
|
const control = formGroup.get(field);
|
||||||
|
if (control instanceof FormControl) {
|
||||||
|
control.markAsTouched({onlySelf: true});
|
||||||
|
} else if (control instanceof FormGroup) {
|
||||||
|
this.validateAllFormFields(control);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -410,6 +410,22 @@
|
|||||||
<ng-container *ngSwitchCase="9">
|
<ng-container *ngSwitchCase="9">
|
||||||
<app-other-income [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-other-income>
|
<app-other-income [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-other-income>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="10">
|
||||||
|
<app-loan-details [pdid]="startPD" [form_id]="selectedFormsCategory.form_id" [applicant_details]="pdFullDetails"></app-loan-details>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="11">
|
||||||
|
<app-stock [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-stock>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="12">
|
||||||
|
<app-employment-info [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-employment-info>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="13">
|
||||||
|
<app-business-info [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-business-info>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngSwitchCase="14">
|
||||||
|
<app-financial-info [pdid]="startPD" [form_id]="selectedFormsCategory.form_id"></app-financial-info>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<!-- end personal type questions
|
<!-- end personal type questions
|
||||||
-->
|
-->
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@ -43,7 +43,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
|||||||
// getQuestionsLength:number;
|
// getQuestionsLength:number;
|
||||||
// answerList:any=[];
|
// answerList:any=[];
|
||||||
// ansPDList:any=[];
|
// ansPDList:any=[];
|
||||||
// pdFullDetails:any=[];
|
pdFullDetails:any=[];
|
||||||
|
|
||||||
// category static form buttons
|
// category static form buttons
|
||||||
categoryFormButtons: any = [
|
categoryFormButtons: any = [
|
||||||
@ -87,7 +87,22 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
|||||||
"form_id": 10,
|
"form_id": 10,
|
||||||
"form_name": "Loan Details",
|
"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",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
formsCategoryEnable: boolean = false;
|
formsCategoryEnable: boolean = false;
|
||||||
selectedFormsCategory: any;
|
selectedFormsCategory: any;
|
||||||
@ -152,28 +167,28 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// load pd template details
|
// load pd template details
|
||||||
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;
|
||||||
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.actualQuestions = data.records.counts.overall_question_count;
|
// this.actualQuestions = data.records.counts.overall_question_count;
|
||||||
this.answeredQuestions = data.records.counts.overall_answered_count;
|
// this.answeredQuestions = data.records.counts.overall_answered_count;
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
else {
|
// else {
|
||||||
this.pdMasterList = "";
|
// this.pdMasterList = "";
|
||||||
this.mainApplicantName = "";
|
// this.mainApplicantName = "";
|
||||||
this.categoryList = [];
|
// this.categoryList = [];
|
||||||
this.currentPDStatus = "";
|
// this.currentPDStatus = "";
|
||||||
}
|
// }
|
||||||
}, error => this.errorMessage = <any> error);
|
// }, error => this.errorMessage = <any> error);
|
||||||
}
|
// }
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.listPDComponent.showListView(true);
|
this.listPDComponent.showListView(true);
|
||||||
@ -198,32 +213,32 @@ export class StartPdComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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;
|
||||||
// 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.actualQuestions = data.records.counts.overall_question_count;
|
this.actualQuestions = data.records.counts.overall_question_count;
|
||||||
// this.answeredQuestions = data.records.counts.overall_answered_count;
|
this.answeredQuestions = data.records.counts.overall_answered_count;
|
||||||
//
|
|
||||||
// this.pdFullDetails = data.records
|
this.pdFullDetails = data.records
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
// else{
|
else{
|
||||||
// this.pdMasterList="";
|
this.pdMasterList = "";
|
||||||
// this.mainApplicantName="";
|
this.mainApplicantName = "";
|
||||||
// this.categoryList=[];
|
this.categoryList = [];
|
||||||
// this.currentPDStatus="";
|
this.currentPDStatus = "";
|
||||||
// }
|
}
|
||||||
// this.getAnswers(serachQuestions);
|
// this.getAnswers(serachQuestions);
|
||||||
//
|
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
// load question based answer list
|
// load question based answer list
|
||||||
getAnswers(serachList: any) {
|
getAnswers(serachList: any) {
|
||||||
|
|||||||
@ -55,6 +55,10 @@ import { AssetsInfoComponent } from './list-pd/start-pd/forms/assets-info/assets
|
|||||||
import {AddressComponent} from "./list-pd/start-pd/forms/address/address.component";
|
import {AddressComponent} from "./list-pd/start-pd/forms/address/address.component";
|
||||||
import {FamilyDetailsComponent} from "./list-pd/start-pd/forms/family-details/family-details.component";
|
import {FamilyDetailsComponent} from "./list-pd/start-pd/forms/family-details/family-details.component";
|
||||||
import {BankingDetailsComponent} from "./list-pd/start-pd/forms/banking-details/banking-details.component";
|
import {BankingDetailsComponent} from "./list-pd/start-pd/forms/banking-details/banking-details.component";
|
||||||
|
import {StockComponent} from "./list-pd/start-pd/forms/stock/stock.component";
|
||||||
|
import {EmploymentInfoComponent} from "./list-pd/start-pd/forms/employment-info/employment-info.component";
|
||||||
|
import {BusinessInfoComponent} from "./list-pd/start-pd/forms/business-info/business-info.component";
|
||||||
|
import {FinancialInfoComponent} from "./list-pd/start-pd/forms/financial-info/financial-info.component";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom angular notifier options
|
* Custom angular notifier options
|
||||||
@ -128,7 +132,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
|
|||||||
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
|
||||||
// OwlNativeDateTimeModule,
|
// OwlNativeDateTimeModule,
|
||||||
// ],
|
// ],
|
||||||
declarations: [BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent],
|
declarations: [FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent],
|
||||||
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
|
||||||
// providers: [PdTrigerService, GetGeometricLocationService],
|
// providers: [PdTrigerService, GetGeometricLocationService],
|
||||||
// entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent],
|
// entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user