WEB-280: Add additional field which would return available disbursement amount with over applied amount
This commit is contained in:
+6
@@ -33,6 +33,12 @@
|
||||
</span></span
|
||||
>
|
||||
</div>
|
||||
<div class="flex-fill" *ngIf="data.loanData?.delinquent?.availableDisbursementAmountWithOverApplied !== undefined">
|
||||
<span class="flex-50">{{ 'labels.inputs.Available Disbursement Amount (with Over Applied)' | translate }}:</span>
|
||||
<span class="flex-50">{{
|
||||
data.loanData.delinquent.availableDisbursementAmountWithOverApplied | formatNumber
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -278,5 +278,19 @@
|
||||
}} {{ 'labels.text.Days' | translate }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="flex-fill layout-row"
|
||||
*ngIf="
|
||||
loanDetails &&
|
||||
loanDetails.delinquent &&
|
||||
loanDetails.delinquent.availableDisbursementAmountWithOverApplied !== undefined
|
||||
"
|
||||
>
|
||||
<span class="flex-50">{{ 'labels.inputs.Available Disbursement Amount (with Over Applied)' | translate }}</span>
|
||||
<span class="flex-50">{{
|
||||
loanDetails.delinquent.availableDisbursementAmountWithOverApplied | formatNumber
|
||||
}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -40,6 +40,12 @@
|
||||
>
|
||||
</mifosx-input-amount>
|
||||
|
||||
<!-- Display Available Disbursement Amount with Over Applied if available -->
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Available Disbursement Amount (with Over Applied)' | translate }}</mat-label>
|
||||
<input matInput [value]="loanData.availableDisbursementAmountWithOverApplied | formatNumber" readonly />
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Transaction Amount' | translate }}</mat-label>
|
||||
<input matInput type="number" required formControlName="approvedLoanAmount" />
|
||||
|
||||
+18
-1
@@ -10,7 +10,9 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Currency } from 'app/shared/models/general.model';
|
||||
import { InputAmountComponent } from '../../../../shared/input-amount/input-amount.component';
|
||||
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
||||
import { FormatNumberPipe } from '../../../../pipes/format-number.pipe';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
/**
|
||||
* Approve Loan component.
|
||||
@@ -22,7 +24,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
imports: [
|
||||
...STANDALONE_SHARED_IMPORTS,
|
||||
InputAmountComponent,
|
||||
CdkTextareaAutosize
|
||||
CdkTextareaAutosize,
|
||||
FormatNumberPipe,
|
||||
MatIcon
|
||||
]
|
||||
})
|
||||
export class ApproveLoanComponent implements OnInit {
|
||||
@@ -70,6 +74,19 @@ export class ApproveLoanComponent implements OnInit {
|
||||
expectedDisbursementDate: new Date(response.timeline.expectedDisbursementDate)
|
||||
});
|
||||
});
|
||||
|
||||
// Get delinquency data for available disbursement amount with over applied
|
||||
this.loanService.getLoanDelinquencyDataForTemplate(this.loanId).subscribe((delinquencyData: any) => {
|
||||
// Check if the field is at root level
|
||||
if (delinquencyData.availableDisbursementAmountWithOverApplied !== undefined) {
|
||||
this.loanData.availableDisbursementAmountWithOverApplied =
|
||||
delinquencyData.availableDisbursementAmountWithOverApplied;
|
||||
}
|
||||
// Also check if it's in delinquent object
|
||||
if (delinquencyData.delinquent) {
|
||||
this.loanData.delinquent = delinquencyData.delinquent;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+6
@@ -29,6 +29,12 @@
|
||||
>
|
||||
</mifosx-input-amount>
|
||||
|
||||
<!-- Display Available Disbursement Amount with Over Applied if available -->
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Available Disbursement Amount (with Over Applied)' | translate }}</mat-label>
|
||||
<input matInput [value]="dataObject.availableDisbursementAmountWithOverApplied | formatNumber" readonly />
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="dataObject.fixedEmiAmount">
|
||||
<mat-label>{{ 'labels.inputs.Fixed EMI amount' | translate }}</mat-label>
|
||||
<input matInput type="number" formControlName="fixedEmiAmount" />
|
||||
|
||||
+19
-1
@@ -13,7 +13,9 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Currency } from 'app/shared/models/general.model';
|
||||
import { InputAmountComponent } from '../../../../shared/input-amount/input-amount.component';
|
||||
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
||||
import { FormatNumberPipe } from '../../../../pipes/format-number.pipe';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-disburse-to-savings-account',
|
||||
@@ -22,7 +24,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
imports: [
|
||||
...STANDALONE_SHARED_IMPORTS,
|
||||
InputAmountComponent,
|
||||
CdkTextareaAutosize
|
||||
CdkTextareaAutosize,
|
||||
FormatNumberPipe,
|
||||
MatIcon
|
||||
]
|
||||
})
|
||||
export class DisburseToSavingsAccountComponent implements OnInit {
|
||||
@@ -59,6 +63,20 @@ export class DisburseToSavingsAccountComponent implements OnInit {
|
||||
if (this.dataObject.currency) {
|
||||
this.currency = this.dataObject.currency;
|
||||
}
|
||||
|
||||
// Get delinquency data for available disbursement amount with over applied
|
||||
const loanId = this.route.snapshot.params['loanId'];
|
||||
this.loanService.getLoanDelinquencyDataForTemplate(loanId).subscribe((delinquencyData: any) => {
|
||||
// Check if the field is at root level
|
||||
if (delinquencyData.availableDisbursementAmountWithOverApplied !== undefined) {
|
||||
this.dataObject.availableDisbursementAmountWithOverApplied =
|
||||
delinquencyData.availableDisbursementAmountWithOverApplied;
|
||||
}
|
||||
// Also check if it's in delinquent object
|
||||
if (delinquencyData.delinquent) {
|
||||
this.dataObject.delinquent = delinquencyData.delinquent;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
>
|
||||
</mifosx-input-amount>
|
||||
|
||||
<!-- Display Available Disbursement Amount with Over Applied if available -->
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Available Disbursement Amount (with Over Applied)' | translate }}</mat-label>
|
||||
<input matInput [value]="dataObject.availableDisbursementAmountWithOverApplied | formatNumber" readonly />
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.External Id' | translate }}</mat-label>
|
||||
<input matInput formControlName="externalId" />
|
||||
|
||||
@@ -17,7 +17,9 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
import { InputAmountComponent } from '../../../../shared/input-amount/input-amount.component';
|
||||
import { MatSlideToggle } from '@angular/material/slide-toggle';
|
||||
import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
||||
import { FormatNumberPipe } from '../../../../pipes/format-number.pipe';
|
||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
/**
|
||||
* Disburse Loan Option
|
||||
@@ -30,7 +32,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||
...STANDALONE_SHARED_IMPORTS,
|
||||
InputAmountComponent,
|
||||
MatSlideToggle,
|
||||
CdkTextareaAutosize
|
||||
CdkTextareaAutosize,
|
||||
FormatNumberPipe,
|
||||
MatIcon
|
||||
]
|
||||
})
|
||||
export class DisburseComponent implements OnInit {
|
||||
@@ -78,6 +82,19 @@ export class DisburseComponent implements OnInit {
|
||||
if (this.dataObject.currency) {
|
||||
this.currency = this.dataObject.currency;
|
||||
}
|
||||
|
||||
// Get delinquency data for available disbursement amount with over applied
|
||||
this.loanService.getLoanDelinquencyDataForTemplate(this.loanId).subscribe((delinquencyData: any) => {
|
||||
// Check if the field is at root level
|
||||
if (delinquencyData.availableDisbursementAmountWithOverApplied !== undefined) {
|
||||
this.dataObject.availableDisbursementAmountWithOverApplied =
|
||||
delinquencyData.availableDisbursementAmountWithOverApplied;
|
||||
}
|
||||
// Also check if it's in delinquent object
|
||||
if (delinquencyData.delinquent) {
|
||||
this.dataObject.delinquent = delinquencyData.delinquent;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+13
@@ -86,6 +86,19 @@ export class ViewGuarantorsComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.guarantorDetails = this.dataObject.guarantors;
|
||||
|
||||
// Get delinquency data for available disbursement amount with over applied
|
||||
this.loansService.getLoanDelinquencyDataForTemplate(this.loanId).subscribe((delinquencyData: any) => {
|
||||
// Check if the field is at root level
|
||||
if (delinquencyData.availableDisbursementAmountWithOverApplied !== undefined) {
|
||||
this.dataObject.availableDisbursementAmountWithOverApplied =
|
||||
delinquencyData.availableDisbursementAmountWithOverApplied;
|
||||
}
|
||||
// Also check if it's in delinquent object
|
||||
if (delinquencyData.delinquent) {
|
||||
this.dataObject.delinquent = delinquencyData.delinquent;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
toggleGuarantorsDetailsOverview() {
|
||||
|
||||
@@ -29,7 +29,12 @@ export class LoansService {
|
||||
}
|
||||
|
||||
getLoanActionTemplate(loanId: string, command: string): Observable<any> {
|
||||
const httpParams = new HttpParams().set('command', command);
|
||||
let httpParams = new HttpParams().set('command', command);
|
||||
// Add associations for specific commands that need delinquency data
|
||||
if (command === 'disburse' || command === 'disbursetosavings') {
|
||||
httpParams = httpParams.set('associations', 'delinquency');
|
||||
}
|
||||
|
||||
return this.http.get(`/loans/${loanId}/transactions/template`, { params: httpParams });
|
||||
}
|
||||
|
||||
@@ -92,6 +97,16 @@ export class LoansService {
|
||||
return this.http.get(`/loans/${loanId}`, { params: httpParams });
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Loan Delinquency Data for template usage
|
||||
* @param {string} loanId Loan Id
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getLoanDelinquencyDataForTemplate(loanId: string): Observable<any> {
|
||||
const httpParams = new HttpParams().set('associations', 'delinquency');
|
||||
return this.http.get(`/loans/${loanId}`, { params: httpParams });
|
||||
}
|
||||
|
||||
getDelinquencyActions(loanId: string) {
|
||||
return this.http.get(`/loans/${loanId}/delinquency-actions`);
|
||||
}
|
||||
@@ -469,7 +484,7 @@ export class LoansService {
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getLoanApprovalTemplate(loanId: string): Observable<any> {
|
||||
const httpParams = new HttpParams().set('templateType', 'approval');
|
||||
const httpParams = new HttpParams().set('templateType', 'approval').set('associations', 'delinquency');
|
||||
return this.http.get(`/loans/${loanId}/template`, { params: httpParams });
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface DelinquencyRange {
|
||||
|
||||
export interface DelinquentData {
|
||||
availableDisbursementAmount: number;
|
||||
availableDisbursementAmountWithOverApplied: number;
|
||||
pastDueDays: number;
|
||||
nextPaymentDueDate: number[];
|
||||
delinquentDays: number;
|
||||
|
||||
Reference in New Issue
Block a user