diff --git a/src/app/loans/create-loans-account/create-loans-account.component.html b/src/app/loans/create-loans-account/create-loans-account.component.html index 4327f7517..758c96baa 100644 --- a/src/app/loans/create-loans-account/create-loans-account.component.html +++ b/src/app/loans/create-loans-account/create-loans-account.component.html @@ -58,7 +58,7 @@ REPAYMENT SCHEDULE + [loansAccountProductTemplate]="loansAccountProductTemplate" [loansAccount]="loansAccount" [currencyCode]="currencyCode"> diff --git a/src/app/loans/create-loans-account/create-loans-account.component.ts b/src/app/loans/create-loans-account/create-loans-account.component.ts index ef1905caf..4872a3619 100644 --- a/src/app/loans/create-loans-account/create-loans-account.component.ts +++ b/src/app/loans/create-loans-account/create-loans-account.component.ts @@ -41,6 +41,8 @@ export class CreateLoansAccountComponent implements OnInit { /** Principal Amount */ principal: any; datatables: any = []; + /** Currency Code */ + currencyCode: string; /** * Sets loans account create form. @@ -70,6 +72,7 @@ export class CreateLoansAccountComponent implements OnInit { */ setTemplate($event: any) { this.loansAccountProductTemplate = $event; + this.currencyCode = this.loansAccountProductTemplate.currency.code; const clientId = this.loansAccountTemplate.clientId; this.clientService.getCollateralTemplate(clientId).subscribe((response: any) => { this.collateralOptions = response; diff --git a/src/app/loans/edit-loans-account/edit-loans-account.component.html b/src/app/loans/edit-loans-account/edit-loans-account.component.html index 2f3aa9448..e4f0fb4bf 100644 --- a/src/app/loans/edit-loans-account/edit-loans-account.component.html +++ b/src/app/loans/edit-loans-account/edit-loans-account.component.html @@ -57,7 +57,8 @@ REPAYMENT SCHEDULE + [loansAccountProductTemplate]="loansAccountProductTemplate" [loansAccount]="loansAccount" + [currencyCode]="currencyCode"> diff --git a/src/app/loans/edit-loans-account/edit-loans-account.component.ts b/src/app/loans/edit-loans-account/edit-loans-account.component.ts index ab15c62dd..d8397e4ba 100644 --- a/src/app/loans/edit-loans-account/edit-loans-account.component.ts +++ b/src/app/loans/edit-loans-account/edit-loans-account.component.ts @@ -30,6 +30,8 @@ export class EditLoansAccountComponent implements OnInit { collateralOptions: any; /** Loan Id */ loanId: any; + /** Currency Code */ + currencyCode: string; /** * Sets loans account edit form. @@ -60,6 +62,7 @@ export class EditLoansAccountComponent implements OnInit { */ setTemplate($event: any) { this.loansAccountProductTemplate = $event; + this.currencyCode = this.loansAccountProductTemplate.currency.code; if (this.loansAccountProductTemplate.loanProductId) { this.loansService.getLoansCollateralTemplateResource(this.loansAccountProductTemplate.loanProductId).subscribe((response: any) => { this.collateralOptions = response.loanCollateralOptions; diff --git a/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.html b/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.html index ac6c990ec..765da2ef8 100644 --- a/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.html +++ b/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.html @@ -4,7 +4,10 @@ Repayment Info - + + diff --git a/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.ts index 83dcfce93..58e8415b2 100644 --- a/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.ts @@ -10,6 +10,8 @@ import { SettingsService } from 'app/settings/settings.service'; }) export class LoansAccountScheduleStepComponent implements OnInit { + /** Currency Code */ + @Input() currencyCode: string; /** Loans Account Template */ @Input() loansAccountTemplate: any; /** Loans Account Product Template */ diff --git a/src/app/loans/loans-view/charges-tab/charges-tab.component.html b/src/app/loans/loans-view/charges-tab/charges-tab.component.html index b82b64b23..79bac5f5f 100644 --- a/src/app/loans/loans-view/charges-tab/charges-tab.component.html +++ b/src/app/loans/loans-view/charges-tab/charges-tab.component.html @@ -32,26 +32,26 @@ Due - {{ charge.currency.displaySymbol }} {{ charge.amount| - number }} + {{ charge.amount | + currency:charge.currency.code:'symbol-narrow':'1.2-2' }} Paid - {{ charge.currency.displaySymbol }}{{ charge.amountPaid| - number }} + {{ charge.amountPaid | + currency:charge.currency.code:'symbol-narrow':'1.2-2' }} Waived - {{ charge.currency.displaySymbol }}{{ charge.amountWaived| - number }} + {{ charge.amountWaived | + currency:charge.currency.code:'symbol-narrow':'1.2-2' }} Outstanding - {{ charge.currency.displaySymbol }}{{ - charge.amountOutstanding| formatNumber }} + {{charge.amountOutstanding | + currency:charge.currency.code:'symbol-narrow':'1.2-2' }} diff --git a/src/app/loans/loans-view/general-tab/general-tab.component.html b/src/app/loans/loans-view/general-tab/general-tab.component.html index c39d9ce46..ff12c2e6b 100644 --- a/src/app/loans/loans-view/general-tab/general-tab.component.html +++ b/src/app/loans/loans-view/general-tab/general-tab.component.html @@ -36,37 +36,37 @@ Original - {{ ele.original | currency }} + {{ ele.original | currency:currencyCode:'symbol-narrow':'1.2-2' }} Paid - {{ ele.paid | currency }} + {{ ele.paid | currency:currencyCode:'symbol-narrow':'1.2-2' }} Credit Adjustments - {{ ele.adjustment | currency }} + {{ ele.adjustment | currency:currencyCode:'symbol-narrow':'1.2-2' }} Waived - {{ ele.waived | currency }} + {{ ele.waived | currency:currencyCode:'symbol-narrow':'1.2-2' }} Written Off - {{ ele.writtenOff | currency }} + {{ ele.writtenOff | currency:currencyCode:'symbol-narrow':'1.2-2' }} Outstanding - {{ ele.outstanding | currency }} + {{ ele.outstanding | currency:currencyCode:'symbol-narrow':'1.2-2' }} Over Due - {{ ele.overdue | currency }} + {{ ele.overdue | currency:currencyCode:'symbol-narrow':'1.2-2' }} @@ -193,17 +193,17 @@
Proposed Amount: - {{ loanDetails.proposedPrincipal | currency}} + {{ loanDetails.proposedPrincipal | currency:currencyCode:'symbol-narrow':'1.2-2'}}
Approved Amount: - {{ loanDetails.approvedPrincipal | currency }} + {{ loanDetails.approvedPrincipal | currency:currencyCode:'symbol-narrow':'1.2-2' }}
Disburse Amount: - {{ loanDetails.principal | currency }} + {{ loanDetails.principal | currency:currencyCode:'symbol-narrow':'1.2-2' }}
diff --git a/src/app/loans/loans-view/general-tab/general-tab.component.ts b/src/app/loans/loans-view/general-tab/general-tab.component.ts index 9c7a48d3f..b4b844619 100644 --- a/src/app/loans/loans-view/general-tab/general-tab.component.ts +++ b/src/app/loans/loans-view/general-tab/general-tab.component.ts @@ -9,6 +9,8 @@ import { MatTableDataSource } from '@angular/material/table'; }) export class GeneralTabComponent implements OnInit { + /** Currency Code */ + currencyCode: string; loanDetails: any; status: any; loanSummaryColumns: string[] = ['Empty', 'Original', 'Paid', 'Waived', 'Written Off', 'Outstanding', 'Over Due']; @@ -35,6 +37,7 @@ export class GeneralTabComponent implements OnInit { constructor(private route: ActivatedRoute) { this.route.parent.data.subscribe((data: { loanDetailsData: any, }) => { this.loanDetails = data.loanDetailsData; + this.currencyCode = this.loanDetails.currency.code; if (this.loanDetails.transactions) { this.loanDetails.transactions.some((transaction: any) => { if (transaction.type.code === 'loanTransactionType.chargeback') { @@ -67,7 +70,6 @@ export class GeneralTabComponent implements OnInit { 'writtenOff': this.loanDetails.summary.principalWrittenOff, 'outstanding': this.loanDetails.summary.principalOutstanding, 'overdue': this.loanDetails.summary.principalOverdue, - }, { 'property': 'Interest', diff --git a/src/app/loans/loans-view/loans-view.component.html b/src/app/loans/loans-view/loans-view.component.html index 83e6d6b9e..fbc9a0760 100644 --- a/src/app/loans/loans-view/loans-view.component.html +++ b/src/app/loans/loans-view/loans-view.component.html @@ -32,11 +32,11 @@ - Past Due Days : {{loanDetailsData?.delinquent.pastDueDays | formatNumber}}
+ Past Due Days : {{loanDetailsData?.delinquent.pastDueDays | formatNumber }}
- Delinquent Days : {{loanDetailsData?.delinquent.delinquentDays | formatNumber}} + Delinquent Days : {{loanDetailsData?.delinquent.delinquentDays | formatNumber }}
@@ -46,14 +46,14 @@ Current Balance: {{loanDetailsData.currency.displaySymbol}} {{loanDetailsData.summary.totalOutstanding | formatNumber}}
- Arrears By: {{loanDetailsData.summary.totalOverdue | formatNumber}} + Arrears By: {{loanDetailsData.summary.totalOverdue | currency:currencyCode:'symbol-narrow':'1.2-2' }} Not Provided
Arrears Since: {{loanDetailsData.summary.overdueSinceDate | dateFormat}} - Overpaid By: {{loanDetailsData.currency.displaySymbol}} {{loanDetailsData.totalOverpaid | formatNumber}} + Overpaid By: {{loanDetailsData.currency.displaySymbol}} {{loanDetailsData.totalOverpaid | formatNumber }}
diff --git a/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.html b/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.html index 5d2dae441..77a5395f3 100644 --- a/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.html +++ b/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.html @@ -43,56 +43,56 @@ Principal Due {{ ele.principalDue | formatNumber }} - {{ repaymentScheduleDetails.totalPrincipalExpected | currency }} + {{ repaymentScheduleDetails.totalPrincipalExpected | currency:currencyCode:'symbol-narrow':'1.2-2' }} Interest {{ ele.interestOriginalDue | formatNumber}} - {{ repaymentScheduleDetails.totalInterestCharged | currency }} + {{ repaymentScheduleDetails.totalInterestCharged | currency:currencyCode:'symbol-narrow':'1.2-2' }} Fees {{ ele.feeChargesDue | formatNumber}} - {{ repaymentScheduleDetails.totalFeeChargesCharged | currency }} + {{ repaymentScheduleDetails.totalFeeChargesCharged | currency:currencyCode:'symbol-narrow':'1.2-2' }} Penalties {{ ele.penaltyChargesDue | formatNumber}} - {{ repaymentScheduleDetails.totalPenaltyChargesCharged | currency }} + {{ repaymentScheduleDetails.totalPenaltyChargesCharged | currency:currencyCode:'symbol-narrow':'1.2-2' }} Due {{ ele.totalDueForPeriod | formatNumber}} - {{ repaymentScheduleDetails.totalRepaymentExpected | currency }} + {{ repaymentScheduleDetails.totalRepaymentExpected | currency:currencyCode:'symbol-narrow':'1.2-2' }} Paid {{ ele.totalPaidForPeriod | formatNumber}} - {{ repaymentScheduleDetails.totalRepayment | currency }} + {{ repaymentScheduleDetails.totalRepayment | currency:currencyCode:'symbol-narrow':'1.2-2' }} In advance {{ ele.totalPaidInAdvanceForPeriod | formatNumber}} - {{ repaymentScheduleDetails.totalPaidInAdvance | currency }} + {{ repaymentScheduleDetails.totalPaidInAdvance | currency:currencyCode:'symbol-narrow':'1.2-2' }} Late {{ ele.totalPaidLateForPeriod | formatNumber}} - {{ repaymentScheduleDetails.totalPaidLate | currency }} + {{ repaymentScheduleDetails.totalPaidLate | currency:currencyCode:'symbol-narrow':'1.2-2' }} Waived {{ ele.totalWaivedForPeriod | formatNumber}} - {{ repaymentScheduleDetails.totalWaived | currency }} + {{ repaymentScheduleDetails.totalWaived | currency:currencyCode:'symbol-narrow':'1.2-2' }} @@ -107,7 +107,7 @@ Outstanding {{ ele.totalOutstandingForPeriod | formatNumber}} - {{ repaymentScheduleDetails.totalOutstanding | currency }} + {{ repaymentScheduleDetails.totalOutstanding | currency:currencyCode:'symbol-narrow':'1.2-2' }} @@ -159,19 +159,19 @@ Principal Due {{ ele.principalDue | formatNumber }} - {{ repaymentScheduleDetails.totalPrincipalExpected | currency }} + {{ repaymentScheduleDetails.totalPrincipalExpected | currency:currencyCode:'symbol-narrow':'1.2-2' }} Interest {{ ele.interestOriginalDue | formatNumber}} - {{ repaymentScheduleDetails.totalInterestCharged | currency }} + {{ repaymentScheduleDetails.totalInterestCharged | currency:currencyCode:'symbol-narrow':'1.2-2' }} Fees {{ ele.feeChargesDue | formatNumber}} - {{ repaymentScheduleDetails.totalFeeChargesCharged | currency }} + {{ repaymentScheduleDetails.totalFeeChargesCharged | currency:currencyCode:'symbol-narrow':'1.2-2' }} @@ -184,7 +184,7 @@ {{ ele.totalDueForPeriod | formatNumber}} - {{ repaymentScheduleDetails.totalRepaymentExpected | currency }} + {{ repaymentScheduleDetails.totalRepaymentExpected | currency:currencyCode:'symbol-narrow':'1.2-2' }} diff --git a/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.ts b/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.ts index 1e9ab8a52..98b7adc73 100644 --- a/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.ts +++ b/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.ts @@ -8,6 +8,8 @@ import { ActivatedRoute } from '@angular/router'; }) export class RepaymentScheduleTabComponent implements OnInit { + /** Currency Code */ + @Input() currencyCode: string; /** Loan Repayment Schedule to be Edited */ @Input() forEditing = false; /** Loan Repayment Schedule Details Data */ @@ -30,6 +32,9 @@ export class RepaymentScheduleTabComponent implements OnInit { */ constructor(private route: ActivatedRoute) { this.route.parent.data.subscribe((data: { loanDetailsData: any }) => { + if (data.loanDetailsData) { + this.currencyCode = data.loanDetailsData.currency.code; + } this.loanDetailsDataRepaymentSchedule = data.loanDetailsData ? data.loanDetailsData.repaymentSchedule : []; }); } diff --git a/src/app/products/charges/edit-charge/edit-charge.component.ts b/src/app/products/charges/edit-charge/edit-charge.component.ts index 300927a6f..8cf5340d1 100644 --- a/src/app/products/charges/edit-charge/edit-charge.component.ts +++ b/src/app/products/charges/edit-charge/edit-charge.component.ts @@ -123,9 +123,9 @@ export class EditChargeComponent implements OnInit { } } if (this.chargeData.taxGroup) { - this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: this.chargeData.taxGroup.id, disabled: true }, Validators.required)); + this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: this.chargeData.taxGroup.id }, Validators.required)); } else { - this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: '', disabled: true })); + this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: '' })); } } diff --git a/src/app/savings/savings-account-view/charges-tab/charges-tab.component.html b/src/app/savings/savings-account-view/charges-tab/charges-tab.component.html index a0a7f0c6f..41dde3af3 100644 --- a/src/app/savings/savings-account-view/charges-tab/charges-tab.component.html +++ b/src/app/savings/savings-account-view/charges-tab/charges-tab.component.html @@ -46,22 +46,22 @@ Due - {{charge.currency.displaySymbol}} {{charge.amount}} + {{charge.amount | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} Paid - {{charge.currency.displaySymbol}} {{charge.amountPaid}} + {{charge.amountPaid | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} Waived - {{charge.currency.displaySymbol}} {{charge.amountWaived}} + {{charge.amountWaived | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} Outstanding - {{charge.currency.displaySymbol}} {{charge.amountOutstanding}} + {{charge.amountOutstanding | currency:charge.currency.code:'symbol-narrow':'1.2-2'}} diff --git a/src/app/savings/savings-account-view/savings-account-view.component.html b/src/app/savings/savings-account-view/savings-account-view.component.html index 1ae3d21d9..9a65ae47a 100644 --- a/src/app/savings/savings-account-view/savings-account-view.component.html +++ b/src/app/savings/savings-account-view/savings-account-view.component.html @@ -81,46 +81,38 @@ Total Withdrawls - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.summary.totalWithdrawals | - number}} + {{savingsAccountData.summary.totalWithdrawals | currency:currencyCode:'symbol-narrow':'1.2-2'}} Withdrawals Fees - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.summary.totalWithdrawalFees | - number}} + {{savingsAccountData.summary.totalWithdrawalFees | currency:currencyCode:'symbol-narrow':'1.2-2'}} Annual Fees - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.summary.totalAnnualFees | - number}} + {{savingsAccountData.summary.totalAnnualFees | currency:currencyCode:'symbol-narrow':'1.2-2'}} Interest Earned - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.summary.totalInterestEarned | - number}} + {{savingsAccountData.summary.totalInterestEarned | currency:currencyCode:'symbol-narrow':'1.2-2'}} Interest Posted - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.summary.totalInterestPosted | - number}} + {{savingsAccountData.summary.totalInterestPosted | currency:currencyCode:'symbol-narrow':'1.2-2'}} Interest Earned Not Posted - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.summary.interestNotPosted | - number}} + {{savingsAccountData.summary.interestNotPosted | currency:currencyCode:'symbol-narrow':'1.2-2'}} Interest On Overdraft - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.summary.totalOverdraftInterestDerived - | formatNumber}} + {{savingsAccountData.summary.totalOverdraftInterestDerived | currency:currencyCode:'symbol-narrow':'1.2-2'}} Overdraft Interest Not Posted - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.summary.interestNotPosted | - number}} + {{savingsAccountData.summary.interestNotPosted | currency:currencyCode:'symbol-narrow':'1.2-2'}} - + Nominal Interest Rate {{savingsAccountData.nominalAnnualInterestRate | formatNumber}} % @@ -142,8 +134,7 @@ Withdrawal Fee - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.withdrawalFee.amount | - number}} + {{savingsAccountData.withdrawalFee.amount | currency:currencyCode:'symbol-narrow':'1.2-2'}} Last Active Transaction Date @@ -167,16 +158,16 @@ Annual Fee - {{savingsAccountData.currency.displaySymbol}} {{savingsAccountData.annualFee.amount | formatNumber}} + {{savingsAccountData.annualFee.amount | currency:currencyCode:'symbol-narrow':'1.2-2'}} Over Draft Limit - {{savingsAccountData.overdraftLimit | formatNumber}} + {{savingsAccountData.overdraftLimit | currency:currencyCode:'symbol-narrow':'1.2-2'}} Min Overdraft Required for Interest Calculation - {{savingsAccountData.minOverdraftForInterestCalculation | formatNumber}} + {{savingsAccountData.minOverdraftForInterestCalculation | currency:currencyCode:'symbol-narrow':'1.2-2'}} Min Balance Required for Interest Calculation @@ -196,7 +187,7 @@ On Hold Funds - {{savingsAccountData.onHoldFunds | formatNumber}} + {{savingsAccountData.onHoldFunds | currency:currencyCode:'symbol-narrow':'1.2-2'}} Withhold Tax Group diff --git a/src/app/savings/savings-account-view/savings-account-view.component.ts b/src/app/savings/savings-account-view/savings-account-view.component.ts index 9701e702c..af3c4b769 100644 --- a/src/app/savings/savings-account-view/savings-account-view.component.ts +++ b/src/app/savings/savings-account-view/savings-account-view.component.ts @@ -34,6 +34,7 @@ export class SavingsAccountViewComponent implements OnInit { entityType: string; isActive = false; + currencyCode: string; /** * Fetches savings account data from `resolve` @@ -47,6 +48,7 @@ export class SavingsAccountViewComponent implements OnInit { public dialog: MatDialog) { this.route.data.subscribe((data: { savingsAccountData: any, savingsDatatables: any }) => { this.savingsAccountData = data.savingsAccountData; + this.currencyCode = this.savingsAccountData.currency.code; this.savingsDatatables = data.savingsDatatables; }); if (this.router.url.includes('clients')) {