From 04553f6fc5d80335cfd53edd547cfee242197d8c Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 3 Jan 2026 14:46:39 +0100 Subject: [PATCH] Fix #11443 --- app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php b/app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php index 4a97d262a6..60bf82b7c4 100644 --- a/app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php +++ b/app/Support/JsonApi/Enrichments/SubscriptionEnrichment.php @@ -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; }