@@ -118,30 +118,58 @@ export function useReconciliationStatementPageBase() {
118118 } ) ;
119119
120120 const displayTotalInflows = computed < string > ( ( ) => {
121- return formatAmountToLocalizedNumeralsWithCurrency ( reconciliationStatements . value ?. totalInflows ?? 0 , currentAccountCurrency . value ) ;
121+ return formatAmount ( reconciliationStatements . value ?. totalInflows ?? 0 , false , currentAccountCurrency . value ) ;
122+ } ) ;
123+
124+ const displayTotalInflowsInDefaultCurrency = computed < string > ( ( ) => {
125+ return formatAmount ( reconciliationStatements . value ?. totalInflows ?? 0 , false , currentAccountCurrency . value , true ) ;
122126 } ) ;
123127
124128 const displayTotalOutflows = computed < string > ( ( ) => {
125- return formatAmountToLocalizedNumeralsWithCurrency ( reconciliationStatements . value ?. totalOutflows ?? 0 , currentAccountCurrency . value ) ;
129+ return formatAmount ( reconciliationStatements . value ?. totalOutflows ?? 0 , false , currentAccountCurrency . value ) ;
130+ } ) ;
131+
132+ const displayTotalOutflowsInDefaultCurrency = computed < string > ( ( ) => {
133+ return formatAmount ( reconciliationStatements . value ?. totalOutflows ?? 0 , false , currentAccountCurrency . value , true ) ;
126134 } ) ;
127135
128136 const displayTotalBalance = computed < string > ( ( ) => {
129- return formatAmountToLocalizedNumeralsWithCurrency ( ( reconciliationStatements ?. value ?. totalInflows ?? 0 ) - ( reconciliationStatements . value ?. totalOutflows ?? 0 ) , currentAccountCurrency . value ) ;
137+ return formatAmount ( ( reconciliationStatements ?. value ?. totalInflows ?? 0 ) - ( reconciliationStatements . value ?. totalOutflows ?? 0 ) , false , currentAccountCurrency . value ) ;
138+ } ) ;
139+
140+ const displayTotalBalanceInDefaultCurrency = computed < string > ( ( ) => {
141+ return formatAmount ( ( reconciliationStatements ?. value ?. totalInflows ?? 0 ) - ( reconciliationStatements . value ?. totalOutflows ?? 0 ) , false , currentAccountCurrency . value , true ) ;
130142 } ) ;
131143
132144 const displayOpeningBalance = computed < string > ( ( ) => {
133145 if ( isCurrentLiabilityAccount . value ) {
134- return formatAmountToLocalizedNumeralsWithCurrency ( - ( reconciliationStatements ?. value ?. openingBalance ?? 0 ) , currentAccountCurrency . value ) ;
146+ return formatAmount ( - ( reconciliationStatements ?. value ?. openingBalance ?? 0 ) , false , currentAccountCurrency . value ) ;
147+ } else {
148+ return formatAmount ( reconciliationStatements ?. value ?. openingBalance ?? 0 , false , currentAccountCurrency . value ) ;
149+ }
150+ } ) ;
151+
152+ const displayOpeningBalanceInDefaultCurrency = computed < string > ( ( ) => {
153+ if ( isCurrentLiabilityAccount . value ) {
154+ return formatAmount ( - ( reconciliationStatements ?. value ?. openingBalance ?? 0 ) , false , currentAccountCurrency . value , true ) ;
135155 } else {
136- return formatAmountToLocalizedNumeralsWithCurrency ( reconciliationStatements ?. value ?. openingBalance ?? 0 , currentAccountCurrency . value ) ;
156+ return formatAmount ( reconciliationStatements ?. value ?. openingBalance ?? 0 , false , currentAccountCurrency . value , true ) ;
137157 }
138158 } ) ;
139159
140160 const displayClosingBalance = computed < string > ( ( ) => {
141161 if ( isCurrentLiabilityAccount . value ) {
142- return formatAmountToLocalizedNumeralsWithCurrency ( - ( reconciliationStatements ?. value ?. closingBalance ?? 0 ) , currentAccountCurrency . value ) ;
162+ return formatAmount ( - ( reconciliationStatements ?. value ?. closingBalance ?? 0 ) , false , currentAccountCurrency . value ) ;
163+ } else {
164+ return formatAmount ( reconciliationStatements ?. value ?. closingBalance ?? 0 , false , currentAccountCurrency . value ) ;
165+ }
166+ } ) ;
167+
168+ const displayClosingBalanceInDefaultCurrency = computed < string > ( ( ) => {
169+ if ( isCurrentLiabilityAccount . value ) {
170+ return formatAmount ( - ( reconciliationStatements ?. value ?. closingBalance ?? 0 ) , false , currentAccountCurrency . value , true ) ;
143171 } else {
144- return formatAmountToLocalizedNumeralsWithCurrency ( reconciliationStatements ?. value ?. closingBalance ?? 0 , currentAccountCurrency . value ) ;
172+ return formatAmount ( reconciliationStatements ?. value ?. closingBalance ?? 0 , false , currentAccountCurrency . value , true ) ;
145173 }
146174 } ) ;
147175
@@ -245,7 +273,7 @@ export function useReconciliationStatementPageBase() {
245273 return formatAmount ( transaction . destinationAmount , transaction . hideAmount , transaction . destinationAccount ?. currency ?? defaultCurrency . value , inDefaultCurrency ) ;
246274 }
247275
248- function getDisplayAccountBalance ( transaction : TransactionReconciliationStatementResponseItemWithInfo ) : string {
276+ function getDisplayAccountBalance ( transaction : TransactionReconciliationStatementResponseItemWithInfo , inDefaultCurrency ?: boolean ) : string {
249277 let currency = defaultCurrency . value ;
250278 let isLiabilityAccount = false ;
251279
@@ -260,9 +288,9 @@ export function useReconciliationStatementPageBase() {
260288 }
261289
262290 if ( isLiabilityAccount ) {
263- return formatAmountToLocalizedNumeralsWithCurrency ( - transaction . accountClosingBalance , currency ) ;
291+ return formatAmount ( - transaction . accountClosingBalance , false , currency , inDefaultCurrency ) ;
264292 } else {
265- return formatAmountToLocalizedNumeralsWithCurrency ( transaction . accountClosingBalance , currency ) ;
293+ return formatAmount ( transaction . accountClosingBalance , false , currency , inDefaultCurrency ) ;
266294 }
267295 }
268296
@@ -355,10 +383,15 @@ export function useReconciliationStatementPageBase() {
355383 displayStartDateTime,
356384 displayEndDateTime,
357385 displayTotalInflows,
386+ displayTotalInflowsInDefaultCurrency,
358387 displayTotalOutflows,
388+ displayTotalOutflowsInDefaultCurrency,
359389 displayTotalBalance,
390+ displayTotalBalanceInDefaultCurrency,
360391 displayOpeningBalance,
392+ displayOpeningBalanceInDefaultCurrency,
361393 displayClosingBalance,
394+ displayClosingBalanceInDefaultCurrency,
362395 // functions
363396 updatePageOpenTime,
364397 setReconciliationStatements,
0 commit comments