Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Because nextExpectedMatch() must return a date (and cannot return null) the list of bills will show "unknown" when the bill is next expected in 1900.
James Cole807dede90abe
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.phpindex 460f3effb3..28ebe99313 100644--- a/app/Repositories/Bill/BillRepository.php+++ b/app/Repositories/Bill/BillRepository.php@@ -399,7 +399,8 @@ class BillRepository implements BillRepositoryInterfacepublic function nextExpectedMatch(Bill $bill): Carbon{- $finalDate = Carbon::now()->subDays(2);+ $finalDate = Carbon::now();+ $finalDate->year = 1900;if ($bill->active == 0) {return $finalDate;}diff --git a/resources/views/list/bills.twig b/resources/views/list/bills.twigindex 7b95561765..50747535aa 100644--- a/resources/views/list/bills.twig+++ b/resources/views/list/bills.twig@@ -45,14 +45,14 @@</td>{% endif %}- {% if entry.nextExpectedMatch.isFuture %}- <td class="hidden-sm hidden-xs" data-value="{{ entry.nextExpectedMatch.format('U') }}">- {{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }}- </td>- {% else %}+ {% if entry.nextExpectedMatch.year == 1900 %}<td class="hidden-sm hidden-xs" data-value="0"><em>{{ 'unknown'|_ }}</em></td>+ {% else %}+ <td class="hidden-sm hidden-xs" data-value="{{ entry.nextExpectedMatch.format('U') }}">+ {{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }}+ </td>{% endif %}<td class="hidden-sm hidden-xs" data-value="{{ entry.active }}">