mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Some new tests and a bug fix for piggy banks.
This commit is contained in:
@@ -51,9 +51,15 @@ class ConnectJournalToPiggyBank
|
||||
if (is_null($repetition)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$amount = $journal->correct_amount;
|
||||
bcscale(2);
|
||||
|
||||
$amount = $journal->actual_amount;
|
||||
// if piggy account matches source account, the amount is positive
|
||||
if ($piggyBank->account_id == $journal->source_account->id) {
|
||||
$amount = $amount * -1;
|
||||
}
|
||||
|
||||
|
||||
$repetition->currentamount = bcadd($repetition->currentamount, $amount);
|
||||
$repetition->save();
|
||||
|
||||
|
@@ -9,6 +9,7 @@ use Zizaco\Entrust\Traits\EntrustUserTrait;
|
||||
|
||||
/**
|
||||
* Class User
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @package FireflyIII
|
||||
* @property integer $id
|
||||
|
Reference in New Issue
Block a user