Account Transaction tab homologation

This commit is contained in:
Jose Alberto Hernandez
2024-06-02 17:42:45 -06:00
committed by Jose Alberto Hernandez
parent d55f799c0b
commit c4d0eac2e3
8 changed files with 77 additions and 51 deletions
@@ -17,37 +17,49 @@
<ng-container matColumnDef="row">
<th mat-header-cell *matHeaderCellDef> # </th>
<td mat-cell *matCellDef="let idx = index;">{{(idx + 1)}}</td>
<td mat-cell *matCellDef="let transaction; let idx = index;" (click)="showTransactions(transaction)">{{(idx + 1)}}</td>
</ng-container>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.ID" | translate }} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)"> {{ transaction.id }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.id }}
</td>
</ng-container>
<ng-container matColumnDef="transactionDate">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Transaction Date" | translate }} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" > {{ transaction.date | dateFormat }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.date | dateFormat }}
</td>
</ng-container>
<ng-container matColumnDef="transactionType">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Transaction Type" | translate }} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" > {{ transaction.transactionType.value }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.transactionType.value }}
</td>
</ng-container>
<ng-container matColumnDef="debit">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Debit" | translate }} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" > {{ isDebit(transaction.transactionType) ? transaction.amount : 'N/A'}} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ isDebit(transaction.transactionType) ? transaction.amount : 'N/A'}}
</td>
</ng-container>
<ng-container matColumnDef="credit">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Credit" | translate }} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" > {{ !isDebit(transaction.transactionType) ? transaction.amount : 'N/A' }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ !isDebit(transaction.transactionType) ? transaction.amount : 'N/A' }}
</td>
</ng-container>
<ng-container matColumnDef="balance">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Balance" | translate }} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" > {{ transaction.runningBalance }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.runningBalance }}
</td>
</ng-container>
<ng-container matColumnDef="actions">
@@ -18,9 +18,6 @@
margin: 0 2%;
line-height: 25px;
}
.select-row:hover {
cursor: pointer;
}
.strike {
text-decoration: line-through;
color: $status-active-overdue;
@@ -33,3 +30,8 @@
}
}
}
.select-row:hover {
cursor: pointer;
font-weight: 800;
}
@@ -17,7 +17,7 @@
<ng-container matColumnDef="row">
<th mat-header-cell *matHeaderCellDef> # </th>
<td mat-cell *matCellDef="let idx = index;">{{(idx + 1)}}</td>
<td mat-cell *matCellDef="let transaction; let idx = index;" (click)="showTransactions(transaction)">{{(idx + 1)}}</td>
</ng-container>
<ng-container matColumnDef="id">
@@ -27,29 +27,37 @@
<ng-container matColumnDef="transactionDate">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Transaction Date" | translate }} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)"> {{ transaction.date | dateFormat }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.date | dateFormat }}
</td>
</ng-container>
<ng-container matColumnDef="transactionType">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Transaction Type" | translate }} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)"> {{ transaction.transactionType.value }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.transactionType.value }}
</td>
</ng-container>
<ng-container matColumnDef="debit">
<th mat-header-cell *matHeaderCellDef class="center"> {{"labels.inputs.Debit" | translate }} </th>
<td mat-cell *matCellDef="let transaction" class="r-amount" [ngClass]="savingsTransactionColor(transaction)">
{{ isDebit(transaction.transactionType) ? transaction.amount : 'N/A'}} </td>
<td mat-cell *matCellDef="let transaction" class="r-amount" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ isDebit(transaction.transactionType) ? transaction.amount : 'N/A'}}
</td>
</ng-container>
<ng-container matColumnDef="credit">
<th mat-header-cell *matHeaderCellDef class="center"> {{"labels.inputs.Credit" | translate }} </th>
<td mat-cell *matCellDef="let transaction" class="r-amount" [ngClass]="savingsTransactionColor(transaction)">
{{ !isDebit(transaction.transactionType) ? transaction.amount : 'N/A' }} </td>
<td mat-cell *matCellDef="let transaction" class="r-amount" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ !isDebit(transaction.transactionType) ? transaction.amount : 'N/A' }}
</td>
</ng-container>
<ng-container matColumnDef="balance">
<th mat-header-cell *matHeaderCellDef class="center"> {{"labels.inputs.Balance" | translate }} </th>
<td mat-cell *matCellDef="let transaction" class="r-amount" [ngClass]="savingsTransactionColor(transaction)"> {{ transaction.runningBalance | formatNumber }} </td>
<td mat-cell *matCellDef="let transaction" class="r-amount" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.runningBalance | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="actions">
@@ -20,8 +20,10 @@
padding-top: 1%;
}
}
.select-row:hover {
cursor: pointer;
}
}
}
.select-row:hover {
cursor: pointer;
font-weight: 800;
}
@@ -150,7 +150,7 @@ export class EditLoansAccountComponent implements OnInit {
if (loansAccountData.interestCalculationPeriodType === 0) {
loansAccountData.allowPartialPeriodInterestCalcualtion = false;
}
if (!(loansAccountData.isFloatingInterestRate === false)) {
if (!loansAccountData.isLoanProductLinkedToFloatingRate || loansAccountData.isLoanProductLinkedToFloatingRate === false) {
delete loansAccountData.isFloatingInterestRate;
}
loansAccountData.principal = loansAccountData.principalAmount;
@@ -81,7 +81,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
if (this.loansAccountProductTemplate.overdueCharges) {
this.overDueChargesDataSource = this.loansAccountProductTemplate.overdueCharges;
}
if (this.loansAccountProductTemplate.charges) {
if (this.loansAccountProductTemplate.charges && this.loansAccountProductTemplate.charges.length > 0 && this.chargesDataSource.length === 0) {
this.chargesDataSource = this.loansAccountProductTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || [];
}
}
@@ -8,25 +8,20 @@
<button mat-raised-button color="primary" class="transaction-button" [routerLink]="['export']">
{{"labels.buttons.Export" | translate}}
</button>
<!--
<button mat-raised-button color="primary" class="transaction-button">
{{"labels.buttons.View Journal Entries" | translate}}
</button>
-->
</div>
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="row">
<td mat-cell *matCellDef="let idx = index;">{{(idx + 1)}}</td>
<td mat-cell *matCellDef="let transaction; let idx = index;" (click)="showTransactions(transaction)">{{(idx + 1)}}</td>
</ng-container>
<ng-container matColumnDef="id">
<td mat-cell *matCellDef="let transaction" class="td-select" [ngClass]="loanTransactionColor(transaction)">{{ transaction.id }}</td>
<td mat-cell *matCellDef="let transaction" class="td-select" [ngClass]="loanTransactionColor(transaction)" (click)="showTransactions(transaction)">{{ transaction.id }}</td>
</ng-container>
<ng-container matColumnDef="office">
<td mat-cell *matCellDef="let transaction" [ngClass]="loanTransactionColor(transaction)">{{ transaction.officeName }}</td>
<td mat-cell *matCellDef="let transaction" [ngClass]="loanTransactionColor(transaction)" (click)="showTransactions(transaction)">{{ transaction.officeName }}</td>
</ng-container>
<ng-container matColumnDef="externalId">
@@ -36,40 +31,40 @@
</ng-container>
<ng-container matColumnDef="date">
<td mat-cell *matCellDef="let transaction" [ngClass]="loanTransactionColor(transaction)"> {{ transaction.date | dateFormat }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="loanTransactionColor(transaction)" (click)="showTransactions(transaction)"> {{ transaction.date | dateFormat }} </td>
</ng-container>
<ng-container matColumnDef="transactionType">
<td mat-cell *matCellDef="let transaction" [ngClass]="loanTransactionColor(transaction)"> {{ transaction.type.value }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="loanTransactionColor(transaction)" (click)="showTransactions(transaction)"> {{ transaction.type.value }} </td>
</ng-container>
<ng-container matColumnDef="amount">
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction"
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction" (click)="showTransactions(transaction)"
[ngClass]="loanTransactionColor(transaction)"> {{ transaction.amount | formatNumber }} </td>
</ng-container>
<ng-container matColumnDef="principal">
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction"
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction" (click)="showTransactions(transaction)"
[ngClass]="loanTransactionColor(transaction)"> {{ transaction.principalPortion | formatNumber }} </td>
</ng-container>
<ng-container matColumnDef="interest">
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction"
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction" (click)="showTransactions(transaction)"
[ngClass]="loanTransactionColor(transaction)"> {{ transaction.interestPortion | formatNumber }} </td>
</ng-container>
<ng-container matColumnDef="fee">
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction"
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction" (click)="showTransactions(transaction)"
[ngClass]="loanTransactionColor(transaction)"> {{ transaction.feeChargesPortion | formatNumber }} </td>
</ng-container>
<ng-container matColumnDef="penalties">
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction"
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction" (click)="showTransactions(transaction)"
[ngClass]="loanTransactionColor(transaction)"> {{ transaction.penaltyChargesPortion | formatNumber }} </td>
</ng-container>
<ng-container matColumnDef="loanBalance">
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction"
<td mat-cell class="r-amount td-min-space" *matCellDef="let transaction" (click)="showTransactions(transaction)"
[ngClass]="loanTransactionColor(transaction)"> {{ transaction.outstandingLoanBalance | formatNumber }} </td>
</ng-container>
@@ -189,7 +184,7 @@
<tr mat-header-row *matHeaderRowDef="displayedHeader1Columns"></tr>
<tr mat-header-row *matHeaderRowDef="displayedHeader2Columns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row" (click)="showTransactions(row)"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row"></tr>
</table>
@@ -10,9 +10,6 @@
{{"labels.inputs.Hide Reversed" | translate}}</mat-checkbox>
<mat-checkbox [formControl]="hideAccrualsParam" (click)="hideAccruals()" class="accruals">
{{"labels.inputs.Hide Accruals" | translate}}</mat-checkbox>
<!--
<button mat-raised-button color="primary" [routerLink]="['/accounting', 'journal-entries']">View Journal Entries</button>
-->
<button mat-raised-button color="primary" [routerLink]="['export']">{{"labels.buttons.Export" | translate}}</button>
</div>
</div>
@@ -21,17 +18,19 @@
<ng-container matColumnDef="row">
<th mat-header-cell *matHeaderCellDef mat-sort-header> # </th>
<td mat-cell *matCellDef="let idx = index;">{{(idx + 1)}}</td>
<td mat-cell *matCellDef="let transaction; let idx = index;" (click)="showTransactions(transaction)">{{(idx + 1)}}</td>
</ng-container>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Id" | translate}} </th>
<td mat-cell *matCellDef="let transaction" class="td-select" [ngClass]="savingsTransactionColor(transaction)"> {{ transaction.id }} </td>
<td mat-cell *matCellDef="let transaction" class="td-select" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)"> {{ transaction.id }} </td>
</ng-container>
<ng-container matColumnDef="date">
<th mat-header-cell class="center" *matHeaderCellDef mat-sort-header> {{"labels.inputs.Transaction Date" | translate}} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)"> {{ transaction.date | dateFormat }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.date | dateFormat }}
</td>
</ng-container>
<ng-container matColumnDef="externalId">
@@ -43,22 +42,30 @@
<ng-container matColumnDef="transactionType">
<th mat-header-cell class="center" *matHeaderCellDef> {{"labels.inputs.Transaction Type" | translate}} </th>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)"> {{ transaction.transactionType.value | translateCatalog }} </td>
<td mat-cell *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.transactionType.value | translateCatalog }}
</td>
</ng-container>
<ng-container matColumnDef="debit">
<th mat-header-cell class="r-amount" *matHeaderCellDef> {{"labels.inputs.Debit" | translate}} </th>
<td mat-cell class="r-amount" *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)"> {{ isDebit(transaction.transactionType) ? (transaction.amount | formatNumber) : 'N/A'}} </td>
<td mat-cell class="r-amount" *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ isDebit(transaction.transactionType) ? (transaction.amount | formatNumber) : 'N/A'}}
</td>
</ng-container>
<ng-container matColumnDef="credit">
<th mat-header-cell class="r-amount" *matHeaderCellDef> {{"labels.inputs.Credit" | translate}} </th>
<td mat-cell class="r-amount" *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)"> {{ !isDebit(transaction.transactionType) ? (transaction.amount | formatNumber) : 'N/A' }} </td>
<td mat-cell class="r-amount" *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ !isDebit(transaction.transactionType) ? (transaction.amount | formatNumber) : 'N/A' }}
</td>
</ng-container>
<ng-container matColumnDef="balance">
<th mat-header-cell class="r-amount" *matHeaderCellDef> {{"labels.inputs.Balance" | translate}} </th>
<td mat-cell class="r-amount" *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)"> {{ transaction.runningBalance | formatNumber }} </td>
<td mat-cell class="r-amount" *matCellDef="let transaction" [ngClass]="savingsTransactionColor(transaction)" (click)="showTransactions(transaction)">
{{ transaction.runningBalance | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="actions">
@@ -89,7 +96,7 @@
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row" (click)="showTransactions(row)"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row"></tr>
</table>