GL view transaction enhanced (#1645)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-01-17 15:02:32 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent d714eee1a7
commit b6c5f0e41e
11 changed files with 51 additions and 24 deletions
@@ -55,7 +55,7 @@
</div>
<div class="mat-elevation-z8 container">
<div class="mat-elevation-z8 container" fxLayoutAlign="center" fxLayout="row wrap">
<table mat-table [dataSource]="dataSource" matSort>
@@ -80,13 +80,13 @@
</ng-container>
<ng-container matColumnDef="debit">
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Debit </th>
<td mat-cell class="r-amount" *matCellDef="let transaction"><span *ngIf="transaction.entryType.value === 'DEBIT'"> {{ (transaction.currency.displaySymbol || transaction.currency.code) + ' ' + transaction.amount }} </span></td>
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header> Debit </th>
<td mat-cell class="r-amount" *matCellDef="let transaction"><span *ngIf="transaction.entryType.value === 'DEBIT'"> {{ (transaction.currency.displaySymbol || transaction.currency.code) }} {{ transaction.amount | number }} </span></td>
</ng-container>
<ng-container matColumnDef="credit">
<th mat-header-cell class="r-amount" *matHeaderCellDef mat-sort-header> Credit </th>
<td mat-cell class="r-amount" *matCellDef="let transaction"><span *ngIf="transaction.entryType.value === 'CREDIT'"> {{ (transaction.currency.displaySymbol || transaction.currency.code) + ' ' + transaction.amount }} </span></td>
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header> Credit </th>
<td mat-cell class="r-amount" *matCellDef="let transaction"><span *ngIf="transaction.entryType.value === 'CREDIT'"> {{ (transaction.currency.displaySymbol || transaction.currency.code) }} {{ transaction.amount | number }} </span></td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
@@ -94,9 +94,8 @@
</table>
<mat-paginator [pageSizeOptions]="[5, 10]" showFirstLastButtons></mat-paginator>
<div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="2%" fxLayout.lt-md="column">
<div fxLayoutAlign="center" fxLayoutGap="2%" fxLayout.lt-md="column" class="action-bar">
<button type="button" color="primary" mat-raised-button (click)="goBack()">Back</button>
</div>
</div>
@@ -13,9 +13,16 @@
}
table {
width: 100%;
width: 98%;
.select-row:hover {
cursor: pointer;
}
}
.action-bar {
width: 98%;
align-items: center;
padding-top: 15px;
padding-bottom: 15px;
}
@@ -67,7 +67,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
}
ngOnInit() {
if (this.loansAccountTemplate.charges) {
if (this.loansAccountTemplate && this.loansAccountTemplate.charges) {
this.chargesDataSource = this.loansAccountTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || [];
}
}
@@ -81,6 +81,9 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
if (this.loansAccountProductTemplate.overdueCharges) {
this.overDueChargesDataSource = this.loansAccountProductTemplate.overdueCharges;
}
if (this.loansAccountProductTemplate.charges) {
this.chargesDataSource = this.loansAccountProductTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || [];
}
}
}
@@ -21,7 +21,7 @@ export class CreateTaxComponentComponent implements OnInit {
/** Minimum start date allowed. */
minDate = new Date();
/** Maximum start date allowed. */
maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + 10));
maxDate = new Date();
/** Tax Component form. */
taxComponentForm: FormGroup;
/** Tax Component template data. */
@@ -59,6 +59,8 @@ export class CreateTaxComponentComponent implements OnInit {
* Creates the tax Component form
*/
ngOnInit() {
this.minDate = this.settingsService.minAllowedDate;
this.maxDate = this.settingsService.maxAllowedDate;
this.createTaxComponentForm();
this.setConditionalControls();
}
@@ -22,21 +22,21 @@
<mat-error *ngIf="taxComponentForm.controls.name.hasError('required')">
Percentage is <strong>required</strong>
</mat-error>
</mat-form-field>
</mat-form-field>
<mat-form-field *ngIf="taxComponentData.creditAccountType.value">
<mat-label>Credit Account Type</mat-label>
<input matInput formControlName="creditAccountType">
</mat-form-field>
</mat-form-field>
<mat-form-field *ngIf="taxComponentData.creditAccount.name">
<mat-label>Credit Account</mat-label>
<input matInput formControlName="creditAccount">
</mat-form-field>
</mat-form-field>
<mat-form-field (click)="startDatePicker.open()">
<mat-label>Start Date</mat-label>
<input matInput [min]="minDate" [matDatepicker]="startDatePicker" required formControlName="startDate">
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="startDatePicker" required formControlName="startDate">
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
<mat-datepicker #startDatePicker></mat-datepicker>
<mat-error *ngIf="taxComponentForm.controls.startDate.hasError('required')">
@@ -20,6 +20,8 @@ export class EditTaxComponentComponent implements OnInit {
/** Minimum date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum start date allowed. */
maxDate = new Date();
/** Tax Component form. */
taxComponentForm: FormGroup;
/** Tax Component data. */
@@ -49,6 +51,8 @@ export class EditTaxComponentComponent implements OnInit {
* Creates the edit tax component form.
*/
ngOnInit() {
this.minDate = this.settingsService.minAllowedDate;
this.maxDate = this.settingsService.maxAllowedDate;
this.editTaxComponent();
}
@@ -26,7 +26,7 @@
</div>
<div fxFlex="50%">
{{ taxComponentData.percentage }}
{{ taxComponentData.percentage | number }} %
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.debitAccountType">
@@ -73,6 +73,9 @@
</mat-card-content>
<div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="2%" fxLayout.lt-md="column">
<button type="button" color="primary" mat-raised-button [routerLink]="['../']">Back</button>
</div>
</mat-card>
</div>
+8
View File
@@ -18,6 +18,7 @@ export class SettingsService {
public static businessDateConfigName = 'enable_business_date';
public static businessDateType = 'BUSINESS_DATE';
public static cobDateType = 'COB_DATE';
minAllowedDate = new Date(1950, 0, 1);
maxAllowedDate = new Date(2100, 0, 1);
constructor(private alertService: AlertService,
@@ -150,6 +151,13 @@ export class SettingsService {
return localStorage.getItem('mifosXServerBusinessDateEnabled');
}
/**
* Returns min Past date
*/
get minPastDate(): Date {
return this.minAllowedDate;
}
/**
* Returns max Future date
*/
@@ -1,12 +1,13 @@
export const appTableData: { displayValue: string, value: string }[] = [
{ displayValue: 'Client', value: 'm_client' },
{ displayValue: 'Group', value: 'm_group' },
{ displayValue: 'Loan', value: 'm_loan' },
{ displayValue: 'Center', value: 'm_center' },
{ displayValue: 'Office', value: 'm_office' },
{ displayValue: 'Loan Account', value: 'm_loan' },
{ displayValue: 'Saving Account', value: 'm_savings_account' },
{ displayValue: 'Product Loan', value: 'm_product_loan' },
{ displayValue: 'Savings Product', value: 'm_savings_product' }
{ displayValue: 'Loan Product', value: 'm_product_loan' },
{ displayValue: 'Savings Product', value: 'm_savings_product' },
{ displayValue: 'Share Product', value: 'm_share_product' }
];
export const entitySubTypeData: { displayValue: string, value: string }[] = [
+3 -3
View File
@@ -19,7 +19,7 @@
.r-amount {
text-align: right !important;
padding-right: 5px;
padding-right: 5px !important;
}
.right {
@@ -31,9 +31,9 @@
}
.amount-plus {
color: #000000;
color: $black;
}
.amount-minus {
color: #0f36e4;
color: $status-approved;
}
+1 -1
View File
@@ -1,7 +1,7 @@
@import "align";
@import "background";
@import "border";
@import "colours";
@import "align";
@import "display";
@import "float";
@import "form";