Merge branch 'master' of https://bitbucket.org/sriramv18/pd_officer
This commit is contained in:
commit
167307bf28
@ -31,6 +31,16 @@
|
||||
{{stVal.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<!-- <mat-select placeholder="State" formControlName="state" required>
|
||||
<mat-option>
|
||||
<ngx-mat-select-search formControlName="stateSearch" [placeholderLabel]="'Search State'"
|
||||
[noEntriesFoundLabel]="'No Records Found'" (keyup)="forSearchableDropdown(rentalForms,'state')">
|
||||
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
|
||||
</ngx-mat-select-search>
|
||||
</mat-option>
|
||||
<mat-option *ngFor="let stVal of stateList" [value]="stVal.state_id">{{stVal.name}}
|
||||
</mat-option>
|
||||
</mat-select> -->
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:100%">
|
||||
@ -40,6 +50,18 @@
|
||||
{{ctVal.city_name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<!-- <mat-select placeholder="City" formControlName="city" required>
|
||||
<mat-option>
|
||||
<ngx-mat-select-search formControlName="citySearch" [placeholderLabel]="'Search City'"
|
||||
[noEntriesFoundLabel]="'No Records Found'" (keyup)="forSearchableDropdown(rentalForms,'city')">
|
||||
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
|
||||
</ngx-mat-select-search>
|
||||
</mat-option>
|
||||
<mat-option>Select</mat-option>
|
||||
<mat-option *ngFor="let ctVal of cityList" [value]="ctVal.city_id">
|
||||
{{ctVal.city_name}}
|
||||
</mat-option>
|
||||
</mat-select> -->
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:100%">
|
||||
@ -49,6 +71,17 @@
|
||||
{{pinVal.pincode}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<!-- <mat-select placeholder="" formControlName="pincode" required>
|
||||
<mat-option>
|
||||
<ngx-mat-select-search formControlName="pincodeSearch" [placeholderLabel]="'Search Pincode'"
|
||||
[noEntriesFoundLabel]="'No Records Found'" (keyup)="forSearchableDropdown(rentalForms,'pin')">
|
||||
<ion-icon name="md-close" ngxMatSelectSearchClear></ion-icon>
|
||||
</ngx-mat-select-search>
|
||||
</mat-option>
|
||||
<mat-option *ngFor="let pinVal of pincodeList" [value]="pinVal.pincode_id">
|
||||
{{pinVal.pincode}}
|
||||
</mat-option>
|
||||
</mat-select> -->
|
||||
</mat-form-field>
|
||||
|
||||
<div align="left" style="margin-left: 0%;">
|
||||
@ -281,8 +314,8 @@
|
||||
<div class="rent-unit" fxFlex.xs="100" fxFlex.sm="45" fxFlex.md="45" fxFlex.lg="45" fxFlex.xl="45" *ngFor="let fUnits of floor.controls.floor_unit_details['controls']; let fu=index;" [formGroupName]="fu">
|
||||
<mat-form-field style="width:100%" appearance="outline">
|
||||
<mat-label>Rent Unit {{fu+1}} </mat-label>
|
||||
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f);inWords($event.target.value,fu,3)" required>
|
||||
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"₹"}} {{rent_per_unit_2_Inwords[fu]}} Only</mat-hint>
|
||||
<input type="number" matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f);" required>
|
||||
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"₹"}} {{fUnits.value.rent_per_unit != '' ? inWordsmultiple(fUnits.value.rent_per_unit,f,fu,1) : ''}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -8,6 +8,9 @@ import {ConstantsProvider} from '../../../providers/constants/constants';
|
||||
import {DatePipe} from '@angular/common'
|
||||
import { Message } from '@angular/compiler/src/i18n/i18n_ast';
|
||||
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
/**
|
||||
* Generated class for the PdQuestionRentalInfoPage page.
|
||||
*
|
||||
@ -40,6 +43,9 @@ export class PdQuestionRentalInfoPage {
|
||||
stateList:any=[];
|
||||
cityList:any=[];
|
||||
pincodeList:any=[];
|
||||
stateData:any=[];
|
||||
cityData:any=[];
|
||||
pincodeData:any=[];
|
||||
documentList: any=[{id:2,name:"Property Title Document"},{id:3,name:"Electricity Bill with name of owner mentioned therein"},{id:4,name:"Property tax Receipts"},{id:1,name:"Others (Please Specify)"}];
|
||||
//floorList: any=[{id:1,name:"Ground Floor"},{id:1,name:"First Floor"},{id:1,name:"Second Floor"},{id:1,name:"Third Floor"}]
|
||||
//unitMeasurementList: any=[{id:2,name:"Square Feet"},{id:3,name:"Square Yards"},{id:4,name:"Square Meters"},{id:5,name:"Acres"},{id:6,name:"Hectares"},{id:1,name:"Others (Please Specify)"}];
|
||||
@ -47,7 +53,8 @@ export class PdQuestionRentalInfoPage {
|
||||
|
||||
rent_per_unit_Inwords : any= [];
|
||||
amount_Inwords : any=[];
|
||||
rent_per_unit_2_Inwords: any=[];
|
||||
// rent_per_unit_2_Inwords: any=[];
|
||||
floor_rent_per_unit_Inwords : any[][];
|
||||
floor_rent_amount_Inwords: any=[];
|
||||
monthly_rent_amount_Inwords: any=[];
|
||||
amount_received_cash_Inwords: any=[];
|
||||
@ -58,7 +65,8 @@ export class PdQuestionRentalInfoPage {
|
||||
paid_monthly_rent_per_met_Inwords: any=[];
|
||||
amount_received_cash_per_met_Inwords: any=[];
|
||||
amount_received_bank_per_met_Inwords: any=[];
|
||||
|
||||
protected _onDestroy = new Subject<void>();
|
||||
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams,public aws:AwsServiceProvider,public toast:ToastProvider,public qustCat:QuestionCategoryProvider,public fb:FormBuilder,public constprovider:ConstantsProvider,public alertCtrl:AlertController) {
|
||||
this.FormId = this.navParams.get('FormId');
|
||||
this.pdDetails = this.navParams.get('pdDetails');
|
||||
@ -75,8 +83,11 @@ export class PdQuestionRentalInfoPage {
|
||||
formid: this.FormId.form_id,
|
||||
address_property:['',Validators.required],
|
||||
state:['',Validators.required],
|
||||
stateSearch:[''],
|
||||
city:['',Validators.required],
|
||||
citySearch:[''],
|
||||
pincode:['',Validators.required],
|
||||
pincodeSearch:[''],
|
||||
validate_visited_address:[true],
|
||||
person_met: ['',Validators.required],
|
||||
property_owner: ['',Validators.required],
|
||||
@ -150,8 +161,10 @@ export class PdQuestionRentalInfoPage {
|
||||
this.rentalForms.controls['state'].valueChanges.subscribe(val => {
|
||||
this.qustCat.getStateWiseCities(val).subscribe(data => {
|
||||
if (data.status == 200) {
|
||||
this.cityData = data.records.cities;
|
||||
this.cityList = data.records.cities;
|
||||
this.pincodeList = data.records.pincode;
|
||||
this.pincodeData = data.records.pincode;
|
||||
this.pincodeList = data.records.cities;
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -193,7 +206,7 @@ export class PdQuestionRentalInfoPage {
|
||||
}
|
||||
// set unit type list details
|
||||
let resiDentialProperty = [{id:2,name:'Independent Flat',group_id:1},{id:3,name:'Independent Floor',group_id:1},
|
||||
{id:4,name:'Independent Bungalow',group_id:1},{id:5,name:'Independent Row House',group_id:1},{id:6,name:'Multi Storey Building',group_id:1},{id:1,name:'Other (Please Specify)',group_id:1}];
|
||||
{id:4,name:'Independent House',group_id:1},{id:5,name:'Independent Row House',group_id:1},{id:6,name:'Multi Storey Building',group_id:1},{id:1,name:'Other (Please Specify)',group_id:1}];
|
||||
|
||||
let commercialProperty = [{id:2,name:'Independent Office',group_id:2},{id:3,name:'Independent Shop',group_id:2},{id:4,name:'Warehouse/Godown',group_id:2},
|
||||
{id:5,name:'Workshop',group_id:2},{id:6,name:'Independent Clinic',group_id:2},{id:7,name:'Multi Storey Building',group_id:2},{id:1,name:'Other (Please Specify)',group_id:2}];
|
||||
@ -234,7 +247,8 @@ export class PdQuestionRentalInfoPage {
|
||||
{
|
||||
if(res['dataStatus']==true)
|
||||
{
|
||||
this.stateList = res['records'].filter(data => data.isactive == 1);
|
||||
this.stateData = res['records'].filter(data => data.isactive == 1);
|
||||
this.stateList = this.stateData.slice();
|
||||
}
|
||||
})
|
||||
|
||||
@ -884,25 +898,42 @@ compareSingleObjects(o1: any, o2: any) {
|
||||
// }
|
||||
// }
|
||||
saveAlert(answerData){
|
||||
let ApplicantRentAmt : any ;
|
||||
let ApplicantRentAmt : any ;
|
||||
let TenantRentAmt : any ;
|
||||
let FloorsTotalRentAmt : any ;
|
||||
|
||||
let TempArray1 : any = [];
|
||||
let TempArray2 : any = [];
|
||||
|
||||
let TempArray3 : any = [];
|
||||
|
||||
let TextMessage :any;
|
||||
|
||||
if(answerData.property_unit_details.length > 0){
|
||||
|
||||
|
||||
answerData.property_unit_details.forEach((data,index) => {
|
||||
TempArray1[index] = data.monthly_rent_amount;
|
||||
ApplicantRentAmt = TempArray1.reduce((sum, val) => sum + +val, 0);
|
||||
TempArray2[index] = data.paid_monthly_rent_per_met;
|
||||
TenantRentAmt = TempArray2.reduce((sum, val) => sum + +val, 0);
|
||||
})
|
||||
TextMessage = 'Monthly Rent as Per Loan Applicant =' + ApplicantRentAmt+'<br>';
|
||||
}
|
||||
|
||||
|
||||
if(answerData.multistoried_building_details.length > 0){
|
||||
answerData.multistoried_building_details.forEach((val,index) => {
|
||||
TempArray3[index] = val.floor_rent_amount;
|
||||
FloorsTotalRentAmt = TempArray3.reduce((sum, val) => sum + +val, 0);
|
||||
});
|
||||
TextMessage = TextMessage +'Rent amount calculated = '+FloorsTotalRentAmt;
|
||||
}
|
||||
else{
|
||||
TextMessage = TextMessage +'Monthly Rent amount as Per Tenant met = '+TenantRentAmt;
|
||||
}
|
||||
|
||||
let alert=this.alertCtrl.create({
|
||||
title:'Confirm The Rent Amount',
|
||||
message:'Monthly Rent as Per Loan Applicant =' + ApplicantRentAmt+'<br>'+'Monthly Rent as Per Lease or Tenant Met = '+TenantRentAmt ,
|
||||
message:TextMessage,
|
||||
buttons:[
|
||||
{
|
||||
text:'Cancel',
|
||||
@ -922,9 +953,16 @@ compareSingleObjects(o1: any, o2: any) {
|
||||
alert.present();
|
||||
}
|
||||
saveRentalDetails(answerData) {
|
||||
|
||||
console.log('answerData',answerData);
|
||||
answerData.fk_createdby = this.users;
|
||||
|
||||
delete answerData.stateSearch;
|
||||
delete answerData.citySearch;
|
||||
delete answerData.pincodeSearch;
|
||||
answerData.fk_createdby = this.users;
|
||||
|
||||
console.log('answerData',answerData);
|
||||
|
||||
this.qustCat.saveForm(answerData).subscribe(res=>
|
||||
{
|
||||
if(res['dataStatus']==true)
|
||||
@ -988,7 +1026,12 @@ compareSingleObjects(o1: any, o2: any) {
|
||||
rentalDetails.formid = this.FormId.form_id;
|
||||
rentalDetails.other_name_person_type ? this.rentalForms.addControl('other_name_person_type', new FormControl('', Validators.required)): this.rentalForms.removeControl('other_name_person_type');
|
||||
rentalDetails.other_sighted_documents ? this.rentalForms.addControl('other_sighted_documents', new FormControl('', Validators.required)) : this.rentalForms.removeControl('other_sighted_documents');
|
||||
|
||||
// this.rentalForms.addControl('stateSearch', new FormControl(''));
|
||||
// this.rentalForms.addControl('citySearch', new FormControl(''));
|
||||
// this.rentalForms.addControl('pincodeSearch', new FormControl(''));
|
||||
rentalDetails.stateSearch = '';
|
||||
rentalDetails.citySearch = '';
|
||||
rentalDetails.pincodeSearch = '';
|
||||
//get Multistoried Building Details
|
||||
if(res['records'].multistoried_building_details){
|
||||
let selectedMultistoriedBuilding = Object.keys(res['records'].multistoried_building_details).map(function (key) {
|
||||
@ -1016,7 +1059,6 @@ compareSingleObjects(o1: any, o2: any) {
|
||||
}
|
||||
else if(floorElement.unit_rent_difference_options=="0"){
|
||||
if(unitElement.rent_per_unit!=''){
|
||||
this.inWords(unitElement.rent_per_unit,unitIndex,3)
|
||||
//floor_rent_amount_val+=unitElement.rent_per_unit
|
||||
}
|
||||
this.inWords(floorElement.floor_rent_amount,floorIndex,4)
|
||||
@ -1194,7 +1236,7 @@ compareSingleObjects(o1: any, o2: any) {
|
||||
this.amount_Inwords[i] = this.constprovider.convertNumberToWords(e);
|
||||
break;
|
||||
case 3 :
|
||||
this.rent_per_unit_2_Inwords[i] = this.constprovider.convertNumberToWords(e);
|
||||
// this.rent_per_unit_2_Inwords[i] = this.constprovider.convertNumberToWords(e);
|
||||
break;
|
||||
case 4 :
|
||||
this.floor_rent_amount_Inwords[i] = this.constprovider.convertNumberToWords(e);
|
||||
@ -1229,6 +1271,10 @@ compareSingleObjects(o1: any, o2: any) {
|
||||
}
|
||||
}
|
||||
|
||||
inWordsmultiple(e,i,j,flag){
|
||||
// console.log(e,i,j,flag);
|
||||
return this.constprovider.convertNumberToWords(e);
|
||||
}
|
||||
validateAllFormFields(formGroup: any) {
|
||||
Object.keys(formGroup.controls).forEach(field => {
|
||||
const control = formGroup.get(field);
|
||||
@ -1242,6 +1288,8 @@ compareSingleObjects(o1: any, o2: any) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// generate payment dynamic fields
|
||||
|
||||
ValidatedRentAmount(value:any,index:number,type: number){
|
||||
@ -1312,4 +1360,32 @@ ValidatedRentAmount(value:any,index:number,type: number){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// forSearchableDropdown(val:any,Flag:any){
|
||||
// // val=val.controls['relationSearch'].value
|
||||
// console.log("val",val,'Flag',Flag);
|
||||
// switch(Flag){
|
||||
// case 'state' :
|
||||
// console.log("val",val.controls['state'].value,'Flag',Flag,'1');
|
||||
// val.controls['stateSearch'].valueChanges
|
||||
// .pipe(takeUntil(this._onDestroy))
|
||||
// .subscribe(()=>{
|
||||
// }); break;
|
||||
// case 'city' :
|
||||
// console.log("val",val.controls['city'].value,'Flag',Flag,'2');
|
||||
// val.controls['citySearch'].valueChanges
|
||||
// .pipe(takeUntil(this._onDestroy))
|
||||
// .subscribe(()=>{
|
||||
// this.cityList =this.constprovider.searchData(this.cityData,val.controls['city'].value,Flag)
|
||||
// }); break;
|
||||
// case 'pin' :
|
||||
// console.log("val",val.controls['pincode'].value,'Flag',Flag,'3');
|
||||
// val.controls['pincodeSearch'].valueChanges
|
||||
// .pipe(takeUntil(this._onDestroy))
|
||||
// .subscribe(()=>{
|
||||
// this.pincodeList =this.constprovider.searchData(this.pincodeData,val.controls['pincode'].value,Flag)
|
||||
// }); break;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user