From 7f6a3ae60039efa4d029d3f6673d466d776bd4bb Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 21 Oct 2022 08:20:33 -0400 Subject: [PATCH] Bug 31713: (QA follow-up) Add current date to slip Signed-off-by: Kyle M Hall --- Koha/Template/Plugin/KohaDates.pm | 4 ++++ installer/data/mysql/atomicupdate/bug_31713.pl | 5 +++-- installer/data/mysql/en/mandatory/sample_notices.yml | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Koha/Template/Plugin/KohaDates.pm b/Koha/Template/Plugin/KohaDates.pm index 783833f7df..446e9bb7d1 100644 --- a/Koha/Template/Plugin/KohaDates.pm +++ b/Koha/Template/Plugin/KohaDates.pm @@ -47,4 +47,8 @@ sub tz { return C4::Context->tz->name; } +sub now { + return dt_from_string; +} + 1; diff --git a/installer/data/mysql/atomicupdate/bug_31713.pl b/installer/data/mysql/atomicupdate/bug_31713.pl index 9ab4132d89..31bc185f7e 100644 --- a/installer/data/mysql/atomicupdate/bug_31713.pl +++ b/installer/data/mysql/atomicupdate/bug_31713.pl @@ -8,8 +8,9 @@ return { my ($dbh, $out) = @$args{qw(dbh out)}; my $slip_content = <<~'END_CONTENT'; -[% USE Koha %] [% USE Branches %] +[% USE Koha %] +[% USE KohaDates %] [% USE Price %] [% PROCESS 'accounts.inc' %] @@ -85,7 +86,7 @@ return { - + [% IF ( borrower.account.balance <= 0 ) %] diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 367da957ba..af980245dc 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1216,8 +1216,9 @@ tables: message_transport_type: print lang: default content: - - "[% USE Koha %]" - "[% USE Branches %]" + - "[% USE Koha %]" + - "[% USE KohaDates %]" - "[% USE Price %]" - "[% PROCESS 'accounts.inc' %]" - "
Total outstanding dues as on date: Total outstanding dues as of [% KohaDates.output_preference( KohaDates.now ) %]: [% ELSE %][% END %][% borrower.account.balance | $Price %]
" @@ -1293,7 +1294,7 @@ tables: - "" - " " - " " - - " " + - " " - " [% IF ( borrower.account.balance <= 0 ) %]" - " " - " " -- 2.30.2
Total outstanding dues as on date: Total outstanding dues as of [% KohaDates.output_preference( KohaDates.now ) %]: [% ELSE %][% END %][% borrower.account.balance | $Price %]