Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
7149b3ac85
@ -43,6 +43,7 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
fk_applicant_primary_id: [null],
|
||||
applicant_name: [null, Validators.compose([Validators.required])],
|
||||
mobile_no: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])],
|
||||
stdcode: [null, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
|
||||
landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])],
|
||||
company_name: [null],
|
||||
applicant_type: [1],
|
||||
@ -54,7 +55,6 @@ export class EditPdApplicantComponent implements OnInit {
|
||||
loadApplicantFormData() {
|
||||
let stdcodesearch = this.mainApplicantData[0].landline.search("-");
|
||||
let stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch);
|
||||
console.log(stdcode);
|
||||
let landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8);
|
||||
this._EditApplicantForm = this._fb.group({
|
||||
fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id],
|
||||
|
||||
@ -106,6 +106,16 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<div *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 60%">
|
||||
<label>How long has business been operated from this premise?</label>
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Year(s)" formControlName="business_years" min='0'>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 40%">
|
||||
<input matInput placeholder="Month(s)" formControlName="business_month" min='0' max='12'>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Don't Remove To replace atlast of the PD Completion and creating new form (Customer Behaviour 221118 review doc : s.no 3.e )
|
||||
@ -121,6 +131,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <mat-form-field *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'" style="width: 100%"> -->
|
||||
<!-- <mat-select placeholder="Bussiness Type" formControlName="bussiness_address_type">
|
||||
<mat-option value="{{m_addressType.address_type_id}}"
|
||||
@ -131,7 +142,7 @@
|
||||
<mat-option *ngFor="let m_addressType of addressData" [value]="m_addressType.address_type_id" (onSelectionChange)="SelectedPremises($event)" > {{m_addressType.address_type}} </mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field> -->
|
||||
<p>Type of Premises</p>
|
||||
<label *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'"> Type of Premises </label>
|
||||
<div fxLayout="row wrap" class="example-section" *ngIf="addressForm.controls['bussiness_activity'].value == 'yes'">
|
||||
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25" *ngFor="let at of addressData;let i = index;"> <!---- [formGroupName]="i"> -->
|
||||
<mat-checkbox class="example-margin" color="primary" [value]="at.address_type_id" (change)="SelectedPremises($event)" [checked]="at.status==1 ? true:false">{{at.address_type}}</mat-checkbox>
|
||||
|
||||
@ -36,6 +36,7 @@ export class AddressComponent implements OnInit {
|
||||
//@Input() pdid: number;
|
||||
pdid : number;
|
||||
form_id: number;
|
||||
pdAddress: string;
|
||||
|
||||
loadDataStatus: boolean=true;
|
||||
|
||||
@ -73,6 +74,8 @@ export class AddressComponent implements OnInit {
|
||||
public other_ownership: AbstractControl;
|
||||
public rent_amt : AbstractControl;
|
||||
public bussinessActivity: AbstractControl;
|
||||
public business_years: AbstractControl;
|
||||
public business_month: AbstractControl;
|
||||
//constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , ) {
|
||||
constructor(private el: ElementRef, notifier: NotifierService,
|
||||
private fb: FormBuilder,
|
||||
@ -84,11 +87,12 @@ export class AddressComponent implements OnInit {
|
||||
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
|
||||
this.form_id = 5;
|
||||
this.notifier = notifier;
|
||||
this.pdAddress = this.pd_all_details.pdmaster_details.addressline1;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.clear();
|
||||
|
||||
console.log('this.address',this.pdAddress);
|
||||
this.getMasterDetails('PDLOCATIONAPPROACH',1);
|
||||
this.getMasterDetails('COMMENTSONLOCALITY',2);
|
||||
//this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e
|
||||
@ -177,6 +181,9 @@ export class AddressComponent implements OnInit {
|
||||
// }
|
||||
|
||||
if(data.records.bussiness_activity == 'yes' && data.records.bussiness_address_type !=null) {
|
||||
this.addressForm.controls.business_years.setValue(data.records.business_years);
|
||||
this.addressForm.controls.business_month.setValue(data.records.business_month);
|
||||
|
||||
let that = this;
|
||||
this.bussiness_address_type = [];
|
||||
|
||||
@ -191,8 +198,8 @@ export class AddressComponent implements OnInit {
|
||||
})
|
||||
|
||||
}
|
||||
console.log(this.bussiness_address_type);
|
||||
console.log(this.additional_premises);
|
||||
// console.log(this.bussiness_address_type);
|
||||
// console.log(this.additional_premises);
|
||||
|
||||
this.selectedValue(this.bussiness_address_type,this.additional_premises);
|
||||
if (data.records.locality_others) {
|
||||
@ -215,7 +222,7 @@ export class AddressComponent implements OnInit {
|
||||
|
||||
public initAddressForm(): void {
|
||||
this.addressForm = this.fb.group({
|
||||
address: ['', Validators.compose([Validators.required])],
|
||||
address: [this.pdAddress != '' ? this.pdAddress : '' , Validators.compose([Validators.required])],
|
||||
address_type: ['', Validators.compose([Validators.required])],
|
||||
address_type_others: [''],
|
||||
locality: ['', Validators.compose([Validators.required])],
|
||||
@ -229,6 +236,8 @@ export class AddressComponent implements OnInit {
|
||||
other_ownership:[''],
|
||||
rent_amt:[''],
|
||||
bussiness_activity:[''],
|
||||
business_years:[''],
|
||||
business_month:[''],
|
||||
bussiness_address_type:[''],
|
||||
bussiness_address_type_others: [''],
|
||||
additional_premises: this.fb.array([])
|
||||
@ -243,6 +252,8 @@ export class AddressComponent implements OnInit {
|
||||
this.other_ownership = this.addressForm.controls['other_ownership'];
|
||||
this.rent_amt = this.addressForm.controls['rent_amt'];
|
||||
this.bussinessActivity = this.addressForm.controls['bussiness_activity'];
|
||||
this.business_years = this.addressForm.controls['business_years'];
|
||||
this.business_month = this.addressForm.controls['business_month'];
|
||||
// this.bussiessAddressType = this.addressForm.controls['bussiness_address_type'];
|
||||
}
|
||||
// createNeighbour(): FormGroup {
|
||||
@ -322,7 +333,7 @@ export class AddressComponent implements OnInit {
|
||||
control.removeAt(index);
|
||||
}*/
|
||||
onSubmit() {
|
||||
console.log('form data', this.addressForm.value);
|
||||
//console.log('form data', this.addressForm.value);
|
||||
if (!this.addressForm.valid) {
|
||||
return;
|
||||
}
|
||||
@ -346,6 +357,8 @@ export class AddressComponent implements OnInit {
|
||||
records.other_ownership = this.other_ownership.value;
|
||||
records.rent_amt = this.rent_amt.value;
|
||||
records.bussiness_activity = this.bussinessActivity.value;
|
||||
records.business_years = this.business_years.value;
|
||||
records.business_month = this.business_month.value;
|
||||
|
||||
if (this.bussinessActivity.value == 'yes') {
|
||||
|
||||
@ -358,7 +371,7 @@ export class AddressComponent implements OnInit {
|
||||
}
|
||||
this.addressForm.controls.additional_premises.value.forEach((val,index)=>
|
||||
{
|
||||
console.log(val);
|
||||
//console.log(val);
|
||||
|
||||
if(val.premises_city != ''){
|
||||
this.formPremisesCityArray = [];
|
||||
@ -385,7 +398,7 @@ export class AddressComponent implements OnInit {
|
||||
console.log('params', records);
|
||||
|
||||
this._pd.saveForm(records).subscribe(data => {
|
||||
console.log('data', data);
|
||||
//console.log('data', data);
|
||||
this.notifier.notify('success', 'Saved Successfully.');
|
||||
}, error => {
|
||||
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
|
||||
@ -401,7 +414,7 @@ export class AddressComponent implements OnInit {
|
||||
SelectedPremises($event){
|
||||
|
||||
let premisesData = $event.source.value;
|
||||
console.log(premisesData);
|
||||
//console.log(premisesData);
|
||||
|
||||
if($event.checked === true ){
|
||||
|
||||
@ -413,10 +426,10 @@ export class AddressComponent implements OnInit {
|
||||
|
||||
this.formPremisesArray.push({premises_types: $event.source.value});
|
||||
|
||||
console.log(this.formPremisesArray);
|
||||
//console.log(this.formPremisesArray);
|
||||
const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||
let array = this.addressData.filter(data => data.address_type_id == premisesData)[0];
|
||||
console.log(array);
|
||||
//console.log(array);
|
||||
if(premisesData == 12){
|
||||
this.PremisesOtherFlag = true;
|
||||
// this.PremisesLabel[this.z] = this.pdQuestionAddress.get('bussiness_address_type_others').value;
|
||||
@ -428,7 +441,7 @@ export class AddressComponent implements OnInit {
|
||||
control.push(this.createPremises());
|
||||
|
||||
}
|
||||
console.log(this.PremisesLabel);
|
||||
//console.log(this.PremisesLabel);
|
||||
this.z++;
|
||||
|
||||
|
||||
@ -442,13 +455,13 @@ export class AddressComponent implements OnInit {
|
||||
if(premisesData == 12){
|
||||
this.PremisesOtherFlag = false;
|
||||
}
|
||||
console.log(this.formPremisesArray);
|
||||
//console.log(this.formPremisesArray);
|
||||
let index = this.formPremisesArray.findIndex(form=>form.premises_types== $event.source.value);
|
||||
console.log(index);
|
||||
//console.log(index);
|
||||
const control = <FormArray>this.addressForm.controls['additional_premises'];
|
||||
control.removeAt(index);
|
||||
this.PremisesLabel.splice(index,1);
|
||||
console.log(this.z);
|
||||
//console.log(this.z);
|
||||
this.z--;
|
||||
}
|
||||
|
||||
@ -461,7 +474,7 @@ export class AddressComponent implements OnInit {
|
||||
{
|
||||
this.cityData.push({additional_premises_city:val});
|
||||
});
|
||||
console.log(this.cityData);
|
||||
//console.log(this.cityData);
|
||||
}
|
||||
otherValueset()
|
||||
{
|
||||
@ -537,9 +550,9 @@ export class AddressComponent implements OnInit {
|
||||
|
||||
selectedValue(e,data)
|
||||
{
|
||||
console.log('501 function',);
|
||||
console.log('inside function in bussiness_address_type,',e);
|
||||
console.log('inside function in this.additional_premises,',data);
|
||||
// console.log('501 function',);
|
||||
// console.log('inside function in bussiness_address_type,',e);
|
||||
// console.log('inside function in this.additional_premises,',data);
|
||||
|
||||
let premisesData = e ;
|
||||
this.tempArr = [];
|
||||
@ -549,10 +562,10 @@ export class AddressComponent implements OnInit {
|
||||
that.addressData[key].status = 0;
|
||||
return that.addressData[key];
|
||||
})
|
||||
console.log(this.addressData);
|
||||
//console.log(this.addressData);
|
||||
premisesData.forEach((val,index)=>
|
||||
{
|
||||
console.log(val);
|
||||
//console.log(val);
|
||||
this.z++;
|
||||
// console.log(this.addressTypes);
|
||||
this.formPremisesArray.push({premises_types: val});
|
||||
|
||||
@ -186,7 +186,7 @@
|
||||
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
<mat-option value="nan">NAN</mat-option>
|
||||
<mat-option value="nan">NA</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
|
||||
@ -504,6 +504,30 @@
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" required autocomplete="off">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<mat-select placeholder="Name of the Owner"
|
||||
formControlName="name_of_the_owner" required>
|
||||
|
||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<div *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''">
|
||||
<mat-form-field class="ml-xs example-full-width" >
|
||||
<input matInput placeholder="Specify Other Owner Name"
|
||||
formControlName="other_owner" autocomplete="off">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div>
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<mat-select placeholder="Relation" formControlName="relation" required>
|
||||
<mat-option value="{{relations.relationship_id}}"
|
||||
*ngFor="let relations of m_relation">
|
||||
{{relations.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<!-- <mat-form-field class="ml-xs example-full-width"> -->
|
||||
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" required> -->
|
||||
<!-- </mat-form-field> -->
|
||||
@ -511,12 +535,12 @@
|
||||
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" required>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
<mat-option value="nan">NAN</mat-option>
|
||||
<mat-option value="nan">NA</mat-option>
|
||||
</mat-select>
|
||||
<!-- <input matInput placeholder="What is the EMI amount ?" formControlName="any_other_asset_loan" autocomplete="off"> -->
|
||||
</mat-form-field>
|
||||
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
|
||||
<mat-form-field class="ml-xs example-full-width">
|
||||
<mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'">
|
||||
<!-- <mat-form-field class="ml-xs example-full-width"> -->
|
||||
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off">
|
||||
<!-- <span matSuffix>.00</span> -->
|
||||
</mat-form-field>
|
||||
|
||||
@ -198,9 +198,11 @@ public m_investmentType = [];
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.getPdSupplierFormDetails();
|
||||
this.getOwnerName();
|
||||
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
|
||||
this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
|
||||
});
|
||||
|
||||
this.getPdSupplierFormDetails();
|
||||
this.getM_Assets_Type();
|
||||
this.getM_PropertyType();
|
||||
this.getM_InvestmentType();
|
||||
@ -210,11 +212,7 @@ public m_investmentType = [];
|
||||
}
|
||||
|
||||
// ======================
|
||||
getOwnerName(){
|
||||
this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
|
||||
this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getM_Assets_Type() {
|
||||
this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe(
|
||||
@ -329,7 +327,7 @@ getOwnerName(){
|
||||
this.initDetails(),
|
||||
]),
|
||||
business_assets_details : this._formBuilder.array([
|
||||
this.initBusinessDetails(),
|
||||
this.initBusinessDetails(this.businessProfessionName),
|
||||
]),
|
||||
assets_form_remark:['']
|
||||
});
|
||||
@ -363,12 +361,12 @@ getOwnerName(){
|
||||
});
|
||||
}
|
||||
|
||||
initBusinessDetails() {
|
||||
initBusinessDetails(data) {
|
||||
return this._formBuilder.group({
|
||||
business_assets_mode: ['', Validators.compose([Validators.required])],
|
||||
business_details: this._formBuilder.array([]),
|
||||
business_approximate_market_value: ['', Validators.compose([])],
|
||||
business_name_of_the_owner: [this.businessProfessionName, Validators.compose([])],
|
||||
business_name_of_the_owner: [data],
|
||||
// other_owner:[''],
|
||||
// relation:[''],
|
||||
// purchase_year: ['', Validators.compose([])],
|
||||
@ -441,9 +439,14 @@ getOwnerName(){
|
||||
break;
|
||||
}
|
||||
case '8': {
|
||||
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
|
||||
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('details') as FormArray ;
|
||||
if(flag == 1){
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray ;
|
||||
control.push(this.otherAssetsDescription());
|
||||
}
|
||||
else if (flag == 2){
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.otherBusinessAssetsDescription());
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@ -473,6 +476,19 @@ getOwnerName(){
|
||||
}
|
||||
|
||||
otherAssetsDescription() {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: ['', Validators.compose([Validators.required])],
|
||||
name_of_the_owner:[''],
|
||||
other_owner:[''],
|
||||
relation:[''],
|
||||
any_other_asset_value : [''],
|
||||
any_other_asset_loan : [''],
|
||||
other_asset_emi_amt : ['']
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
otherBusinessAssetsDescription() {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: ['', Validators.compose([Validators.required])],
|
||||
any_other_asset_value : [''],
|
||||
@ -522,13 +538,6 @@ getOwnerName(){
|
||||
});
|
||||
}
|
||||
|
||||
loadPropertyWithData2(data) {
|
||||
return this._formBuilder.group({
|
||||
property_type: [data.property_type, Validators.compose([Validators.required])]
|
||||
//property_type:['']
|
||||
});
|
||||
}
|
||||
|
||||
loadJwellDescriptionWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
jwell_description: [data.jwell_description, Validators.compose([Validators.required])]
|
||||
@ -544,12 +553,26 @@ getOwnerName(){
|
||||
otherAssetsDescriptionWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: [data.any_other_assets, Validators.compose([Validators.required])],
|
||||
name_of_the_owner:[data.name_of_the_owner],
|
||||
other_owner:[data.other_owner],
|
||||
relation:[data.relation],
|
||||
any_other_asset_value : [data.any_other_asset_value],
|
||||
any_other_asset_loan : [data.any_other_asset_loan],
|
||||
other_asset_emi_amt : [data.other_asset_emi_amt]
|
||||
});
|
||||
}
|
||||
|
||||
otherBusinessAssetsDescriptionWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: [data.any_other_assets, Validators.compose([Validators.required])],
|
||||
any_other_asset_value : [data.any_other_asset_value],
|
||||
any_other_asset_loan : [data.any_other_asset_loan],
|
||||
other_asset_emi_amt : [data.other_asset_emi_amt]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
loadInsuranceDescriptionWithData(data) {
|
||||
return this._formBuilder.group({
|
||||
//insurance_type: [data.insurance_type, Validators.compose([Validators.required])],
|
||||
@ -748,7 +771,7 @@ getOwnerName(){
|
||||
switch (assets_details_mode) {
|
||||
case '1': {
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.loadPropertyWithData2(data));
|
||||
control.push(this.loadPropertyWithData(data));
|
||||
break;
|
||||
}
|
||||
case '2': {
|
||||
@ -781,7 +804,7 @@ getOwnerName(){
|
||||
}
|
||||
case '8': {
|
||||
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
|
||||
control.push(this.otherAssetsDescriptionWithData(data));
|
||||
control.push(this.otherBusinessAssetsDescriptionWithData(data));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@ -798,7 +821,7 @@ getOwnerName(){
|
||||
control.push(this.initDetails());
|
||||
}else if(flag == 2){
|
||||
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
|
||||
control.push(this.initBusinessDetails());
|
||||
control.push(this.initBusinessDetails(this.businessProfessionName));
|
||||
}
|
||||
}
|
||||
removeLanguage(i: number,flag) {
|
||||
|
||||
@ -57,11 +57,15 @@
|
||||
<mat-form-field style="width: 28%">
|
||||
<input matInput placeholder="Name" formControlName="reference_name" type="text">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-form-field style="width: 24%">
|
||||
<input matInput placeholder="Mobile Number" formControlName="mobile" type="text" (keypress)="keyPress($event)">
|
||||
<mat-error *ngIf="reference['controls'].mobile.hasError('maxlength') || reference['controls'].mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%">
|
||||
<mat-form-field style="width: 10%">
|
||||
<input matInput placeholder="STD" formControlName="std_code" type="text" (keypress)="keyPress($event)">
|
||||
<mat-error *ngIf="reference['controls'].std_code.hasError('maxlength') || reference['controls'].std_code.hasError('minlength')">Enter Valid STD Code. </mat-error>
|
||||
</mat-form-field><span>-</span>
|
||||
<mat-form-field style="width: 20%">
|
||||
<input matInput placeholder="Landline Number" formControlName="landline" type="text" (keypress)="keyPress($event)">
|
||||
<mat-error *ngIf="reference['controls'].landline.hasError('maxlength') || reference['controls'].landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
|
||||
</mat-form-field>
|
||||
@ -77,7 +81,7 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 28%" *ngIf="reference.controls.relationship_with.value==5">
|
||||
<mat-form-field style="width: 30%" *ngIf="reference.controls.relationship_with.value==5">
|
||||
<input matInput placeholder="Others" formControlName="others" type="text">
|
||||
</mat-form-field>
|
||||
<p #period_paragraph>Period of Relationship</p>
|
||||
|
||||
@ -16,7 +16,7 @@ export class NeighbourHoodComponent implements OnInit {
|
||||
form_id:number;
|
||||
private notifier: NotifierService;
|
||||
check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}]
|
||||
default_reference_details: any= {'reference_name':'','mobile':'','landline':'','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''};
|
||||
default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''};
|
||||
default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know':'','is_applicant_owner':''};
|
||||
|
||||
busineesRelationshipList:any=[];
|
||||
@ -128,10 +128,14 @@ export class NeighbourHoodComponent implements OnInit {
|
||||
|
||||
// create reference check form array
|
||||
createReerenceCheck(elementValue:any){
|
||||
let stdcodesearch = elementValue.landline.search("-");
|
||||
let stdcode = elementValue.landline.substr(0,stdcodesearch);
|
||||
let landline = elementValue.landline.substr(+stdcodesearch + 1,8);
|
||||
return this._fb.group({
|
||||
reference_name: [elementValue.reference_name, Validators.required],
|
||||
mobile: [elementValue.mobile,Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(10)])],
|
||||
landline: [elementValue.landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
std_code: [stdcode,Validators.compose([Validators.minLength(2),Validators.maxLength(4)])],
|
||||
landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])],
|
||||
location:[elementValue.location,Validators.required],
|
||||
relationship_with:[elementValue.relationship_with,Validators.required],
|
||||
others: [elementValue.others],
|
||||
@ -217,7 +221,7 @@ export class NeighbourHoodComponent implements OnInit {
|
||||
referencecheck_list.push({
|
||||
"reference_name":element.reference_name,
|
||||
"mobile":element.mobile,
|
||||
"landline":element.landline,
|
||||
"landline":element.std_code+'-'+element.landline,
|
||||
"location":element.location,
|
||||
"relationship_with":element.relationship_with,
|
||||
"others":element.others,
|
||||
|
||||
@ -49,8 +49,8 @@
|
||||
<input matInput placeholder="Specify Other UOM" formControlName="other_uom" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" required>
|
||||
<mat-hint align="end" *ngIf="mrm.get('raw_value').value != ''">{{"₹"}} {{M_rawValueInWords}} Only</mat-hint> (keyup)="inWords($event,1)"
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="raw_value" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required>
|
||||
<mat-hint align="end" *ngIf="mrm.get('raw_value').value != ''">{{"₹"}} {{M_rawValueInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Value of raw materials as per latest financial Statements" formControlName="rawmaterial_value" (keypress)="keyPress($event)" required>
|
||||
@ -96,8 +96,8 @@
|
||||
<input matInput placeholder="Estimated Quantity" formControlName="goods_quantity" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required>
|
||||
<mat-hint align="end" *ngIf="mfg.get('goods_value').value != ''">{{"₹"}} {{M_goodsValueInWords}} Only</mat-hint> (keyup)="inWords($event,2)"
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,2)" required>
|
||||
<mat-hint align="end" *ngIf="mfg.get('goods_value').value != ''">{{"₹"}} {{M_goodsValueInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required>
|
||||
@ -144,8 +144,8 @@
|
||||
<input matInput placeholder="Estimated Quantity" formControlName="traded_goods_quantity" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required>
|
||||
<mat-hint align="end" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"₹"}} {{M_tradedGoodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,3)"
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,3)" required>
|
||||
<mat-hint align="end" *ngIf="mtg.get('estimated_traded_goods_value').value != ''">{{"₹"}} {{M_tradedGoodsValueInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required>
|
||||
@ -204,8 +204,8 @@
|
||||
<input matInput placeholder="Estimated Quantity" formControlName="goods_quantity" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required>
|
||||
<mat-hint align="end" *ngIf="retailfg.get('goods_value').value != ''">{{"₹"}} {{R_goodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,4)"
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,4)" required>
|
||||
<mat-hint align="end" *ngIf="retailfg.get('goods_value').value != ''">{{"₹"}} {{R_goodsValueInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required>
|
||||
@ -253,8 +253,8 @@
|
||||
<input matInput placeholder="Estimated Quantity" formControlName="traded_goods_quantity" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required>
|
||||
<mat-hint align="end" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"₹"}} {{R_tradedGoodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,5)"
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,5)" required>
|
||||
<mat-hint align="end" *ngIf="item.get('estimated_traded_goods_value').value != ''">{{"₹"}} {{R_tradedGoodsValueInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required>
|
||||
@ -314,8 +314,8 @@
|
||||
<input matInput placeholder="Estimated Quantity" formControlName="goods_quantity" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" required>
|
||||
<mat-hint align="end" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"₹"}} {{T_goodsValueInWords}} Only</mat-hint>(keyup)="inWords($event,6)"
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" required>
|
||||
<mat-hint align="end" *ngIf="tradesubdetail.get('goods_value').value != ''">{{"₹"}} {{T_goodsValueInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Value of finished goods as per latest financial statements" formControlName="finished_goods_value" (keypress)="keyPress($event)" required>
|
||||
@ -364,8 +364,8 @@
|
||||
<input matInput placeholder="Estimated Quantity" formControlName="traded_goods_quantity" required>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" required>
|
||||
<mat-hint align="end" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"₹"}} {{T_tradedGoodsValueInWords}} Only</mat-hint> (keyup)="inWords($event,7)"
|
||||
<input matInput placeholder="Estimated Value of Stock Observed" formControlName="estimated_traded_goods_value" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" required>
|
||||
<mat-hint align="end" *ngIf="tradetg.get('estimated_traded_goods_value').value != ''">{{"₹"}} {{T_tradedGoodsValueInWords}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:76%">
|
||||
<input matInput placeholder="Value of traded goods as per latest financial statements" formControlName="traded_goods_value" (keypress)="keyPress($event)" required>
|
||||
|
||||
@ -122,7 +122,7 @@ export class StockComponent implements OnInit {
|
||||
}
|
||||
|
||||
public initstockForms(record){
|
||||
|
||||
console.log(record);
|
||||
let params: any = {};
|
||||
params.pd_id = this.pdid;
|
||||
params.pd_form_id = this.form_id;
|
||||
@ -301,8 +301,11 @@ export class StockComponent implements OnInit {
|
||||
|
||||
manufacturingForm: Boolean = false;
|
||||
manufacturingFormCreation(record) {
|
||||
console.log(record);
|
||||
let arr = record.filter(data => data.type_of_activity_id == 1);
|
||||
console.log(arr);
|
||||
if (arr.length > 0) {
|
||||
console.log(arr.length);
|
||||
this.manufacturingForm = true;
|
||||
return this.fb.group({
|
||||
manufacturing_raw_materials: this.fb.array([]),
|
||||
@ -368,19 +371,26 @@ export class StockComponent implements OnInit {
|
||||
// console.log(305,'else')
|
||||
for (let val of datas.manufacturing_raw_materials) {
|
||||
// console.log(val);
|
||||
|
||||
if(val.raw_value){
|
||||
this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value);
|
||||
}
|
||||
rawMaterial.push(this.createRawmaterial(val));
|
||||
|
||||
|
||||
}
|
||||
for (let val of datas.manufacturing_finished_goods) {
|
||||
// console.log(val);
|
||||
|
||||
if(val.goods_value){
|
||||
this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
|
||||
}
|
||||
finishedGoods.push(this.createGoods(val));
|
||||
|
||||
}
|
||||
for (let val of datas.manufacturing_traded_goods) {
|
||||
// console.log(val);
|
||||
|
||||
if(val.estimated_traded_goods_value){
|
||||
this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
|
||||
}
|
||||
tradedGoods.push(this.createTradedGoods(val));
|
||||
|
||||
}
|
||||
@ -450,11 +460,17 @@ export class StockComponent implements OnInit {
|
||||
for (let val of datas.retail_finished_goods) {
|
||||
// console.log(val);
|
||||
|
||||
if(val.goods_value){
|
||||
this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
|
||||
}
|
||||
finishedGoods.push(this.createGoods(val));
|
||||
|
||||
}
|
||||
for (let val of datas.retail_traded_goods) {
|
||||
// console.log(val);
|
||||
if(val.estimated_traded_goods_value){
|
||||
this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
|
||||
}
|
||||
tradedGoods.push(this.createTradedGoods(val));
|
||||
|
||||
}
|
||||
@ -531,12 +547,17 @@ export class StockComponent implements OnInit {
|
||||
|
||||
for (let val of datas.trading_finished_goods) {
|
||||
// console.log(val);
|
||||
|
||||
if(val.goods_value){
|
||||
this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value);
|
||||
}
|
||||
finishedGoods.push(this.createGoods(val));
|
||||
|
||||
}
|
||||
for (let val of datas.trading_traded_goods) {
|
||||
// console.log(val);
|
||||
if(val.estimated_traded_goods_value){
|
||||
this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value);
|
||||
}
|
||||
tradedGoods.push(this.createTradedGoods(val));
|
||||
|
||||
}
|
||||
@ -758,6 +779,7 @@ export class StockComponent implements OnInit {
|
||||
|
||||
/** To Convert Amount into Words */
|
||||
inWords(e,flag:number){
|
||||
|
||||
switch(flag){
|
||||
case 1 :
|
||||
this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user