Skip to content

Firefly III: a personal finances manager

Fix https://github.com/firefly-iii/firefly-iii/issues/6260

James Colee8ec13ca5f95
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index 9fc2ac0ed5..f0277b97c1 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -438,7 +438,7 @@ class BillRepository implements BillRepositoryInterface
//Log::debug(sprintf('Dates = %d, journalCount = %d, total = %d', $dates->count(), $count, $total));
if ($total > 0) {
- $average = bcdiv(bcadd($bill->amount_max, $bill->amount_min), '2');
+ $average = bcdiv(bcadd((string) $bill->amount_max, (string) $bill->amount_min), '2');
$multi = bcmul($average, (string) $total);
$return[$currencyId] = $return[$currencyId] ?? '0';
$return[$currencyId] = bcadd($return[$currencyId], $multi);
diff --git a/app/Transformers/TransactionGroupTransformer.php b/app/Transformers/TransactionGroupTransformer.php
index 895e348dda..b60fab159b 100644
--- a/app/Transformers/TransactionGroupTransformer.php
+++ b/app/Transformers/TransactionGroupTransformer.php
@@ -352,7 +352,7 @@ class TransactionGroupTransformer extends AbstractTransformer
$source = $this->getSourceTransaction($journal);
$destination = $this->getDestinationTransaction($journal);
$type = $journal->transactionType->type;
- $amount = $this->getAmount($type, $source->amount);
+ $amount = $this->getAmount($type, (string) $source->amount);
$foreignAmount = $this->getForeignAmount($type, $source->foreign_amount);
$metaFieldData = $this->groupRepos->getMetaFields($journal->id, $this->metaFields);
$metaDates = $this->getDates($this->groupRepos->getMetaDateFields($journal->id, $this->metaDateFields));