Fix logs.

This commit is contained in:
James Cole
2024-01-21 15:00:51 +01:00
parent 1a6fe5ca3c
commit 80a35692c5

View File

@@ -317,14 +317,14 @@ class CreditRecalculateService
if ($isSameAccount && $isDebit && $this->isWithdrawalIn($usedAmount, $type)) { // case 6 if ($isSameAccount && $isDebit && $this->isWithdrawalIn($usedAmount, $type)) { // case 6
$usedAmount = app('steam')->positive($usedAmount); $usedAmount = app('steam')->positive($usedAmount);
$result = bcsub($leftOfDebt, $usedAmount); $result = bcsub($leftOfDebt, $usedAmount);
app('log')->debug(sprintf('Case 6 (withdrawal into debit liability): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); app('log')->debug(sprintf('Case 6 (withdrawal into debit liability): %s - %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2)));
return $result; return $result;
} }
if ($isSameAccount && $isDebit && $this->isDepositOut($usedAmount, $type)) { // case 7 if ($isSameAccount && $isDebit && $this->isDepositOut($usedAmount, $type)) { // case 7
$usedAmount = app('steam')->positive($usedAmount); $usedAmount = app('steam')->positive($usedAmount);
$result = bcadd($leftOfDebt, $usedAmount); $result = bcadd($leftOfDebt, $usedAmount);
app('log')->debug(sprintf('Case 7 (deposit away from liability): %s - %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2))); app('log')->debug(sprintf('Case 7 (deposit away from liability): %s + %s = %s', app('steam')->bcround($leftOfDebt, 2), app('steam')->bcround($usedAmount, 2), app('steam')->bcround($result, 2)));
return $result; return $result;
} }