mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
a258b35236
commit
3d1233314a
@ -36,10 +36,8 @@ use Log;
|
|||||||
*/
|
*/
|
||||||
class TransactionGroupFactory
|
class TransactionGroupFactory
|
||||||
{
|
{
|
||||||
/** @var TransactionJournalFactory */
|
private TransactionJournalFactory $journalFactory;
|
||||||
private $journalFactory;
|
private User $user;
|
||||||
/** @var User The user */
|
|
||||||
private $user;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TransactionGroupFactory constructor.
|
* 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));
|
Log::debug(sprintf('The currency is %s and the amount is %s', $currency->code, $amount));
|
||||||
$room = bcsub((string) $piggyBank->targetamount, (string) $repetition->currentamount);
|
$room = bcsub((string) $piggyBank->targetamount, (string) $repetition->currentamount);
|
||||||
$compare = bcmul($repetition->currentamount, '-1');
|
$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));
|
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:
|
// if the amount is positive, make sure it fits in piggy bank:
|
||||||
|
Loading…
Reference in New Issue
Block a user