Possible fix for #682

This commit is contained in:
James Cole 2017-06-28 15:45:28 +02:00
parent 4e4ce2f77c
commit 3947da5e27
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 26 additions and 1 deletions

View File

@ -262,6 +262,8 @@ class BillRepository implements BillRepositoryInterface
}
/**
* The "paid dates" list is a list of dates of transaction journals that are linked to this bill.
*
* @param Bill $bill
* @param Carbon $start
* @param Carbon $end

View File

@ -40,6 +40,29 @@
</span>
</td>
{#
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
#}
{% if entry.paidDates.count() == 0 and entry.payDates.count() == 0 and entry.active %}
<td class="text-muted" data-value="0001-00-00 00-00-00">
{{ 'not_expected_period'|_ }}
@ -56,7 +79,7 @@
{{ entry.nextExpectedMatch.formatLocalized(monthAndDayFormat) }}
</td>
{% endif %}
{% if entry.paidDates.count() == entry.payDates.count() and entry.payDates.count() > 0 and entry.active %}
{% if entry.paidDates.count() >= entry.payDates.count() and entry.payDates.count() > 0 and entry.active %}
<td class="text-success" data-value="{{ entry.paidDates.first.format('Y-m-d H-i-s') }}">
{% for date in entry.paidDates %}
{{ date.formatLocalized(monthAndDayFormat) }}<br/>