James Cole
2024-01-06 14:44:50 +01:00
parent c19b36a391
commit f615b9c252

View File

@@ -196,7 +196,8 @@ class CreditRecalculateService
$transactions = $account->transactions()
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
->orderBy('transaction_journals.date', 'ASC')
->get(['transactions.*']);
->get(['transactions.*'])
;
$total = $transactions->count();
app('log')->debug(sprintf('Found %d transaction(s) to process.', $total));
@@ -339,6 +340,7 @@ class CreditRecalculateService
$usedAmount = app('steam')->positive($usedAmount);
$result = bcadd($leftOfDebt, $usedAmount);
app('log')->debug(sprintf('Case 9 (transfer into debit liability, means you owe more): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2)));
return $result;
}
if ($isSameAccount && $isDebit && $this->isTransferOut($usedAmount, $type)) { // case 10