mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 01:42:19 +00:00
Use Piggy Bank's start date in monthly suggestion #6254
This commit is contained in:
@@ -341,7 +341,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
|||||||
}
|
}
|
||||||
if (null !== $piggyBank->targetdate && $repetition->currentamount < $piggyBank->targetamount) {
|
if (null !== $piggyBank->targetdate && $repetition->currentamount < $piggyBank->targetamount) {
|
||||||
$now = Carbon::now();
|
$now = Carbon::now();
|
||||||
$diffInMonths = $now->diffInMonths($piggyBank->targetdate, false);
|
$startDate = null !== $piggyBank->startdate && $piggyBank->startdate->gte($now) ? $piggyBank->startdate : $now;
|
||||||
|
$diffInMonths = $startDate->diffInMonths($piggyBank->targetdate, false);
|
||||||
$remainingAmount = bcsub($piggyBank->targetamount, $repetition->currentamount);
|
$remainingAmount = bcsub($piggyBank->targetamount, $repetition->currentamount);
|
||||||
|
|
||||||
// more than 1 month to go and still need money to save:
|
// more than 1 month to go and still need money to save:
|
||||||
|
Reference in New Issue
Block a user