From 2da087401ec56aee77d0cf3debe69368e804f86a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 10 Sep 2016 18:37:16 +0200 Subject: [PATCH] Extend audit report Signed-off-by: James Cole --- app/Http/Controllers/ReportController.php | 11 ++- .../reports/partials/journals-audit.twig | 71 +++++++++++++++---- 2 files changed, 66 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index 037d3c2ab1..f56e787c9e 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -215,8 +215,15 @@ class ReportController extends Controller $reportType = 'audit'; $accountIds = join(',', $accounts->pluck('id')->toArray()); - $hideable = ['buttons', 'icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'book_date', 'process_date', 'interest_date', - 'from', 'to', 'budget', 'category', 'bill', 'create_date', 'update_date', + $hideable = ['buttons', 'icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', + 'interest_date','book_date', 'process_date', + // three new optional fields. + 'due_date', 'payment_date', 'invoice_date', + 'from', 'to', 'budget', 'category', 'bill', + // more new optional fields + 'internal_reference', 'notes', + + 'create_date', 'update_date', ]; $defaultShow = ['icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'to']; diff --git a/resources/views/reports/partials/journals-audit.twig b/resources/views/reports/partials/journals-audit.twig index b5af50a880..117d16bfbb 100644 --- a/resources/views/reports/partials/journals-audit.twig +++ b/resources/views/reports/partials/journals-audit.twig @@ -16,6 +16,11 @@ {{ trans('list.process_date') }} {{ trans('list.interest_date') }} + + {{ trans('list.due_date') }} + {{ trans('list.payment_date') }} + {{ trans('list.invoice_date') }} + {{ trans('list.from') }} {{ trans('list.to') }} @@ -23,6 +28,10 @@ {{ trans('list.bill') }} + + {{ trans('list.internal_reference') }} + {{ trans('list.notes') }} + {{ trans('list.create_date') }} {{ trans('list.update_date') }} @@ -45,24 +54,46 @@ {{ journal.after|formatAmount }} {{ journal.date.formatLocalized(monthAndDayFormat) }} - {{ journal.book_date.formatLocalized(monthAndDayFormat) }} - {{ journal.process_date.formatLocalized(monthAndDayFormat) }} - {{ journal.interest_date.formatLocalized(monthAndDayFormat) }} - - - {% if journal.source_account_type == 'Cash account' %} - (cash) - {% else %} - {{ journal.source_account_name }} + + {% if journal.hasMeta('book_date') %} + {{ journal.getMeta('book_date').formatLocalized(monthAndDayFormat) }} {% endif %} - - {% if journal.destination_account_type == 'Cash account' %} - (cash) - {% else %} - {{ journal.destination_account_name }} + + {% if journal.hasMeta('process_date') %} + {{ journal.getMeta('process_date').formatLocalized(monthAndDayFormat) }} {% endif %} + + {% if journal.hasMeta('interest_date') %} + {{ journal.getMeta('interest_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + + + {% if journal.hasMeta('due_date') %} + {{ journal.getMeta('due_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + {% if journal.hasMeta('payment_date') %} + {{ journal.getMeta('payment_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + {% if journal.hasMeta('invoice_date') %} + {{ journal.getMeta('invoice_date').formatLocalized(monthAndDayFormat) }} + {% endif %} + + + + + {{ sourceAccount(journal)|raw }} + + + {{ destinationAccount(journal)|raw }} + {{ journalBudgets(journal)|raw }} @@ -77,6 +108,18 @@   {% endif %} + + + {% if journal.hasMeta('internal_reference') %} + {{ journal.getMeta('internal_reference') }} + {% endif %} + + + {% if journal.hasMeta('notes') %} + {{ journal.getMeta('notes')|nl2br }} + {% endif %} + + {{ journal.created_at.formatLocalized(dateTimeFormat) }}