Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Use Piggy Bank's start date in monthly suggestion #6254
Rick Cuddy203ae2812f5b
diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.phpindex 9acd034ec8..e74d486dd3 100644--- a/app/Repositories/PiggyBank/PiggyBankRepository.php+++ b/app/Repositories/PiggyBank/PiggyBankRepository.php@@ -341,7 +341,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface}if (null !== $piggyBank->targetdate && $repetition->currentamount < $piggyBank->targetamount) {$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);// more than 1 month to go and still need money to save: