Return currency info for tag journals

This commit is contained in:
Khoa Nguyen
2026-03-03 09:05:36 +01:00
parent 7d8dc21722
commit 5f171e36ab

View File

@@ -95,6 +95,14 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
$array[$currencyId]['tags'][$tagId]['transaction_journals'][$journalId] = [
'amount' => Steam::negative($journal['amount']),
'currency_id' => (int) $journal['currency_id'],
'currency_name' => (string) $journal['currency_name'],
'currency_symbol' => (string) $journal['currency_symbol'],
'currency_code' => (string) $journal['currency_code'],
'currency_decimal_places' => (int) $journal['currency_decimal_places'],
'foreign_currency_id' => (int) ($journal['foreign_currency_id'] ?? 0),
'foreign_amount' => isset($journal['foreign_amount']) ? Steam::negative((string) $journal['foreign_amount']) : null,
'pc_amount' => isset($journal['pc_amount']) ? Steam::negative((string) $journal['pc_amount']) : null,
'date' => $journal['date'],
'source_account_id' => $journal['source_account_id'],
'budget_name' => $journal['budget_name'],
@@ -172,6 +180,14 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
$journalId = (int) $journal['transaction_journal_id'];
$array[$currencyId]['tags'][$tagId]['transaction_journals'][$journalId] = [
'amount' => Steam::positive($journal['amount']),
'currency_id' => (int) $journal['currency_id'],
'currency_name' => (string) $journal['currency_name'],
'currency_symbol' => (string) $journal['currency_symbol'],
'currency_code' => (string) $journal['currency_code'],
'currency_decimal_places' => (int) $journal['currency_decimal_places'],
'foreign_currency_id' => (int) ($journal['foreign_currency_id'] ?? 0),
'foreign_amount' => isset($journal['foreign_amount']) ? Steam::positive((string) $journal['foreign_amount']) : null,
'pc_amount' => isset($journal['pc_amount']) ? Steam::positive((string) $journal['pc_amount']) : null,
'date' => $journal['date'],
'source_account_id' => $journal['source_account_id'],
'budget_name' => $journal['budget_name'],