From e1785898bafde7397a9bf1c2a0a60922cefd9f00 Mon Sep 17 00:00:00 2001
From: James Cole
Date: Mon, 23 Dec 2024 08:35:33 +0100
Subject: [PATCH] Add notes to audit report.
---
app/Generator/Report/Audit/MonthReportGenerator.php | 5 ++++-
resources/views/reports/audit/report.twig | 2 +-
resources/views/reports/partials/journals-audit.twig | 5 +++++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/app/Generator/Report/Audit/MonthReportGenerator.php b/app/Generator/Report/Audit/MonthReportGenerator.php
index 2ae858c600..87d67d20c4 100644
--- a/app/Generator/Report/Audit/MonthReportGenerator.php
+++ b/app/Generator/Report/Audit/MonthReportGenerator.php
@@ -83,6 +83,9 @@ class MonthReportGenerator implements ReportGeneratorInterface
'create_date',
'update_date',
+ // more
+ 'notes',
+
// date fields.
'interest_date',
'book_date',
@@ -126,7 +129,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector->setAccounts(new Collection([$account]))->setRange($this->start, $this->end)->withAccountInformation()
- ->withBudgetInformation()->withCategoryInformation()->withBillInformation()
+ ->withBudgetInformation()->withCategoryInformation()->withBillInformation()->withNotes()
;
$journals = $collector->getExtractedJournals();
$journals = array_reverse($journals, true);
diff --git a/resources/views/reports/audit/report.twig b/resources/views/reports/audit/report.twig
index c3ca5d319f..024f3e6638 100644
--- a/resources/views/reports/audit/report.twig
+++ b/resources/views/reports/audit/report.twig
@@ -58,7 +58,7 @@
account_name: account.name|escape,
url: url,
end: auditData[account.id].dayBefore,
- balance: formatAmountByAccount(account, auditData[account.id].dayBeforeBalance)
+ balance: formatAmountByAccount(account, auditData[account.id].dayBeforeBalance.balance)
})|raw }}
{% include 'reports.partials.journals-audit' with {'journals': auditData[account.id].journals,'account':account} %}
diff --git a/resources/views/reports/partials/journals-audit.twig b/resources/views/reports/partials/journals-audit.twig
index 653adcfd7d..2e101645c4 100644
--- a/resources/views/reports/partials/journals-audit.twig
+++ b/resources/views/reports/partials/journals-audit.twig
@@ -22,6 +22,8 @@
{{ trans('list.create_date') }} |
{{ trans('list.update_date') }} |
+ {{ trans('list.notes') }} |
+
{# even more optional fields #}
{{ trans('list.interest_date') }} |
{{ trans('list.book_date') }} |
@@ -144,6 +146,9 @@
{{ journal.updated_at.isoFormat(dateTimeFormat) }}
|
+
+ {{ journal.notes|default('')|markdown }}
+ |
|