mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Add debug for #2662
This commit is contained in:
@@ -104,8 +104,16 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
$savedSoFar = (string)$this->getRepetition($piggyBank)->currentamount;
|
||||
$leftToSave = bcsub($piggyBank->targetamount, $savedSoFar);
|
||||
$maxAmount = (string)min(round($leftOnAccount, 12), round($leftToSave, 12));
|
||||
$compare = bccomp($amount, $maxAmount);
|
||||
$result = $compare <= 0;
|
||||
|
||||
Log::debug(sprintf('Left on account: %s', $leftOnAccount));
|
||||
Log::debug(sprintf('Saved so far: %s', $savedSoFar));
|
||||
Log::debug(sprintf('Left to save: %s', $leftToSave));
|
||||
Log::debug(sprintf('Maximum amount: %s', $maxAmount));
|
||||
Log::debug(sprintf('Compare <= 0? %d, so %s', $compare, var_export($result, true)));
|
||||
|
||||
return bccomp($amount, $maxAmount) <= 0;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user