From b6be9e6ade5df3d084b6fbc00da21a2d11e5448d Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 1 Jul 2017 10:39:59 +0200 Subject: [PATCH] Fix for #682 --- resources/views/list/bills.twig | 44 ++++++++++++++------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/resources/views/list/bills.twig b/resources/views/list/bills.twig index 4780d7bf1f..5af2807f66 100644 --- a/resources/views/list/bills.twig +++ b/resources/views/list/bills.twig @@ -40,45 +40,33 @@ - {# - Terms: - paidDates: journals linked to the bill between $start and $end. - payDates: dates in this period ($start and $end) system thinks bill should be paid. - Possible situations: - - 1: - paidDates = 0 (bill not paid in period) - payDates = 0 (bill not expected to be paid in this period) - bill is active. - - 2: - paidDates = 0 (bill not paid in period) - payDates = 0 (bill IS expected to be paid in this period) - bill is active - - 3: - paidDates >= payDates (bill is paid as many times or more than the amount of times expected). - - 4: - bill is not active - #} + {# + paidDates = 0 (bill not paid in period) + payDates = 0 (bill not expected to be paid in this period) + bill is active. + #} {% if entry.paidDates.count() == 0 and entry.payDates.count() == 0 and entry.active %} {{ 'not_expected_period'|_ }} - + {{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }} {% endif %} + + {# + paidDates = 0 (bill not paid in period) + payDates > 0 (bill IS expected to be paid in this period) + bill is active + #} {% if entry.paidDates.count() == 0 and entry.payDates.count() > 0 and entry.active %} {{ 'not_or_not_yet'|_ }} @@ -87,7 +75,12 @@ {{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }} {% endif %} - {% if entry.paidDates.count() >= entry.payDates.count() and entry.payDates.count() > 0 and entry.active %} + + {# + paidDates >= 0 (bill is paid X times). + Don't care about payDates. + #} + {% if entry.paidDates.count() > 0 and entry.active %} {% for date in entry.paidDates %} {{ date.formatLocalized(monthAndDayFormat) }}
@@ -97,6 +90,7 @@ {{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }} {% endif %} + {# bill is not active #} {% if not entry.active %} ~