rental info : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-03-27 15:34:45 +05:30
parent 87dc19c7dc
commit d5a25ea608
4 changed files with 1940 additions and 386 deletions

View File

@ -1,182 +1,735 @@
<ion-header>
<ion-navbar color="optblue">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title *ngIf="!viewchange">{{FormId.form_name}}</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<form [formGroup]="rentalForms">
<mat-card>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Person Met" formControlName="person_met" name="complete_add">
</mat-form-field>
<mat-form-field style="width: 100%;">
<mat-select placeholder="Property Owner" formControlName="property_own">
<mat-option value="applicant">Applicant</mat-option>
<mat-option value="co-applicant">Co-Applicant</mat-option>
<mat-option value="parental">Parental</mat-option>
<mat-card-header>
<mat-card-title>Property Details</mat-card-title>
</mat-card-header>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%;">
<mat-select placeholder="Nature of the let out property" formControlName="nature_property">
<mat-option value="residential/commercial">Residential/commercial</mat-option>
<mat-option value="others">Others</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%;" *ngIf="rentalForms.get('nature_property').value=='others'">
<input matInput placeholder="Nature property other" formControlName="nature_others">
</mat-form-field>
<mat-card-content>
<div fxLayout="row wrap">
<!-- start address -->
<mat-form-field style="width:100%">
<textarea matInput rows="4" placeholder="Address of the Property" formControlName="address_property"
required></textarea>
</mat-form-field>
<!--start name of the who showing property to officer -->
<mat-form-field style="width:31%">
<mat-select placeholder="State" formControlName="state" required>
<mat-option *ngFor="let stVal of stateList" [value]="stVal.state_id">
{{stVal.name}}
</mat-option>
</mat-select>
</mat-form-field>
&nbsp;&nbsp;
<mat-form-field style="width:31%">
<mat-label>City</mat-label>
<mat-select placeholder="City" formControlName="city" required>
<mat-option *ngFor="let ctVal of cityList" [value]="ctVal.city_id">
{{ctVal.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
&nbsp;&nbsp;
<mat-form-field style="width:31%">
<mat-label>Pincode</mat-label>
<mat-select placeholder="" formControlName="pincode" required>
<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%;">
<mat-checkbox color="primary" formControlName="validate_visited_address">Is This the Address Visited ?
<strong>( {{rentalForms.value.validate_visited_address===true ? 'Yes' : 'No'}} )</strong></mat-checkbox>
</div>
<mat-form-field style="width:90%;margin-top: 2%;" *ngIf="rentalForms.controls['other_visited_address']">
<mat-label>Actual Address Visited</mat-label>
<textarea matInput rows="2" placeholder="" formControlName="other_visited_address" required></textarea>
</mat-form-field>
<!-- end -->
</div>
<div fxLayout="row wrap">
<!--start name of the who showing property to officer -->
<mat-form-field style="width:100%">
<mat-label>Name of the Person Who is Showing the Property to Sineedge Officer</mat-label>
<mat-select placeholder="Name" formControlName="person_met" [compareWith]="compareObjects" multiple
required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['other_person_met']">
<mat-label>Specify Other Person</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="other_person_met" required>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['other_name_person_showing_property'] && rentalForms.value.other_person_met!=''">
<mat-label>Who is {{rentalForms.controls['other_person_met'].value}} ?</mat-label>
<mat-select placeholder="" formControlName="other_name_person_showing_property" [compareWith]="compareSingleObjects"
(selectionChange)="personShowingChanges(rentalForms.controls['other_name_person_showing_property'].value)"
multiple required>
<mat-option *ngFor="let pType of personType" [value]="pType">
{{pType.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['other_name_person_type'] && rentalForms.value.other_person_met!=''">
<mat-label>Who is {{rentalForms.controls['other_person_met'].value}} ?</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="other_name_person_type" required>
</mat-form-field>
<!-- end -->
<!-- start owner of the property -->
<mat-form-field style="width:100%">
<mat-label>Name of the Owner/Owners of the Let out Property as per Loan Applicants</mat-label>
<mat-select placeholder="Name" formControlName="property_owner" [compareWith]="compareObjects" multiple
required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['property_owner_other']">
<mat-label>Specify Other Owner/Owners</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="property_owner_other" required>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['property_owner_other_relationship']">
<mat-label>Relation of Owner to Loan Applicant</mat-label>
<mat-select placeholder="" formControlName="property_owner_other_relationship" [compareWith]="compareObjects"
required>
<mat-optgroup *ngFor="let rGroup of relationShipList" [label]="rGroup.groupName">
<!-- <mat-option>Select</mat-option> -->
<mat-option [value]="relation" *ngFor="let relation of rGroup.groupValues">{{relation.name |
titlecase}}</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['property_owner_other_relation_to']">
<mat-label>Relation To</mat-label>
<mat-select placeholder="" formControlName="property_owner_other_relation_to" [compareWith]="compareObjects"
required>
<mat-optgroup *ngFor="let rtGroup of mergeCompanyApplicant" [label]="rtGroup.groupName">
<mat-option [value]="relationto" *ngFor="let relationto of rtGroup.groupValues">{{relationto.id=="0" ?
'Not Applicable' : relationto.name | titlecase}}</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<!-- end -->
<!-- start proof documents -->
<mat-form-field style="width:100%">
<mat-label>Ownership Proof Documents Sighted</mat-label>
<mat-select placeholder="" formControlName="property_ownership_proof_documents" required>
<mat-option value="1">Yes</mat-option>
<mat-option value="0">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['sighted_documents']">
<mat-label>Type of Document Sighted</mat-label>
<mat-select placeholder="" formControlName="sighted_documents" [compareWith]="compareSingleObjects"
(selectionChange)="getSightedDocs(rentalForms.controls['sighted_documents'].value)" required>
<mat-option [value]="prDocs" *ngFor="let prDocs of documentList">{{prDocs.name | titlecase}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['other_sighted_documents']">
<mat-label>Other Type of Document</mat-label>
<input matInput placeholder="" formControlName="other_sighted_documents" required>
</mat-form-field>
<!-- end -->
<!-- start nature of ther property -->
<mat-form-field style="width:100%">
<mat-label>Nature of Let Out Property as per Loan Applicant</mat-label>
<mat-select placeholder="" formControlName="nature_property" [compareWith]="compareSingleObjects" required>
<mat-option *ngFor="let property of propertyNature" [value]="property">
{{property.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['other_nature_property']">
<mat-label>Other Property</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="other_nature_property" required>
</mat-form-field>
<!-- end -->
<!-- start type of units -->
<mat-form-field style="width:100%">
<mat-label>Type of Units as per Loan Applicants</mat-label>
<mat-select placeholder="" formControlName="unit_type" [compareWith]="compareObjects" required>
<mat-optgroup *ngFor="let ugroup of unitTypeList" [label]="ugroup.groupName" [disabled]="rentalForms.value.nature_property.id>1 && rentalForms.value.nature_property.id!=ugroup.groupID">
<mat-option *ngFor="let unit of ugroup.groupValues" [value]="unit">
{{unit.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['other_unit_type']">
<mat-label>Specify Other Unit Type</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="other_unit_type" required>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="rentalForms.controls['no_units']">
<mat-label>Tot No of Units</mat-label>
<input OnlyNumber matInput autocomplete="off" placeholder="" formControlName="no_units" maxlength="3">
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="rentalForms.controls['no_floor']">
<mat-label>No of Floors</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="no_floor" maxlength="2">
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="rentalForms.controls['multistoried_total_area']">
<mat-label>Total Area Given on Rent</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="multistoried_total_area" required><!--maxlength="3"-->
</mat-form-field>
<!-- end -->
<!-- start unit of measurement -->
<mat-form-field style="width:100%;" *ngIf="rentalForms.controls['multistoried_uom']">
<mat-label>Unit of Measurement</mat-label>
<mat-select placeholder=""
formControlName="multistoried_uom" [compareWith]="compareSingleObjects" (selectionChange)="generateMultistoriedOtherUOM(rentalForms.value)" required>
<mat-option *ngFor="let unitM of unitMeasurementList" [value]="unitM">
{{unitM.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="rentalForms.controls['multistoried_other_uom']">
<mat-label>Other Unit of Measurement</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="multistoried_other_uom" required>
</mat-form-field>
<!-- end Uom -->
</div>
</mat-card-content>
</mat-card>
<div formArrayName="rental_home">
<div *ngFor="let item of rentalForms.get('rental_home').controls; let rent_i = index;let last = last" [formGroupName]="rent_i">
<mat-card>
<mat-card-header>Rentel Home Details {{rent_i+1}}</mat-card-header>
<mat-form-field style="width: 100%;">
<textarea matInput type="text" placeholder="Complete address of the property" formControlName="complete_add" name="complete_add"></textarea>
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Area of the Property
(in sq yd or Sq ft)" formControlName="area_of_property" name="area_of_property">
</mat-form-field>
<!-- this is for multistoried floor details -->
<ng-container formArrayName="multistoried_building_details" *ngIf="rentalForms.value.multistoried_building_details.length>0">
<mat-card *ngFor="let floor of rentalForms.controls.multistoried_building_details['controls']; let f=index;let flast = last" [formGroupName]="f">
<mat-card-header>
<mat-form-field style="width:100%; margin-top: 2%;">
<mat-label>Floor Level Name</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="floor_level" required>
</mat-form-field>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width:100%;">
<mat-label>No of Units</mat-label>
<input OnlyNumber matInput autocomplete="off" placeholder="" formControlName="no_units_in_floor" (keyup)="generateFloorUnit(floor.value,f)" required>
</mat-form-field>
<mat-form-field style="width:100%;">
<mat-label>Is Rent Same for All Units</mat-label>
<mat-select placeholder="" formControlName="unit_rent_difference_options" (selectionChange)="generateFloorUnit(floor.value,f)" required>
<mat-option value="1">Yes</mat-option>
<mat-option value="0">No</mat-option>
</mat-select>
</mat-form-field>
<!-- start floor unit array details -->
<!-- -->
<div [ngSwitch]="floor.value.unit_rent_difference_options">
<!-- this is for same rent for all unit -->
<ng-container *ngSwitchCase="1">
<div formArrayName="floor_unit_details" *ngIf="floor.value.floor_unit_details.length>0">
<div fxLayout="row wrap" class="align-margin" *ngFor="let fUnits of floor.controls.floor_unit_details['controls']; let fu=index;" [formGroupName]="fu">
<mat-form-field style="width:100%;">
<mat-label>Rent per Unit</mat-label>
<input OnlyNumber matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f)" required (keyup)="inWords($event.target.value,fu,1)">
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"&#8377;"}} {{rent_per_unit_Inwords[f]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:100%;">
<mat-label>Amount</mat-label>
<input OnlyNumber matInput autocomplete="off" placeholder="" formControlName="amount" readonly (keyup)="inWords($event.target.value,fu,2)">
<mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.amount != ''">{{"&#8377;"}} {{amount_Inwords[f] }} Only</mat-hint>
</mat-form-field>
</div>
</div>
</ng-container>
<!-- this is for different rent for all unit -->
<ng-container *ngSwitchCase="0">
<div fxLayout="row wrap" class="align-margin" formArrayName="floor_unit_details" *ngIf="floor.value.floor_unit_details.length>0">
<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 {{fu1}} </mat-label>
<input OnlyNumber matInput autocomplete="off" placeholder="" formControlName="rent_per_unit" (keyup)="calculateFloorRentAmt(floor.value,f)" required (keyup)="inWords($event.target.value,fu,3)">
<!-- <mat-hint align="end" style="font-size:12px" *ngIf="fUnits.value.rent_per_unit != ''">{{"&#8377;"}} {{rent_per_unit_2_Inwords[f]}} Only</mat-hint> -->
</mat-form-field>
</div>
</div>
</ng-container>
</div>
<!-- end floor unit array details-->
</mat-card-content>
<mat-card-actions *ngIf="floor.value.unit_rent_difference_options==0">
<div fxFlex="100" class="total-rent-amt">
<mat-form-field style="width:96%" appearance="outline">
<mat-label>Total Rent Amount</mat-label>
<input OnlyNumber matInput autocomplete="off" placeholder="" formControlName="floor_rent_amount" readonly>
<!-- <mat-hint align="end" style="font-size:12px" *ngIf="floor.value.floor_rent_amount != ''">{{"&#8377;"}} {{floor_rent_amount_Inwords[f]}} Only</mat-hint> -->
</mat-form-field>
</div>
</mat-card-actions>
</mat-card>
</ng-container>
<!-- end floor details -->
<!-- this is for property unit details-->
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Structure of the let out property" formControlName="structure_property" name="structure_property">
</mat-form-field>
<ng-container formArrayName="property_unit_details" *ngIf="rentalForms.value.property_unit_details.length>0">
<mat-card *ngFor="let units of rentalForms.controls.property_unit_details['controls']; let u=index;let ulast = last"
[formGroupName]="u">
<mat-card-header>
<mat-card-title>
Unit {{u1}}
</mat-card-title>
</mat-card-header>
<mat-card-content>
<div fxLayout="row wrap">
<!-- start tenant/lessees -->
<mat-form-field style="width:100%">
<mat-label>Name of the Tenant(s)/Lessees(s) of the Let out Property</mat-label>
<mat-select placeholder="" formControlName="tenant_lessees_options" (selectionChange)="generateTenantOptions(units.value,u)"
required>
<mat-option value="1">Yes</mat-option>
<mat-option value="0">Name(s) not provided</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['name_tenant_lessees']">
<mat-label>Name of Tenant(s)/Lessees(s)</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="name_tenant_lessees" required>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['name_tenant_lessees_reason']">
<mat-label>Why Tenant(s)/Lessees(s) Name not Provided</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="name_tenant_lessees_reason" required>
</mat-form-field>
<!-- end tenant/lessees-->
<!--start payment -->
<mat-form-field style="width:100%">
<mat-label>Monthly Rent Amount as per Loan Applicant</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="monthly_rent_amount"
required (keyup)="inWords($event.target.value,u,5)">
<!-- (keyup)="inWords($event,1)" -->
<!-- <mat-hint align="end" style="font-size:12px" *ngIf="units.value.monthly_rent_amount != ''">{{"&#8377;"}} {{monthly_rent_amount_Inwords[u]}} Only</mat-hint> -->
</mat-form-field>
<mat-form-field style="width:100%">
<mat-label>Mode of Payment of Rent as per Loan Applicant</mat-label>
<mat-select placeholder="" formControlName="payment_mode" [compareWith]="compareSingleObjects"
(selectionChange)="generatePaymentOptions(units.value,u,1)" required>
<mat-option *ngFor="let payment of paymentOptions" [value]="payment">
{{payment.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_cash']">
<mat-label>Amount Received in Cash</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="amount_received_cash"
required (keyup)="inWords($event.target.value,u,6)">
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Total rooms let out" formControlName="total_room" name="total_room">
</mat-form-field>
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_cash != ''">{{"&#8377;"}} {{amount_received_cash_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_bank']" (keyup)="inWords($event.target.value,u,7)">
<mat-label>Amount Received in Bank</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="amount_received_bank"
required>
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_bank != ''">{{"&#8377;"}} {{amount_received_bank_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="units.controls['payment_received_reason']">
<mat-label>Reason for Receiving Multiple Payment Mode</mat-label>
<textarea matInput placeholder="" formControlName="payment_received_reason" required></textarea>
</mat-form-field>
<mat-form-field style="width:100%">
<mat-label>Securtity Deposit amount as per Loan Applicant</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="securtity_deposit_amount"
required (keyup)="inWords($event.target.value,u,8)">
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.securtity_deposit_amount != ''">{{"&#8377;"}} {{securtity_deposit_amount_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<!-- end -->
<!-- start area covered by the property -->
<mat-form-field style="width:100%;">
<mat-label>Area Covered by the Unit</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="property_cover_area"
required>
<!--maxlength="3"-->
</mat-form-field>
<!-- end area covered -->
<mat-list>
<p>Is Rent agreement available</p>
<mat-radio-group formControlName="is_rent" name="is_rent">
<mat-radio-button value="yes">Yes</mat-radio-button>
<mat-radio-button value="no">No</mat-radio-button>
</mat-radio-group>
</mat-list>
<div *ngIf="item.get('is_rent').value=='yes'">
<mat-form-field style="width: 100%;">
<input matInput type="date" placeholder="Date of Agreement" formControlName="date_agreement" name="date_agreement">
</mat-form-field>
<!-- start unit of measurement -->
<mat-form-field style="width:100%">
<mat-label>Unit of Measurement</mat-label>
<mat-select placeholder="" formControlName="unit_measurement" [compareWith]="compareSingleObjects"
(selectionChange)="generateOtherunitMeasurement(units.value,u)" required>
<mat-option *ngFor="let unitM of unitMeasurementList" [value]="unitM">
{{unitM.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Validity" formControlName="date_validity" name="date_validity">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="number" placeholder="Rent as per Agreement" formControlName="rent_agreement" name="rent_agreement">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="number" placeholder="Actual Rent" formControlName="actual_rent" name="actual_rent">
</mat-form-field>
<mat-list>
<p>Photo of agreement taken ?</p>
<mat-radio-group formControlName="photo_areegment" name="photo_areegment">
<mat-radio-button value="yes">Yes</mat-radio-button>
<mat-radio-button value="no">No</mat-radio-button>
</mat-radio-group>
</mat-list>
<mat-form-field style="width:100%" *ngIf="units.controls['other_unit_measurement']">
<mat-label>Other Unit of Measurement</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="other_unit_measurement" required>
</mat-form-field>
<!-- end -->
<!-- start Rent Agreement executed -->
<mat-form-field style="width:100%">
<mat-label>Is Rent Agreement executed for the Property let out</mat-label>
<mat-select placeholder="" formControlName="is_rent_agreement_executed" (selectionChange)="generateRentAgreementSeen(units.value,u)"
required>
<mat-option value="1">Yes</mat-option>
<mat-option value="0">No</mat-option>
</mat-select>
</mat-form-field>
<!-- end -->
<!-- start rent agreement -->
<mat-form-field style="width:100%" *ngIf="units.controls['rent_agreement_seen']">
<mat-label>Rent Agreement Seen</mat-label>
<mat-select placeholder="" formControlName="rent_agreement_seen" (selectionChange)="generateRegisterOptions(units.value,u)"
required>
<mat-option value="1">Yes</mat-option>
<mat-option value="0">No</mat-option>
</mat-select>
</mat-form-field>
<!-- end -->
<!-- start Rent Agreement Registered -->
<mat-form-field style="width:100%" *ngIf="units.controls['rent_agreement_registered']">
<mat-label>Is the Rent Agreement Registered at Sub-Registrar Office</mat-label>
<mat-select placeholder="" formControlName="rent_agreement_registered" (selectionChange)="generateRegisterDetails(units.value,u)"
required>
<mat-option value="1">Yes</mat-option>
<mat-option value="0">No</mat-option>
</mat-select>
</mat-form-field>
<!-- end -->
<!-- start rent agreement date details -->
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_date']">
<mat-label>Date of Agreement</mat-label>
<!-- <input matInput [max]="maxDate" [matDatepicker]="agreementpicker" formControlName="agreement_date"
placeholder="" (dateChange)="calculateExpiryDate($event,u)" readonly>
<mat-datepicker-toggle matSuffix [for]="agreementpicker" disabled="false"></mat-datepicker-toggle>
<mat-datepicker #agreementpicker></mat-datepicker> -->
<input matInput type="date" [max]="maxDate" formControlName="agreement_date" name="agreement_date" placeholder="" (dateChange)="calculateExpiryDate($event,u)">
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_no_months']">
<mat-label>No of Months for Which Property has been let out as per Agreement</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" maxlength="4" formControlName="agreement_no_months"
(keyup)="calculateExpiryDate($event,u)" required>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_expiring_date']">
<mat-label>Date on which Agreement is Expiring</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="agreement_expiring_date" readonly>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['rental_remaining_months']">
<mat-label>No of Rental Months Remaining as per Agreement</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="rental_remaining_months"
readonly>
</mat-form-field>
<!-- end -->
<!-- start agreement rent amount -->
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_monthly_rent_amount']">
<mat-label>Monthly Rent Amount as per Agreement</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="agreement_monthly_rent_amount"
required (keyup)="inWords($event.target.value,u,9)">
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.agreement_monthly_rent_amount != ''">{{"&#8377;"}} {{agreement_monthly_rent_amount_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<!-- end -->
<!-- start Security Deposit amount as per agreement -->
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_security_deposit_amount']">
<mat-label>Security Deposit Amount as per Agreement</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="agreement_security_deposit_amount"
required (keyup)="inWords($event.target.value,u,10)">
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.agreement_security_deposit_amount != ''">{{"&#8377;"}} {{agreement_security_deposit_amount_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<!-- end -->
<!-- start validate agreement amount -->
<mat-form-field style="width:100%" *ngIf="units.controls['monthly_rent_amount'] && units.controls['agreement_monthly_rent_amount'] && validateAgreementAmt(units.controls['monthly_rent_amount'] ? units.value.monthly_rent_amount :'',units.controls['agreement_monthly_rent_amount'] ? units.value.agreement_monthly_rent_amount:'') !=0">
<mat-label>There is a Difference of
Rs.{{validateAgreementAmt(units.value.monthly_rent_amount,units.value.agreement_monthly_rent_amount)}}
in the rent amount as per agreement and actual rent received. Why?</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="differences_loanapplicant_rentagreement">
</mat-form-field>
<!-- end -->
<!-- start name of owners as per agreement -->
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_property_owners_name']">
<mat-label>Name of Owner / Owners of Rented Property as per Rent Agreement</mat-label>
<mat-select placeholder="Name" formControlName="agreement_property_owners_name" [compareWith]="compareObjects"
multiple (selectionChange)="generateAgreementOtherOwners(units.value.agreement_property_owners_name,u)"
required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_property_owner_other']">
<mat-label>Specify Other Owner/Owners</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="agreement_property_owner_other"
required>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_property_owner_other_relationship']">
<mat-label>Relation of Owner to Loan Applicant</mat-label>
<mat-select placeholder="" formControlName="agreement_property_owner_other_relationship" [compareWith]="compareObjects"
required>
<mat-optgroup *ngFor="let rGroup of relationShipList" [label]="rGroup.groupName">
<!-- <mat-option>Select</mat-option> -->
<mat-option [value]="relation" *ngFor="let relation of rGroup.groupValues">{{relation.name |
titlecase}}</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_property_owner_other_relation_to']">
<mat-label>Relation To</mat-label>
<mat-select placeholder="" formControlName="agreement_property_owner_other_relation_to" [compareWith]="compareObjects"
required>
<mat-optgroup *ngFor="let rtGroup of mergeCompanyApplicant" [label]="rtGroup.groupName">
<mat-option [value]="relationto" *ngFor="let relationto of rtGroup.groupValues">{{relationto.id=="0"
? 'Not Applicable' : relationto.name | titlecase}}</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<!-- end -->
<!-- start tenant agreeent name -->
<mat-form-field style="width:100%" *ngIf="units.controls['agreement_tenant_lessees_name']">
<mat-label>Name of Tenants / Lessees as per Rent Agreement</mat-label>
<textarea matInput rows="4" placeholder="" formControlName="agreement_tenant_lessees_name" required></textarea>
</mat-form-field>
<!-- end -->
<!-- end -->
<!-- start met tenant/lessees-->
<mat-form-field style="width:100%" *ngIf="units.controls['met_tenant_lessees_options']">
<mat-label>Tenant(s) / Lessee(s) Met During Visit of the Rented Property</mat-label>
<mat-select placeholder="" formControlName="met_tenant_lessees_options" (selectionChange)="generateTenantMetDetails(units.value,u)"
required>
<mat-option value="1">Yes</mat-option>
<mat-option value="0">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['name_tenant_lessees_per_met']">
<mat-label>Name of the Tenant / Lessee Met</mat-label>
<!-- <mat-select placeholder="" formControlName="name_tenant_lessees_per_met" required>
<mat-option [value]="metTenant" *ngFor="let metTenant of units.value.name_tenant_lessees">{{metTenant.name}}</mat-option>
</mat-select> -->
<input matInput autocomplete="off" placeholder="" formControlName="name_tenant_lessees_per_met" required>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['name_tenant_lessees_reason_per_met']">
<mat-label>Why Tenant / Lessee not Met ?</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="name_tenant_lessees_reason_per_met"
required>
</mat-form-field>
<!-- end -->
<!--start tenant met owners-->
<mat-form-field style="width:100%" *ngIf="units.controls['property_owner_per_met']">
<mat-label>Name of Owner as per Tenant / Lessee Met</mat-label>
<mat-select placeholder="Name" formControlName="property_owner_per_met" [compareWith]="compareObjects"
multiple (selectionChange)="generateMetOtherOwners(units.value,u)" required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['property_owner_other_per_met']">
<mat-label>Specify Other Owner/Owners</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="property_owner_other_per_met" required>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['property_owner_other_relationship_per_met']">
<mat-label>Relation of Owner to Loan Applicant</mat-label>
<mat-select placeholder="" formControlName="property_owner_other_relationship_per_met" [compareWith]="compareObjects"
required>
<mat-optgroup *ngFor="let rGroup of relationShipList" [label]="rGroup.groupName">
<!-- <mat-option>Select</mat-option> -->
<mat-option [value]="relation" *ngFor="let relation of rGroup.groupValues">{{relation.name |
titlecase}}</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['property_owner_other_relation_to_per_met']">
<mat-label>Relation To</mat-label>
<mat-select placeholder="" formControlName="property_owner_other_relation_to_per_met" [compareWith]="compareObjects"
required>
<mat-optgroup *ngFor="let rtGroup of mergeCompanyApplicant" [label]="rtGroup.groupName">
<mat-option [value]="relationto" *ngFor="let relationto of rtGroup.groupValues">{{relationto.id=="0"
? 'Not Applicable' : relationto.name | titlecase}}</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<!-- end -->
<!-- start met payment -->
<mat-form-field style="width:100%" *ngIf="units.controls['paid_monthly_rent_per_met']">
<mat-label>Monthly Rent Amount Paid as per Tenant / Lessee Met</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="paid_monthly_rent_per_met"
required (keyup)="inWords($event.target.value,u,11)">
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.paid_monthly_rent_per_met != ''">{{"&#8377;"}} {{paid_monthly_rent_per_met_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['period_of_stay_per_met']">
<mat-label>Period (Months) of Stay as per Tenant / Lessee Met</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="period_of_stay_per_met"
maxlength="5" required>
</mat-form-field>
<mat-form-field style="width:100%" *ngIf="units.controls['payment_mode_per_met']">
<mat-label>Mode of Payment of Rent as Validated by PD Officer with Tenant / Lessee During Visit</mat-label>
<mat-select placeholder="" formControlName="payment_mode_per_met" [compareWith]="compareSingleObjects"
(selectionChange)="generatePaymentOptions(units.value,u,2)" required>
<mat-option *ngFor="let payment of paymentPaidOptions" [value]="payment">
{{payment.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_cash_per_met']">
<mat-label>Amount Paid in Cash</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="amount_received_cash_per_met"
required (keyup)="inWords($event.target.value,u,12)">
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_cash_per_met != ''">{{"&#8377;"}} {{amount_received_cash_per_met_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="units.controls['amount_received_bank_per_met']">
<mat-label>Amount Paid in Bank</mat-label>
<input matInput OnlyNumber autocomplete="off" placeholder="" formControlName="amount_received_bank_per_met"
required (keyup)="inWords($event.target.value,u,13)">
<mat-hint align="end" style="font-size:12px" *ngIf="units.value.amount_received_bank_per_met != ''">{{"&#8377;"}} {{amount_received_bank_per_met_Inwords[u]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="units.controls['payment_received_reason_per_met']">
<mat-label>Reason for Paid Multiple Payment Mode</mat-label>
<textarea matInput placeholder="" formControlName="payment_received_reason_per_met" required></textarea>
</mat-form-field>
<!-- start validate appplicant/agreement payment options -->
<mat-form-field style="width:100%" *ngIf="(units.value.monthly_rent_amount>0 && units.value.paid_monthly_rent_per_met>0 && units.value.payment_mode!='' && units.value.payment_mode_per_met!='') && (units.value.monthly_rent_amount!=units.value.paid_monthly_rent_per_met || units.value.payment_mode.id!=units.value.payment_mode_per_met.id)">
<mat-label>What is the Reason for Difference in Rent Amount or Mode of Payment</mat-label>
<input matInput autocomplete="off" placeholder="" formControlName="payment_difference_per_met">
</mat-form-field>
<!-- end -->
<!-- end met payment -->
</div>
<mat-form-field style="width: 100%;">
<input matInput type="number" placeholder="Bank" formControlName="bank" name="bank">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="number" placeholder="Cash" formControlName="cash" name="cash">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Rent received from each floor and or Rooms" formControlName="rent_each_floor" name="rent_each_floor">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Total rent received" formControlName="total_rent" name="total_rent">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Property Paper or other related document to prove ownership" formControlName="related_doc_owner" name="related_doc_owner">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Third party check of prevailing rent in the neighbour hood" formControlName="third_party_check" name="third_party_check">
</mat-form-field>
</mat-card>
<div formArrayName="details_tenants">
</mat-card-content>
<mat-card-actions align="end">
<ion-col col-6 offset-3>
<button ion-button clear (click)="removeUnit(u)">
<ion-icon style="font-size:22px" color="optblue" name="md-trash" *ngIf="rentalForms.value.property_unit_details.length>1"
matTooltip="Remove Unit" matTooltipPosition="above"></ion-icon>
</button>
</ion-col>
</mat-card-actions>
</mat-card>
</ng-container>
<!--<button type="button" mat-flat-button (click)="addMoreUnitDetails()" matTooltip="Add More Unit" matTooltipPosition="above" color="primary"><strong>Add More Unit</strong></button>-->
<button ion-button round block style="font-size: 13px;" color="optblue" (click)="addMoreUnitDetails()">Add More
Unit</button>
<br>
<mat-card>
<div *ngFor="let tenants of item['controls'].details_tenants['controls']; let i =index;let last = last" [formGroupName]="i">
<h3>Details of the tenants {{i+1}}</h3>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Name" formControlName="name" name="name">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="tel" placeholder="Mobile No" formControlName="mobile_no" maxlength="10" name="mobile_no">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Tenant Seen" formControlName="tenants_seen" name="tenants_seen">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Tenant confirmed owner" formControlName="tenants_con_owner" name="tenants_con_owner">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Rent Paid" formControlName="rent_paid" name="rent_paid">
</mat-form-field>
<mat-form-field style="width: 100%;">
<input matInput type="text" placeholder="Staying since" formControlName="staying_since" name="staying_since">
</mat-form-field>
<mat-card>
<mat-card-header>
<mat-card-title>
Third Party Check
</mat-card-title>
</mat-card-header>
<mat-card-content>
<div fxLayout="row wrap">
<!-- start third party check -->
<mat-form-field style="width:100%">
<mat-label>Third party check done on prevailing rent in the area</mat-label>
<mat-select placeholder="" formControlName="done_third_party_check" required>
<mat-option value="1">Yes</mat-option>
<mat-option value="0">No</mat-option>
</mat-select>
</mat-form-field>
<ion-col text-right>
<a (click)="deleteTenantsDetails(rent_i,i)">
<ion-icon name="md-close" color="optblue" style="font-size: 22px;"></ion-icon>
</a>
</ion-col>
</div>
<ion-buttons end>
<ion-col col-3>
<a (click)="addTenantsDetails(rent_i)" *ngIf="last">
<ion-icon name="md-add" color="optblue" style="font-size: 22px;"></ion-icon>
</a>
</ion-col>
<mat-form-field style="width:100%;" *ngIf="rentalForms.controls['whom_third_party_check_done']">
<mat-label>Name of person with whom Third Party Check on going rentals in the area done</mat-label>
<input matInput placeholder="" formControlName="whom_third_party_check_done" required>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="rentalForms.controls['description_third_party_check_done']">
<mat-label>Description of the person with whom the Third Party Check is done</mat-label>
<textarea matInput placeholder="" formControlName="description_third_party_check_done" required></textarea>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="rentalForms.controls['rental_rates_third_party_check_done']">
<mat-label>Rental rates in the area as per the person with whom Third Party Check is done</mat-label>
<textarea matInput placeholder="" formControlName="rental_rates_third_party_check_done" required></textarea>
</mat-form-field>
<mat-form-field style="width:100%;" *ngIf="rentalForms.controls['why_third_party_check_not_done']">
<mat-label>Why Third party check not done</mat-label>
<textarea matInput placeholder="" formControlName="why_third_party_check_not_done" required></textarea>
</mat-form-field>
<!-- end -->
</div>
</mat-card-content>
</mat-card>
</ion-buttons>
</mat-card>
</div>
<ion-row>
<mat-card>
<mat-form-field style="width: 100%">
<textarea matInput placeholder="Remarks" formControlName="rental_remark"></textarea>
</mat-form-field>
</mat-card>
<!-- <ion-row>
<ion-col col-6>
<!-- <a (click)="addrentalHome()" *ngIf="last">
!-- <a (click)="addrentalHome()" *ngIf="last">
<ion-icon name="md-add" color="optblue" style="font-size: 22px;"></ion-icon>
</a> -->
</a> --
<button ion-button (click)="addrentalHome()" *ngIf="last" color="primary">Add More</button>
</ion-col>
<ion-col col-6>
<!-- <a (click)="deleterentalHome(rent_i)">
!-- <a (click)="deleterentalHome(rent_i)">
<ion-icon name="md-close" color="optblue" style="font-size: 22px;"></ion-icon>
</a> -->
</a> --
<button ion-button (click)="deleterentalHome(rent_i)" color="primary">Remove</button>
</ion-col>
</ion-row>
</div>
<br/>
</div>
</ion-row> -->
<ion-row>
<!-- <ion-buttons >
<!-- <ion-buttons >
<ion-button color="optblue" full[disabled]="!pdforms.valid" mat-raised-button style="width:100%" (click)="savepdDetails(pdforms.value)">Save <ion-icon name="md-disc"></ion-icon></ion-button> -->
<button ion-button full color="optblue" (click)="saveRentalDetails(rentalForms.value)"> Save</button>
<!-- </ion-buttons> -->
<button ion-button full color="optblue" (click)="saveRentalDetails(rentalForms.value)"> Save</button>
<!-- </ion-buttons> -->
</ion-row>
</form>

View File

@ -1,8 +1,21 @@
page-pd-question-rental-info {
.button-md{
padding: 0 2.9em !important;
mat-hint{
font-size:11px;
}
mat-card{
margin-bottom: 15px;
border-radius: 10px !important;
box-shadow: 0 16px 38px -12px rgba(0, 0, 0, 0.56), 0 4px 25px 0 rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important;
}
.mat-card-content{
margin-bottom: 0px !important;
}
.scroll-content{
background-color: #eee;
}
// .button-md{
// padding: 0 2.9em !important;
// }
}

View File

@ -32,86 +32,150 @@ public commonimage = "http://ssa.sineedge.com/sparqapi/logo/avatar.jpg";
return CurrentDate.toString();
}
convertNumberToWords(amount) {
var words = new Array();
words[0] = '';
words[1] = 'One';
words[2] = 'Two';
words[3] = 'Three';
words[4] = 'Four';
words[5] = 'Five';
words[6] = 'Six';
words[7] = 'Seven';
words[8] = 'Eight';
words[9] = 'Nine';
words[10] = 'Ten';
words[11] = 'Eleven';
words[12] = 'Twelve';
words[13] = 'Thirteen';
words[14] = 'Fourteen';
words[15] = 'Fifteen';
words[16] = 'Sixteen';
words[17] = 'Seventeen';
words[18] = 'Eighteen';
words[19] = 'Nineteen';
words[20] = 'Twenty';
words[30] = 'Thirty';
words[40] = 'Forty';
words[50] = 'Fifty';
words[60] = 'Sixty';
words[70] = 'Seventy';
words[80] = 'Eighty';
words[90] = 'Ninety';
amount = amount.toString();
var atemp = amount.split(".");
var number = atemp[0].split(",").join("");
var n_length = number.length;
let value:any = "";
var words_string = "";
if (n_length <= 9) {
var n_array:any = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
var received_n_array = new Array();
for (var i = 0; i < n_length; i++) {
received_n_array[i] = number.substr(i, 1);
}
for (var i = 9 - n_length, j = 0; i < 9; i++, j++) {
n_array[i] = received_n_array[j];
}
for (var i = 0, j = 1; i < 9; i++, j++) {
if (i == 0 || i == 2 || i == 4 || i == 7) {
if (n_array[i] == 1) {
n_array[j] = 10 + parseInt(n_array[j]);
n_array[i] = 0;
}
convertNumberToWords(price) {
price = price.toString();
let atemp = price.split(".");
let amount = atemp[0];
var sglDigit = ["Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"],
dblDigit = ["Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"],
tensPlace = ["", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"],
handle_tens = function(dgt, prevDgt) {
return 0 == dgt ? "" : " " + (1 == dgt ? dblDigit[prevDgt] : tensPlace[dgt])
},
handle_utlc = function(dgt, nxtDgt, denom) {
return (0 != dgt && 1 != nxtDgt ? " " + sglDigit[dgt] : "") + (0 != nxtDgt || dgt > 0 ? " " + denom : "")
};
var str = "",
digitIdx = 0,
digit = 0,
nxtDigit = 0,
words = [];
if (amount += "", isNaN(parseInt(amount))) str = "";
else if (parseInt(amount) > 0 && amount.length <= 10) {
for (digitIdx = amount.length - 1; digitIdx >= 0; digitIdx--)
switch (digit = amount[digitIdx] - 0, nxtDigit = digitIdx > 0 ? amount[digitIdx - 1] - 0 : 0, amount.length - digitIdx - 1) {
case 0:
words.push(handle_utlc(digit, nxtDigit, ""));
break;
case 1:
words.push(handle_tens(digit, amount[digitIdx + 1]));
break;
case 2:
words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] && 0 != amount[digitIdx + 2] ? " and" : "") : "");
break;
case 3:
words.push(handle_utlc(digit, nxtDigit, "Thousand"));
break;
case 4:
words.push(handle_tens(digit, amount[digitIdx + 1]));
break;
case 5:
words.push(handle_utlc(digit, nxtDigit, "Lakh"));
break;
case 6:
words.push(handle_tens(digit, amount[digitIdx + 1]));
break;
case 7:
words.push(handle_utlc(digit, nxtDigit, "Crore"));
break;
case 8:
words.push(handle_tens(digit, amount[digitIdx + 1]));
break;
case 9:
words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] || 0 != amount[digitIdx + 2] ? " and" : " Crore") : "")
// break;
// case 10:
// words.push(0 != digit ? " " + sglDigit[digit] + " Lakh" + (0 != price[digitIdx + 1] || 0 != price[digitIdx + 2] ? " and" : " Hundred" + (0 != price[digitIdx + 1] || 0 != price[digitIdx + 2] || 0 != price[digitIdx + 3] ? " and" : " Crore"))
// : "")
// break;
}
}
value = "";
for (var i = 0; i < 9; i++) {
if (i == 0 || i == 2 || i == 4 || i == 7) {
value = n_array[i] * 10;
} else {
value = n_array[i];
}
if (value != 0) {
words_string += words[value] + " ";
}
if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) {
words_string += "Crores ";
}
if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) {
words_string += "Lakhs ";
}
if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) {
words_string += "Thousand ";
}
if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) {
words_string += "Hundred and ";
} else if (i == 6 && value != 0) {
words_string += "Hundred ";
}
}
words_string = words_string.split(" ").join(" ");
}
return words_string;
str = words.reverse().join("")
// str =(str.length > 2 && str.charAt(str.length-2)==',') ? str.slice(0, -2) : str;
} else str = "";
return str
// var words = new Array();
// words[0] = '';
// words[1] = 'One';
// words[2] = 'Two';
// words[3] = 'Three';
// words[4] = 'Four';
// words[5] = 'Five';
// words[6] = 'Six';
// words[7] = 'Seven';
// words[8] = 'Eight';
// words[9] = 'Nine';
// words[10] = 'Ten';
// words[11] = 'Eleven';
// words[12] = 'Twelve';
// words[13] = 'Thirteen';
// words[14] = 'Fourteen';
// words[15] = 'Fifteen';
// words[16] = 'Sixteen';
// words[17] = 'Seventeen';
// words[18] = 'Eighteen';
// words[19] = 'Nineteen';
// words[20] = 'Twenty';
// words[30] = 'Thirty';
// words[40] = 'Forty';
// words[50] = 'Fifty';
// words[60] = 'Sixty';
// words[70] = 'Seventy';
// words[80] = 'Eighty';
// words[90] = 'Ninety';
// amount = amount.toString();
// var atemp = amount.split(".");
// var number = atemp[0].split(",").join("");
// var n_length = number.length;
// let value:any = "";
// var words_string = "";
// if (n_length <= 9) {
// var n_array:any = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
// var received_n_array = new Array();
// for (var i = 0; i < n_length; i++) {
// received_n_array[i] = number.substr(i, 1);
// }
// for (var i = 9 - n_length, j = 0; i < 9; i++, j++) {
// n_array[i] = received_n_array[j];
// }
// for (var i = 0, j = 1; i < 9; i++, j++) {
// if (i == 0 || i == 2 || i == 4 || i == 7) {
// if (n_array[i] == 1) {
// n_array[j] = 10 + parseInt(n_array[j]);
// n_array[i] = 0;
// }
// }
// }
// value = "";
// for (var i = 0; i < 9; i++) {
// if (i == 0 || i == 2 || i == 4 || i == 7) {
// value = n_array[i] * 10;
// } else {
// value = n_array[i];
// }
// if (value != 0) {
// words_string += words[value] + " ";
// }
// if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) {
// words_string += "Crores ";
// }
// if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) {
// words_string += "Lakhs ";
// }
// if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) {
// words_string += "Thousand ";
// }
// if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) {
// words_string += "Hundred and ";
// } else if (i == 6 && value != 0) {
// words_string += "Hundred ";
// }
// }
// words_string = words_string.split(" ").join(" ");
// }
// return words_string;
}
}