Fix phpstan errors

This commit is contained in:
James Cole
2023-11-26 12:24:37 +01:00
parent 938446ede3
commit 846c60fb85
10 changed files with 48 additions and 36 deletions

View File

@@ -197,7 +197,7 @@ class CreditRecalculateService
$startOfDebt = $this->repository->getOpeningBalanceAmount($account) ?? '0';
$leftOfDebt = app('steam')->positive($startOfDebt);
$currency = $this->repository->getAccountCurrency($account);
$decimals = (int)($currency?->decimal_places ?? 2);
$decimals = $currency?->decimal_places ?? 2;
app('log')->debug(sprintf('Start of debt is "%s", so initial left of debt is "%s"', app('steam')->bcround($startOfDebt, $decimals), app('steam')->bcround($leftOfDebt, $decimals)));
/** @var AccountMetaFactory $factory */
@@ -274,7 +274,7 @@ class CreditRecalculateService
$foreignCurrency = $transaction->foreignCurrency;
$accountCurrency = $this->repository->getAccountCurrency($account);
$groupId = $journal->transaction_group_id;
$decimals = (int)$accountCurrency->decimal_places;
$decimals = $accountCurrency->decimal_places;
$type = $journal->transactionType->type;
/** @var Transaction $destTransaction */
$destTransaction = $journal->transactions()->where('amount', '>', '0')->first();