mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-09 20:11:22 +00:00
Fix #11443
This commit is contained in:
@@ -321,7 +321,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
||||
$array['foreign_currency_code'] = $entry->foreign_currency_code;
|
||||
$array['foreign_currency_symbol'] = $entry->foreign_currency_symbol;
|
||||
$array['foreign_currency_decimal_places'] = $entry->foreign_currency_decimal_places;
|
||||
$array['foreign_amount'] = Steam::bcround($entry->foreign_amount, $entry->foreign_currency_decimal_places);
|
||||
$array['foreign_amount'] = Steam::bcround((string) $entry->foreign_amount, $entry->foreign_currency_decimal_places);
|
||||
}
|
||||
// convert to primary, but is already primary.
|
||||
if ($this->convertToPrimary && (int)$entry->transaction_currency_id === $this->primaryCurrency->id) {
|
||||
@@ -329,7 +329,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
||||
}
|
||||
// convert to primary, but is NOT already primary.
|
||||
if ($this->convertToPrimary && (int)$entry->transaction_currency_id !== $this->primaryCurrency->id) {
|
||||
$array['pc_amount'] = $converter->convert($entry->transactionCurrency, $this->primaryCurrency, $entry->date, $entry->amount);
|
||||
$array['pc_amount'] = $converter->convert($entry->transactionCurrency, $this->primaryCurrency, $entry->date, (string) $entry->amount);
|
||||
}
|
||||
// convert to primary, but foreign is already primary.
|
||||
if ($this->convertToPrimary && (int)$entry->foreign_currency_id === $this->primaryCurrency->id) {
|
||||
@@ -340,7 +340,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
||||
// TODO this is very database intensive.
|
||||
/** @var TransactionCurrency $foreignCurrency */
|
||||
$foreignCurrency = Amount::getTransactionCurrencyById($entry->foreign_currency_id);
|
||||
$array['pc_foreign_amount'] = $converter->convert($foreignCurrency, $this->primaryCurrency, $entry->date, $entry->amount);
|
||||
$array['pc_foreign_amount'] = $converter->convert($foreignCurrency, $this->primaryCurrency, $entry->date, (string) $entry->amount);
|
||||
}
|
||||
$result[] = $array;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user