Fix issues in account actions (#1599)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2022-12-18 13:06:03 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent 1da2630974
commit eae1b350b7
52 changed files with 335 additions and 298 deletions
+1 -1
View File
@@ -78,7 +78,7 @@
</tr>
</table>
<mat-paginator [length]="dataSource?.records$ | async" [pageSize]="10" [pageSizeOptions]="[10, 25, 50, 100]"
<mat-paginator [length]="dataSource?.records$ | async" [pageSize]="100" [pageSizeOptions]="[10, 25, 50, 100]"
showFirstLastButtons></mat-paginator>
</div>
@@ -190,7 +190,7 @@
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
<button type="button" mat-raised-button [routerLink]="['../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!editClientForm.valid" (click)="submit()">Submit</button>
</mat-card-actions>
@@ -159,6 +159,17 @@ export class BreadcrumbComponent implements OnInit, AfterViewInit {
url = currentUrl;
}
}
if (url !== undefined) {
if (url.length > 8 && url.search(`/clients/`) > 0 ) {
const replaceGeneral = `/general/`;
let currentUrlTemp = url.replace(replaceGeneral, `/`);
currentUrlTemp = currentUrlTemp.replace(`//`, `/`);
currentUrlTemp += `/general`;
const replaceDoubleSlash = `/general/general`;
currentUrlTemp = currentUrlTemp.replace(replaceDoubleSlash, `/general`);
url = currentUrlTemp;
}
}
const breadcrumb: Breadcrumb = {
label: breadcrumbLabel,
@@ -14,63 +14,63 @@ import { LoansService } from '../loans.service';
@Injectable()
export class LoanActionButtonResolver implements Resolve<Object> {
/**
* @param {LoansService} LoansService Loans service.
*/
constructor(private loansService: LoansService) { }
/**
* @param {LoansService} LoansService Loans service.
*/
constructor(private loansService: LoansService) { }
/**
* Returns the Loans Notes Data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId');
const loanActionButton = route.paramMap.get('action');
if (loanActionButton === 'Assign Loan Officer' || loanActionButton === 'Change Loan Officer') {
return this.loansService.getLoanTemplate(loanId);
} else if (loanActionButton === 'Make Repayment') {
return this.loansService.getLoanActionTemplate(loanId, 'repayment');
} else if (loanActionButton === 'Goodwill Credit') {
return this.loansService.getLoanActionTemplate(loanId, 'goodwillCredit');
} else if (loanActionButton === 'Payout Refund') {
return this.loansService.getLoanActionTemplate(loanId, 'payoutRefund');
} else if (loanActionButton === 'Merchant Issued Refund') {
return this.loansService.getLoanActionTemplate(loanId, 'merchantIssuedRefund');
} else if (loanActionButton === 'Credit Balance Refund') {
return this.loansService.getLoanActionTemplate(loanId, 'creditBalanceRefund');
} else if (loanActionButton === 'Waive Interest') {
return this.loansService.getLoanActionTemplate(loanId, 'waiveinterest');
} else if (loanActionButton === 'Write Off') {
return this.loansService.getLoanActionTemplate(loanId, 'writeoff');
} else if (loanActionButton === 'Close') {
return this.loansService.getLoanActionTemplate(loanId, 'close');
} else if (loanActionButton === 'Close (as Rescheduled)') {
return this.loansService.getLoanActionTemplate(loanId, 'close-rescheduled');
} else if (loanActionButton === 'Reschedule') {
return this.loansService.rescheduleLoanTemplate();
} else if (loanActionButton === 'Prepay Loan') {
return this.loansService.getLoanActionTemplate(loanId, 'prepayLoan');
} else if (loanActionButton === 'Add Collateral') {
return this.loansService.getLoanCollateralTemplate(loanId);
} else if (loanActionButton === 'Disburse to Savings') {
return this.loansService.getLoanActionTemplate(loanId, 'disburseToSavings');
} else if (loanActionButton === 'Recovery Payment') {
return this.loansService.getLoanActionTemplate(loanId, 'recoverypayment');
} else if (loanActionButton === 'View Guarantors') {
return this.loansService.getLoanAccountResource(loanId, 'guarantors');
} else if (loanActionButton === 'Create Guarantor') {
return this.loansService.getGuarantorTemplate(loanId);
} else if (loanActionButton === 'Disburse') {
return this.loansService.getLoanActionTemplate(loanId, 'disburse');
} else if (loanActionButton === 'Loan Screen Reports') {
return this.loansService.getLoanScreenReportsData();
} else if (loanActionButton === 'Approve') {
return this.loansService.getLoanApprovalTemplate(loanId);
} else if (loanActionButton === 'Add Loan Charge') {
return this.loansService.getLoanChargeTemplateResource(loanId);
} else {
return undefined;
}
/**
* Returns the Loans Notes Data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.parent.paramMap.get('loanId');
const loanActionButton = route.paramMap.get('action');
if (loanActionButton === 'Assign Loan Officer' || loanActionButton === 'Change Loan Officer') {
return this.loansService.getLoanTemplate(loanId);
} else if (loanActionButton === 'Make Repayment') {
return this.loansService.getLoanActionTemplate(loanId, 'repayment');
} else if (loanActionButton === 'Goodwill Credit') {
return this.loansService.getLoanActionTemplate(loanId, 'goodwillCredit');
} else if (loanActionButton === 'Payout Refund') {
return this.loansService.getLoanActionTemplate(loanId, 'payoutRefund');
} else if (loanActionButton === 'Merchant Issued Refund') {
return this.loansService.getLoanActionTemplate(loanId, 'merchantIssuedRefund');
} else if (loanActionButton === 'Credit Balance Refund') {
return this.loansService.getLoanActionTemplate(loanId, 'creditBalanceRefund');
} else if (loanActionButton === 'Waive Interest') {
return this.loansService.getLoanActionTemplate(loanId, 'waiveinterest');
} else if (loanActionButton === 'Write Off') {
return this.loansService.getLoanActionTemplate(loanId, 'writeoff');
} else if (loanActionButton === 'Close') {
return this.loansService.getLoanActionTemplate(loanId, 'close');
} else if (loanActionButton === 'Close (as Rescheduled)') {
return this.loansService.getLoanActionTemplate(loanId, 'close-rescheduled');
} else if (loanActionButton === 'Reschedule') {
return this.loansService.rescheduleLoanTemplate();
} else if (loanActionButton === 'Prepay Loan') {
return this.loansService.getLoanActionTemplate(loanId, 'prepayLoan');
} else if (loanActionButton === 'Add Collateral') {
return this.loansService.getLoanCollateralTemplate(loanId);
} else if (loanActionButton === 'Disburse to Savings') {
return this.loansService.getLoanActionTemplate(loanId, 'disburseToSavings');
} else if (loanActionButton === 'Recovery Payment') {
return this.loansService.getLoanActionTemplate(loanId, 'recoverypayment');
} else if (loanActionButton === 'View Guarantors') {
return this.loansService.getLoanAccountResource(loanId, 'guarantors');
} else if (loanActionButton === 'Create Guarantor') {
return this.loansService.getGuarantorTemplate(loanId);
} else if (loanActionButton === 'Disburse') {
return this.loansService.getLoanActionTemplate(loanId, 'disburse');
} else if (loanActionButton === 'Loan Screen Reports') {
return this.loansService.getLoanScreenReportsData();
} else if (loanActionButton === 'Approve') {
return this.loansService.getLoanApprovalTemplate(loanId);
} else if (loanActionButton === 'Add Loan Charge') {
return this.loansService.getLoanChargeTemplateResource(loanId);
} else {
return undefined;
}
}
}
@@ -9,8 +9,8 @@
<ng-container matColumnDef="feepenalty">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Fee/Penalty </th>
<td mat-cell *matCellDef="let charge">
<span *ngIf="charge.penalty">Penalty</span>
<td mat-cell *matCellDef="let charge">
<span *ngIf="charge.penalty">Penalty</span>
<span *ngIf="!charge.penalty">Fee</span>
</td>
</ng-container>
@@ -31,28 +31,28 @@
</ng-container>
<ng-container matColumnDef="due">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Due </th>
<td mat-cell *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amount| number }} </td>
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Due </th>
<td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amount| number }} </td>
</ng-container>
<ng-container matColumnDef="paid">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Paid </th>
<td mat-cell *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountPaid| number }} </td>
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Paid </th>
<td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountPaid| number }} </td>
</ng-container>
<ng-container matColumnDef="waived">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Waived </th>
<td mat-cell *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountWaived| number }} </td>
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Waived </th>
<td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountWaived| number }} </td>
</ng-container>
<ng-container matColumnDef="outstanding">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Outstanding </th>
<td mat-cell *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountOutstanding| number }} </td>
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Outstanding </th>
<td mat-cell class="r-amount" *matCellDef="let charge"> {{ charge.currency.displaySymbol }}{{ charge.amountOutstanding| number }} </td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Actions </th>
<td mat-cell *matCellDef="let charge">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header> Actions </th>
<td mat-cell class="center" *matCellDef="let charge">
<span *ngIf="status === 'Submitted and pending approval'">
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Edit Charge"
(click)="routeEdit($event); editCharge(charge)">
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -35,14 +35,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!collateralForm.valid"
*mifosxHasPermission="'CREATE_COLLATERAL'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!collateralForm.valid"
*mifosxHasPermission="'CREATE_COLLATERAL'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -50,14 +50,14 @@
</div>
<mat-card-actions fxLayoutGap="5px" fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!loanChargeForm.valid"
*mifosxHasPermission="'CREATE_LOANCHARGE'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayoutGap="5px" fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!loanChargeForm.valid"
*mifosxHasPermission="'CREATE_LOANCHARGE'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -47,14 +47,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!approveLoanForm.valid"
*mifosxHasPermission="'APPROVE_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!approveLoanForm.valid"
*mifosxHasPermission="'APPROVE_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -33,14 +33,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!assignOfficerForm.valid"
*mifosxHasPermission="'BULKREASSIGN_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!assignOfficerForm.valid"
*mifosxHasPermission="'BULKREASSIGN_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -26,14 +26,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!closeLoanForm.valid"
*mifosxHasPermission="'CLOSEASRESCHEDULED_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!closeLoanForm.valid"
*mifosxHasPermission="'CLOSEASRESCHEDULED_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -126,14 +126,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!newGuarantorForm.valid"
*mifosxHasPermission="'CREATE_GUARANTOR'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!newGuarantorForm.valid"
*mifosxHasPermission="'CREATE_GUARANTOR'">Submit</button>
</mat-card-actions>
</form>
<ng-container *ngIf="!(newGuarantorForm.controls.name === undefined)">
@@ -1,13 +1,13 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
<form [formGroup]="disbursementForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="column">
<mat-form-field (click)="disbursementDatePicker.open()">
<mat-label>Disbursement On</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="disbursementDatePicker" required
@@ -18,7 +18,7 @@
Disbursement Date is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Transaction amount</mat-label>
<input matInput required formControlName="transactionAmount">
@@ -26,7 +26,7 @@
Transaction Amount is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field *ngIf="dataObject.fixedEmiAmount !== null || dataObject.fixedEmiAmount !== undefined">
<mat-label>Fixed EMI amount</mat-label>
<input matInput required formControlName="fixedEmiAmount">
@@ -34,22 +34,22 @@
Fixed EMI Amount is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Note</mat-label>
<textarea matInput formControlName="note"></textarea>
</mat-form-field>
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!disbursementForm.valid"
*mifosxHasPermission="'DISBURSETOSAVINGS_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!disbursementForm.valid"
*mifosxHasPermission="'DISBURSETOSAVINGS_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -87,14 +87,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!disbursementLoanForm.valid"
*mifosxHasPermission="'DISBURSE_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!disbursementLoanForm.valid"
*mifosxHasPermission="'DISBURSE_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -51,14 +51,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!foreclosureForm.valid"
*mifosxHasPermission="'FORECLOSURE_LOAN'">Foreclosure</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!foreclosureForm.valid"
*mifosxHasPermission="'FORECLOSURE_LOAN'">Foreclosure</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -39,14 +39,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!creditBalanceLoanForm.valid"
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!creditBalanceLoanForm.valid"
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -92,14 +92,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!rescheduleLoanForm.valid"
*mifosxHasPermission="'APPROVE_RESCHEDULELOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!rescheduleLoanForm.valid"
*mifosxHasPermission="'APPROVE_RESCHEDULELOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,57 +1,57 @@
<div class="container m-b-20">
<mat-card>
<mat-card>
<form [formGroup]="loanScreenReportForm" (ngSubmit)="generate()">
<form [formGroup]="loanScreenReportForm" (ngSubmit)="generate()">
<mat-card-content>
<mat-card-content>
<div>
<div>
<mat-form-field fxFlex>
<mat-label>Loan Screen Reports</mat-label>
<mat-select formControlName="templateId">
<mat-option *ngFor="let template of templatesData" [value]="template.id">
{{ template.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="loanScreenReportForm.controls.templateId.hasError('required')">
Screen Report is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex>
<mat-label>Loan Screen Reports</mat-label>
<mat-select formControlName="templateId">
<mat-option *ngFor="let template of templatesData" [value]="template.id">
{{ template.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="loanScreenReportForm.controls.templateId.hasError('required')">
Screen Report is <strong>required</strong>
</mat-error>
</mat-form-field>
</div>
</div>
</mat-card-content>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!loanScreenReportForm.valid">
<fa-icon icon="cogs" size="sm"></fa-icon>&nbsp;&nbsp;Generate Report
</button>
</mat-card-actions>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!loanScreenReportForm.valid">
<fa-icon icon="cogs" size="sm"></fa-icon>&nbsp;&nbsp;Generate Report
</button>
</mat-card-actions>
</form>
</form>
</mat-card>
</mat-card>
</div>
<div #output class="container">
<mat-card fxLayout="column" fxLayoutGap="3%">
<mat-card fxLayout="column" fxLayoutGap="3%">
<div fxLayoutAlign="end">
<button mat-stroked-button color="primary" [disabled]="!template" (click)="print()">
<fa-icon icon="file"></fa-icon>&nbsp;&nbsp;
Print
</button>
</div>
<div fxLayoutAlign="end">
<button mat-stroked-button color="primary" [disabled]="!template" (click)="print()">
<fa-icon icon="file"></fa-icon>&nbsp;&nbsp;
Print
</button>
</div>
<div #screenReport class="screen-report">
<p>Please select a screen report.</p>
</div>
<div #screenReport class="screen-report">
<p>Please select a screen report.</p>
</div>
</mat-card>
</mat-card>
</div>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -26,14 +26,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!closeLoanForm.valid"
*mifosxHasPermission="'CLOSE_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!closeLoanForm.valid"
*mifosxHasPermission="'CLOSE_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -87,14 +87,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!repaymentLoanForm.valid"
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!repaymentLoanForm.valid"
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -100,14 +100,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!prepayLoanForm.valid"
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!prepayLoanForm.valid"
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -82,14 +82,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!recoveryRepaymentLoanForm.valid"
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!recoveryRepaymentLoanForm.valid"
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -26,14 +26,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!rejectLoanForm.valid"
*mifosxHasPermission="'REJECT_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!rejectLoanForm.valid"
*mifosxHasPermission="'REJECT_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,8 +1,8 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
<div class="viewGuarantors-account-tables" fxLayout="row" fxLayoutGap="2%">
<div class="view-guarantors-account-tables" fxLayout="row" fxLayoutGap="2%">
<div fxFlex="49%">
<table>
@@ -66,9 +66,9 @@
<div fxFlexFill *ngIf="guarantorDetails" fxLayout="row wrap" fxLayout.lt-md="column">
<!-- guarantors details table -->
<div class="headingContent">
<div class="heading-content">
<div fxLayout="column" fxFlex="50%">
<div class="headingName">
<div class="heading-name">
<h3>Guarantors Details</h3>
</div>
</div>
@@ -82,7 +82,6 @@
<table fxFlexFill mat-table
[dataSource]="guarantorDetails|accountsFilter:'guarantor':showDeletedGuarantorsAccounts">
<!-- <ng-container *ngIf="expression"> -->
<ng-container matColumnDef="fullname">
<th mat-header-cell *matHeaderCellDef> Name </th>
<td mat-cell *matCellDef="let guarantor">
@@ -165,15 +164,13 @@
</button>
<span *ngIf="guarantor.status">
<button mat-raised-button class="account-action-button" color="warn"
*mifosxHasPermission='"DELETE_GUARANTOR"' (click)="deleteGuarantor(guarantor.id)">
*mifosxHasPermission="'DELETE_GUARANTOR'" (click)="deleteGuarantor(guarantor.id)">
<fa-icon icon="trash"></fa-icon>&nbsp;&nbsp;
</button>
</span>
</span>
</td>
</ng-container>
<!-- </ng-container> -->
<tr mat-header-row *matHeaderRowDef="guarantorsDisplayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: guarantorsDisplayedColumns"></tr>
@@ -1,4 +1,4 @@
.viewGuarantors-account-tables {
.view-guarantors-account-tables {
padding: 1%;
margin: 1%;
.table-headers {
@@ -20,13 +20,13 @@ table {
}
}
.headingContent{
.heading-content{
margin-bottom: 1%;
margin-top: 1%;
width: 100%;
}
.headingName {
.heading-name {
display: block;
}
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -34,14 +34,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!loanInterestForm.valid"
*mifosxHasPermission="'WAIVEINTERESTPORTION_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!loanInterestForm.valid"
*mifosxHasPermission="'WAIVEINTERESTPORTION_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -26,14 +26,14 @@
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!withdrawnByClientLoanForm.valid"
*mifosxHasPermission="'WITHDRAW_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!withdrawnByClientLoanForm.valid"
*mifosxHasPermission="'WITHDRAW_LOAN'">Submit</button>
</mat-card-actions>
</form>
</mat-card>
@@ -1,10 +1,10 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
<mat-card-content>
<form [formGroup]="writeOffForm" (ngSubmit)="submit()">
<form [formGroup]="writeOffForm">
<div fxLayout="column">
@@ -33,14 +33,14 @@
</form>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" (click)="submit()"
*mifosxHasPermission="'WRITEOFF_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
<button mat-raised-button color="primary" (click)="submit()"
*mifosxHasPermission="'WRITEOFF_LOAN'">Submit</button>
</mat-card-actions>
</mat-card>
</div>
@@ -90,7 +90,7 @@ export class ViewChargeComponent {
dateFormat,
locale
};
this.loansService.executeLoansAccountChargesCommand(this.chargeData.loanId, 'paycharge', dataObject, this.chargeData.id)
this.loansService.executeLoansAccountChargesCommand(this.chargeData.loanId, 'pay', dataObject, this.chargeData.id)
.subscribe(() => {
this.reload();
});
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -80,10 +80,9 @@
</mat-card-actions>
</mat-card-content>
</form>
</mat-card>
</div>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -1,4 +1,4 @@
<div class="container">
<div class="container mat-elevation-z8">
<mat-card>
@@ -14,9 +14,9 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%" (click)="submittedOnDatePicker.open()">
<mat-form-field fxFlex="48%" (click)="submittedOnDatePicker.open()" *ngIf="savingsProductSelected">
<mat-label>Submitted On</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="submittedOnDatePicker"
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="submittedOnDatePicker"
formControlName="submittedOnDate" required>
<mat-datepicker-toggle matSuffix [for]="submittedOnDatePicker"></mat-datepicker-toggle>
<mat-datepicker #submittedOnDatePicker></mat-datepicker>
@@ -25,7 +25,7 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-form-field fxFlex="48%" *ngIf="savingsProductSelected">
<mat-label>Field Officer</mat-label>
<mat-select formControlName="fieldOfficerId">
<mat-option *ngFor="let officer of fieldOfficerData" [value]="officer.id">
@@ -34,7 +34,7 @@
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-form-field fxFlex="48%" *ngIf="savingsProductSelected">
<mat-label>External ID</mat-label>
<input matInput formControlName="externalId">
</mat-form-field>
@@ -32,6 +32,8 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
/** Savings Account Details Form */
savingsAccountDetailsForm: FormGroup;
savingsProductSelected = false;
/** Savings Account Template with product data */
@Output() savingsAccountProductTemplate = new EventEmitter();
@@ -88,6 +90,7 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
.subscribe((response: any) => {
this.savingsAccountProductTemplate.emit(response);
this.fieldOfficerData = response.fieldOfficerOptions;
this.savingsProductSelected = true;
if (!this.isFieldOfficerPatched && this.savingsAccountTemplate.fieldOfficerId) {
this.savingsAccountDetailsForm.get('fieldOfficerId').patchValue(this.savingsAccountTemplate.fieldOfficerId);
this.isFieldOfficerPatched = true;
@@ -16,7 +16,7 @@
<ng-container matColumnDef="value">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Value </th>
<td mat-cell *matCellDef="let configuration"> {{ configuration.value }} </td>
<td mat-cell *matCellDef="let configuration"> {{ getConfigurationValue(configuration) }} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@@ -49,4 +49,12 @@ export class AmazonS3Component implements OnInit {
this.dataSource.sort = this.sort;
}
getConfigurationValue(configuration: any): string {
const value = configuration.value;
if (configuration.name === 's3_access_key' || configuration.name === 's3_secret_key') {
return value.replace(value.substr(1, value.length - 3), value.substr(1, value.length - 3).replace(/./g, '*'));
}
return value;
}
}
@@ -8,14 +8,6 @@
<div fxLayout="column">
<mat-form-field>
<mat-label>S3 Access Key</mat-label>
<input matInput required formControlName="s3_access_key">
<mat-error *ngIf="amazonS3ConfigurationForm.controls.s3_access_key.hasError('required')">
S3 Access Key is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>S3 Bucket Name</mat-label>
<input matInput required formControlName="s3_bucket_name">
@@ -24,9 +16,27 @@
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>S3 Access Key</mat-label>
<input matInput required type="{{ accessKeyInputType }}" formControlName="s3_access_key">
<button mat-button *ngIf="amazonS3ConfigurationForm.controls.s3_access_key.value" matSuffix mat-icon-button
(mousedown)="accessKeyInputType = 'text'" (mouseup)="accessKeyInputType = 'password'">
<fa-icon *ngIf="accessKeyInputType === 'password'" icon="eye"></fa-icon>
<fa-icon *ngIf="accessKeyInputType === 'text'" icon="eye-slash"></fa-icon>
</button>
<mat-error *ngIf="amazonS3ConfigurationForm.controls.s3_access_key.hasError('required')">
S3 Access Key is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>S3 Secret Key</mat-label>
<input matInput required formControlName="s3_secret_key">
<input matInput required type="{{ secretKeyInputType }}" formControlName="s3_secret_key">
<button mat-button *ngIf="amazonS3ConfigurationForm.controls.s3_secret_key.value" matSuffix mat-icon-button
(mousedown)="secretKeyInputType = 'text'" (mouseup)="secretKeyInputType = 'password'">
<fa-icon *ngIf="secretKeyInputType === 'password'" icon="eye"></fa-icon>
<fa-icon *ngIf="secretKeyInputType === 'text'" icon="eye-slash"></fa-icon>
</button>
<mat-error *ngIf="amazonS3ConfigurationForm.controls.s3_secret_key.hasError('required')">
S3 Secret Key is <strong>required</strong>
</mat-error>
@@ -20,6 +20,10 @@ export class EditAmazonS3Component implements OnInit {
amazonS3ConfigurationData: any;
/** Amazon S3 Configuration Form */
amazonS3ConfigurationForm: FormGroup;
/** Secret Key input field type. */
secretKeyInputType: string;
/** Access Key field type. */
accessKeyInputType: string;
/**
* Retrieves the Amazon S3 configuration data from `resolve`.
@@ -42,6 +46,8 @@ export class EditAmazonS3Component implements OnInit {
*/
ngOnInit() {
this.createAmazonS3ConfigurationForm();
this.secretKeyInputType = 'password';
this.accessKeyInputType = 'password';
}
/**
@@ -49,8 +55,8 @@ export class EditAmazonS3Component implements OnInit {
*/
createAmazonS3ConfigurationForm() {
this.amazonS3ConfigurationForm = this.formBuilder.group({
's3_access_key': [this.amazonS3ConfigurationData[0].value, Validators.required],
's3_bucket_name': [this.amazonS3ConfigurationData[1].value, Validators.required],
's3_access_key': [this.amazonS3ConfigurationData[0].value, Validators.required],
's3_secret_key': [this.amazonS3ConfigurationData[2].value, Validators.required]
});
}
@@ -65,7 +65,7 @@
<mat-form-field fxFlex="98%">
<mat-label>SQL</mat-label>
<textarea matInput required formControlName="reportSql"></textarea>
<textarea matInput required formControlName="reportSql" cdkTextareaAutosize cdkAutosizeMinRows="6"></textarea>
<mat-error *ngIf="reportForm.controls.reportSql.hasError('required')">
SQL is <strong>required</strong>
</mat-error>
@@ -2,16 +2,17 @@
.user-report-wrapper {
position: relative;
.user-report {
padding: 0 0 17.5px 0;
position: absolute;
bottom: 0;
}
}
}
table {
width: 100%;
margin-top: 20px;
}
@@ -64,7 +64,7 @@
<mat-form-field fxFlex="98%">
<mat-label>SQL</mat-label>
<textarea matInput required formControlName="reportSql"></textarea>
<textarea matInput required formControlName="reportSql" cdkTextareaAutosize cdkAutosizeMinRows="6"></textarea>
<mat-error *ngIf="reportForm.controls.reportSql.hasError('required')">
SQL is <strong>required</strong>
</mat-error>
@@ -32,11 +32,11 @@
{{ reportData.reportType }}
</div>
<div fxFlex="50%" class="mat-body-strong">
<div *ngIf="reportData.reportSubType" fxFlex="50%" class="mat-body-strong">
Report Subtype:
</div>
<div fxFlex="50%">
<div *ngIf="reportData.reportSubType" fxFlex="50%">
{{ reportData.reportSubType }}
</div>
@@ -69,3 +69,5 @@
</mat-card-content>
</mat-card>
</div>