Expand views and files to use new methods.

This commit is contained in:
James Cole
2018-03-19 19:39:26 +01:00
parent 1645490f5c
commit 3b735c7533
5 changed files with 102 additions and 59 deletions

View File

@@ -200,55 +200,24 @@
<td>{{ journalBudgets(journal)|raw }}</td>
</tr>
{% if journal.hasMeta('interest_date') %}
<tr>
<td>{{ trans('list.interest_date') }}</td>
<td>{{ getMetaDate(journal,'interest_date').formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% if journal.hasMeta('book_date') %}
<tr>
<td>{{ trans('list.book_date') }}</td>
<td>{{ getMetaDate(journal,'book_date').formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% if journal.hasMeta('process_date') %}
<tr>
<td>{{ trans('list.process_date') }}</td>
<td>{{ getMetaDate(journal,'process_date').formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% if journal.hasMeta('due_date') %}
<tr>
<td>{{ trans('list.due_date') }}</td>
<td>{{ getMetaDate(journal,'due_date').formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% if journal.hasMeta('payment_date') %}
<tr>
<td>{{ trans('list.payment_date') }}</td>
<td>{{ getMetaDate(journal,'payment_date').formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% if journal.hasMeta('invoice_date') %}
<tr>
<td>{{ trans('list.invoice_date') }}</td>
<td>{{ getMetaDate(journal,'invoice_date').formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% set intRef = getMetaField(journal, 'internal_reference') %}
{% if intRef != "" %}
<tr>
<td>{{ trans('list.internal_reference') }}</td>
<td>{{ intRef }}</td>
</tr>
{% endif %}
{# all date meta values #}
{% for dateField in ['interest_date','book_date','process_date','due_date','payment_date','invoice_date'] %}
{% if journalHasMeta(journal, dateField) %}
<tr>
<td>{{ trans('list.'~dateField) }}</td>
<td>{{ journalGetMetaDate(journal,dateField).formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% endfor %}
{# all other meta values #}
{% for metaField in ['internal_reference','sepa-ct-id','sepa-ct-op','sepa-db','sepa-country','sepa-cc','sepa-ep','sepa-ci'] %}
{% if journalHasMeta(journal, metaField) %}
<tr>
<td>{{ trans('list.'~metaField) }}</td>
<td>{{ journalGetMetaField(journal, metaField) }}</td>
</tr>
{% endif %}
{% endfor %}
{% if journal.notes.count == 1 %}
<tr>
<td>{{ trans('list.notes') }}</td>
@@ -315,7 +284,7 @@
</a>
({{ att.size|filesize }})
{% if att.notes.first %}
{{ att.notes.first.text|markdown}}
{{ att.notes.first.text|markdown }}
{% endif %}
</td>
</tr>