Loan Reschedule management in Loan Account (#1637)
Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
1bccd96c37
commit
08a327fdbf
+3
-3
@@ -8,13 +8,13 @@
|
||||
</div>
|
||||
<div fxFlex="60%" fxLayoutGap="0.5rem">
|
||||
<button mat-raised-button color="success" (click)="approveChecker()">
|
||||
<fa-icon icon="check"></fa-icon> Approve
|
||||
<fa-icon icon="check" class="m-r-10"></fa-icon>Approve
|
||||
</button>
|
||||
<button mat-raised-button color="warn" (click)="deleteChecker()">
|
||||
<fa-icon icon="trash"></fa-icon> Delete
|
||||
<fa-icon icon="trash" class="m-r-10"></fa-icon>Delete
|
||||
</button>
|
||||
<button mat-raised-button color="reject" (click)="rejectChecker()">
|
||||
<fa-icon icon="times"></fa-icon> Reject
|
||||
<fa-icon icon="times" class="m-r-10"></fa-icon>Reject
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+7
-3
@@ -8,8 +8,12 @@
|
||||
</div>
|
||||
<div fxFlex="60%">
|
||||
<button mat-raised-button color="success" *mifosxHasPermission="'APPROVE_LOANRESCHEDULE'"
|
||||
(click)="approveBulkLoanReschedule()">
|
||||
<fa-icon icon="check"></fa-icon> Approve
|
||||
(click)="bulkLoanReschedule('Approve')">
|
||||
<fa-icon icon="check" class="m-r-10"></fa-icon>Approve
|
||||
</button>
|
||||
<button mat-raised-button color="reject" *mifosxHasPermission="'APPROVE_LOANRESCHEDULE'"
|
||||
(click)="bulkLoanReschedule('Reject')">
|
||||
<fa-icon icon="times" class="m-r-10"></fa-icon>Reject
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,4 +72,4 @@
|
||||
No pending rescheduled loan available for this account.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+11
-8
@@ -79,37 +79,40 @@ export class RescheduleLoanComponent implements OnInit {
|
||||
return `${this.selection.isSelected(row) ? 'deselect' : 'select'} row ${row.position + 1}`;
|
||||
}
|
||||
|
||||
approveBulkLoanReschedule() {
|
||||
bulkLoanReschedule(action: string) {
|
||||
const rescheduleLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
data: { heading: 'Reschedule Loan', dialogContext: 'Are you sure you want to Reschedule Loan' }
|
||||
data: { heading: 'Reschedule Loan', dialogContext: 'Are you sure you want to ' + action + ' the Reschedule Loan' }
|
||||
});
|
||||
rescheduleLoanDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
|
||||
if (response.confirm) {
|
||||
this.bulkLoanRescheduleApproval();
|
||||
this.bulkLoanRescheduleRequest(action.toLowerCase());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bulkLoanRescheduleApproval() {
|
||||
bulkLoanRescheduleRequest(command: string) {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const approvedOnDate = this.dateUtils.formatDate(new Date(), dateFormat);
|
||||
const transactionDate = this.dateUtils.formatDate(this.settingsService.businessDate, dateFormat);
|
||||
const locale = this.settingsService.language.code;
|
||||
const formData = {
|
||||
dateFormat,
|
||||
approvedOnDate,
|
||||
locale
|
||||
};
|
||||
if (command === 'approve') {
|
||||
formData['approvedOnDate'] = transactionDate;
|
||||
} else {
|
||||
formData['rejectedOnDate'] = transactionDate;
|
||||
}
|
||||
const listSelectedAccounts = this.selection.selected;
|
||||
this.batchRequests = [];
|
||||
let reqId = 1;
|
||||
listSelectedAccounts.forEach((element: any) => {
|
||||
const url = 'rescheduleloans/' + element.id + '?command=approve';
|
||||
const url = 'rescheduleloans/' + element.id + '?command=' + command;
|
||||
const bodyData = JSON.stringify(formData);
|
||||
const batchData = { requestId: reqId++, relativeUrl: url, method: 'POST', body: bodyData };
|
||||
this.batchRequests.push(batchData);
|
||||
});
|
||||
this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
|
||||
console.log(response);
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="1%" fxLayout.lt-md="column" class="container m-b-20">
|
||||
<button mat-raised-button color="success" (click)="approveChecker()">
|
||||
<fa-icon icon="check"></fa-icon> Approve
|
||||
<fa-icon icon="check" class="m-r-10"></fa-icon>Approve
|
||||
</button>
|
||||
<button mat-raised-button color="warn" (click)="deleteChecker()">
|
||||
<fa-icon icon="trash"></fa-icon> Delete
|
||||
<fa-icon icon="trash" class="m-r-10"></fa-icon>Delete
|
||||
</button>
|
||||
<button mat-raised-button color="reject" (click)="rejectChecker()">
|
||||
<fa-icon icon="times"></fa-icon> Reject
|
||||
<fa-icon icon="times" class="m-r-10"></fa-icon>Reject
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user