From 3b735c7533180d6fc2ac8b8df919ee6aadacf442 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 19 Mar 2018 19:39:26 +0100 Subject: [PATCH] Expand views and files to use new methods. --- config/csv.php | 65 +++++++++++++++-- resources/lang/en_US/import.php | 17 +++-- resources/lang/en_US/list.php | 8 +++ .../reports/partials/journals-audit.twig | 2 +- resources/views/transactions/show.twig | 69 +++++-------------- 5 files changed, 102 insertions(+), 59 deletions(-) diff --git a/config/csv.php b/config/csv.php index cde6ea3d08..32404f3738 100644 --- a/config/csv.php +++ b/config/csv.php @@ -174,6 +174,24 @@ return [ 'converter' => 'Date', 'field' => 'date-process', ], + 'date-due' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'Date', + 'field' => 'date-due', + ], + 'date-payment' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'Date', + 'field' => 'date-payment', + ], + 'date-invoice' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'Date', + 'field' => 'date-invoice', + ], 'budget-id' => [ 'mappable' => true, 'pre-process-map' => false, @@ -266,7 +284,7 @@ return [ 'converter' => 'AccountId', 'mapper' => 'OpposingAccounts', ], - 'opposing-bic' => [ + 'opposing-bic' => [ 'mappable' => false, 'pre-process-map' => false, 'field' => 'opposing-account-bic', @@ -317,23 +335,62 @@ return [ 'converter' => 'Amount', 'field' => 'amount_foreign', ], + + // SEPA end to end ID 'sepa-ct-id' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', - 'field' => 'description', + 'field' => 'sepa_ct_id', ], + // SEPA opposing account identifier 'sepa-ct-op' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', - 'field' => 'description', + 'field' => 'sepa_ct_op', ], + // SEPA Direct Debit Mandate Identifier 'sepa-db' => [ 'mappable' => false, 'pre-process-map' => false, 'converter' => 'Description', - 'field' => 'description', + 'field' => 'sepa_db', + ], + // SEPA clearing code + 'sepa-cc' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'Description', + 'field' => 'sepa_cc', + ], + // SEPA country + 'sepa-country' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'Description', + 'field' => 'sepa_country', + ], + // SEPA external purpose + 'sepa-ep' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'Description', + 'field' => 'sepa_ep', + ], + // SEPA creditor identifier + 'sepa-ci' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'Description', + 'field' => 'sepa_ci', + ], + // Internal reference + 'internal-reference' => [ + 'mappable' => false, + 'pre-process-map' => false, + 'converter' => 'Description', + 'field' => 'internal_reference', ], ], diff --git a/resources/lang/en_US/import.php b/resources/lang/en_US/import.php index 829f26399a..e79150807a 100644 --- a/resources/lang/en_US/import.php +++ b/resources/lang/en_US/import.php @@ -1,5 +1,6 @@ 'Transaction booking date', 'column_date-process' => 'Transaction process date', 'column_date-transaction' => 'Date', + 'column_date-due' => 'Transaction due date', + 'column_date-payment' => 'Transaction payment date', + 'column_date-invoice' => 'Transaction invoice date', 'column_description' => 'Description', 'column_opposing-iban' => 'Opposing account (IBAN)', - 'column_opposing-bic' => 'Opposing account (BIC)', + 'column_opposing-bic' => 'Opposing account (BIC)', 'column_opposing-id' => 'Opposing account ID (matching FF3)', 'column_external-id' => 'External ID', 'column_opposing-name' => 'Opposing account (name)', 'column_rabo-debit-credit' => 'Rabobank specific debit/credit indicator', 'column_ing-debit-credit' => 'ING specific debit/credit indicator', - 'column_sepa-ct-id' => 'SEPA Credit Transfer end-to-end ID', - 'column_sepa-ct-op' => 'SEPA Credit Transfer opposing account', - 'column_sepa-db' => 'SEPA Direct Debit', + 'column_sepa-ct-id' => 'SEPA end-to-end Identifier', + 'column_sepa-ct-op' => 'SEPA Opposing Account Identifier', + 'column_sepa-db' => 'SEPA Mandate Identifier', + 'column_sepa-cc' => 'SEPA Clearing Code', + 'column_sepa-ci' => 'SEPA Creditor Identifier', + 'column_sepa-ep' => 'SEPA External Purpose', + 'column_sepa-country' => 'SEPA Country Code', 'column_tags-comma' => 'Tags (comma separated)', 'column_tags-space' => 'Tags (space separated)', 'column_account-number' => 'Asset account (account number)', 'column_opposing-number' => 'Opposing account (account number)', 'column_note' => 'Note(s)', + 'column_internal-reference' => 'Internal reference', // prerequisites 'prerequisites' => 'Prerequisites', diff --git a/resources/lang/en_US/list.php b/resources/lang/en_US/list.php index 484bbbc67d..250e846177 100644 --- a/resources/lang/en_US/list.php +++ b/resources/lang/en_US/list.php @@ -1,5 +1,6 @@ 'Reconcile', 'account_on_spectre' => 'Account (Spectre)', 'do_import' => 'Import from this account', + 'sepa-ct-id' => 'SEPA End to End Identifier', + 'sepa-ct-op' => 'SEPA Opposing Account Identifier', + 'sepa-db' => 'SEPA Mandate Identifier', + 'sepa-country' => 'SEPA Country', + 'sepa-cc' => 'SEPA Clearing Code', + 'sepa-ep' => 'SEPA External Purpose', + 'sepa-ci' => 'SEPA Creditor Identifier', ]; diff --git a/resources/views/reports/partials/journals-audit.twig b/resources/views/reports/partials/journals-audit.twig index ec594fe40f..b9c03d77c2 100644 --- a/resources/views/reports/partials/journals-audit.twig +++ b/resources/views/reports/partials/journals-audit.twig @@ -129,7 +129,7 @@ {% if transaction.transactionJournal.hasMeta('internal_reference') %} - {{ getMetaField(transaction.transactionJournal,'internal_reference') }} + {{ journalGetMetaField(transaction.transactionJournal,'internal_reference') }} {% endif %} diff --git a/resources/views/transactions/show.twig b/resources/views/transactions/show.twig index d5f4ce084d..e1627928e6 100644 --- a/resources/views/transactions/show.twig +++ b/resources/views/transactions/show.twig @@ -200,55 +200,24 @@ {{ journalBudgets(journal)|raw }} - {% if journal.hasMeta('interest_date') %} - - {{ trans('list.interest_date') }} - {{ getMetaDate(journal,'interest_date').formatLocalized(monthAndDayFormat) }} - - - {% endif %} - - {% if journal.hasMeta('book_date') %} - - {{ trans('list.book_date') }} - {{ getMetaDate(journal,'book_date').formatLocalized(monthAndDayFormat) }} - - {% endif %} - {% if journal.hasMeta('process_date') %} - - {{ trans('list.process_date') }} - {{ getMetaDate(journal,'process_date').formatLocalized(monthAndDayFormat) }} - - - {% endif %} - - {% if journal.hasMeta('due_date') %} - - {{ trans('list.due_date') }} - {{ getMetaDate(journal,'due_date').formatLocalized(monthAndDayFormat) }} - - - {% endif %} - {% if journal.hasMeta('payment_date') %} - - {{ trans('list.payment_date') }} - {{ getMetaDate(journal,'payment_date').formatLocalized(monthAndDayFormat) }} - - - {% endif %} - {% if journal.hasMeta('invoice_date') %} - - {{ trans('list.invoice_date') }} - {{ getMetaDate(journal,'invoice_date').formatLocalized(monthAndDayFormat) }} - - {% endif %} - {% set intRef = getMetaField(journal, 'internal_reference') %} - {% if intRef != "" %} - - {{ trans('list.internal_reference') }} - {{ intRef }} - - {% endif %} + {# all date meta values #} + {% for dateField in ['interest_date','book_date','process_date','due_date','payment_date','invoice_date'] %} + {% if journalHasMeta(journal, dateField) %} + + {{ trans('list.'~dateField) }} + {{ journalGetMetaDate(journal,dateField).formatLocalized(monthAndDayFormat) }} + + {% 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) %} + + {{ trans('list.'~metaField) }} + {{ journalGetMetaField(journal, metaField) }} + + {% endif %} + {% endfor %} {% if journal.notes.count == 1 %} {{ trans('list.notes') }} @@ -315,7 +284,7 @@ ({{ att.size|filesize }}) {% if att.notes.first %} - {{ att.notes.first.text|markdown}} + {{ att.notes.first.text|markdown }} {% endif %}