mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 18:01:26 -06:00
This commit is contained in:
parent
a258b35236
commit
3d1233314a
@ -36,10 +36,8 @@ use Log;
|
||||
*/
|
||||
class TransactionGroupFactory
|
||||
{
|
||||
/** @var TransactionJournalFactory */
|
||||
private $journalFactory;
|
||||
/** @var User The user */
|
||||
private $user;
|
||||
private TransactionJournalFactory $journalFactory;
|
||||
private User $user;
|
||||
|
||||
/**
|
||||
* TransactionGroupFactory constructor.
|
||||
|
@ -238,6 +238,13 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
Log::debug(sprintf('The currency is %s and the amount is %s', $currency->code, $amount));
|
||||
$room = bcsub((string) $piggyBank->targetamount, (string) $repetition->currentamount);
|
||||
$compare = bcmul($repetition->currentamount, '-1');
|
||||
|
||||
if(bccomp((string) $piggyBank->targetamount,'0') === 0) {
|
||||
// amount is zero? then the "room" is positive amount of we wish to add or remove.
|
||||
$room = app('steam')->positive($amount);
|
||||
Log::debug(sprintf('Room is now %s', $room));
|
||||
}
|
||||
|
||||
Log::debug(sprintf('Will add/remove %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name));
|
||||
|
||||
// if the amount is positive, make sure it fits in piggy bank:
|
||||
|
Loading…
Reference in New Issue
Block a user