From 36e07f5ce20b14bb1e097db2415b9aacbf0c8ed8 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 13 Oct 2020 12:28:31 +0100 Subject: [PATCH] Bug 24381: (follow-up) Notice improvements Signed-off-by: Lucas Gass Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug_24381.perl | 75 +++++++++++++++---- .../mysql/en/mandatory/sample_notices.yml | 74 ++++++++++++++---- 2 files changed, 119 insertions(+), 30 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_24381.perl b/installer/data/mysql/atomicupdate/bug_24381.perl index 1538d8a3ab..e3a5432618 100644 --- a/installer/data/mysql/atomicupdate/bug_24381.perl +++ b/installer/data/mysql/atomicupdate/bug_24381.perl @@ -3,7 +3,9 @@ if ( CheckVersion($DBversion) ) { # ACCOUNT_CREDIT my $account_credit = q{ - [% PROCESS "accounts.inc" %] + [%- USE AuthorisedValues -%] + [%- USE Price -%] + [%- PROCESS "accounts.inc" -%] [% IF ( LibraryName ) %] @@ -21,7 +23,7 @@ if ( CheckVersion($DBversion) ) { [% END %] @@ -32,40 +34,76 @@ if ( CheckVersion($DBversion) ) { + [% IF credit.payment_type %] - + + [% END %] + [% IF ( credit.credit_type_code == 'PAYMENT' ) %] + [% ELSIF ( credit.credit_type_code == 'CREDIT' ) %] + + + + [% ELSIF ( credit.credit_type_code == 'WRITEOFF' ) %] + + + + [% END %] + [% IF credit.amountoutstanding + 0 != 0 %] + + + + + + + + + + + + + [% END %] + [% IF credit.amount != credit.amountoutstanding %] [% FOREACH offset IN credit.credit_offsets %] - + [% END %] + [% END %] + [% IF change.defined %] + [% END %] @@ -111,11 +149,6 @@ q{UPDATE letter SET content = ? WHERE code = 'ACCOUNT_CREDIT' AND REPLACE(REPLAC [% END %] - - - @@ -137,6 +170,22 @@ q{UPDATE letter SET content = ? WHERE code = 'ACCOUNT_CREDIT' AND REPLACE(REPLAC Card number: [% debit.patron.cardnumber | html %]
+ [% IF debit.amountoutstanding != 0 %] + + + + + + + + + + + + + + + [% END %] [% IF debit.amount != debit.amountoutstanding %] @@ -160,11 +209,7 @@ q{UPDATE letter SET content = ? WHERE code = 'ACCOUNT_CREDIT' AND REPLACE(REPLAC - - - - - + diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index f4a9d9abcd..aba7bf02e7 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -52,7 +52,8 @@ tables: message_transport_type: print lang: default content: - - "[% PROCESS \"accounts.inc\" %]" + - "[%- USE AuthorisedValues -%]" + - "[%- PROCESS \"accounts.inc\" -%]" - "
-

[% credit.date | $KohaDates %]

+

[% today | $KohaDates %]

Operator ID: [% credit.manager_id %]
Payment type: [% credit.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', credit.payment_type) %]
-

Payment receipt

+

[%- PROCESS credit_type_description credit_type = credit.credit_type -%] receipt

Received with thanks from [% credit.patron.firstname | html %] [% credit.patron.surname | html %]
Card number: [% credit.patron.cardnumber | html %]
+ Credit added to account for [% credit.patron.firstname | html %] [% credit.patron.surname | html %]
+ Card number: [% credit.patron.cardnumber | html %]
+
+ Writeoff added to account for [% credit.patron.firstname | html %] [% credit.patron.surname | html %]
+ Card number: [% credit.patron.cardnumber | html %]
+
Description of creditAmount
[%- PROCESS credit_type_description credit_type = credit.credit_type -%][% credit.amount * -1 | $Price %]
Total available:[% credit.amountoutstanding * -1 | $Price %]
Description of charges Amount
[% PROCESS account_type_description account=offset.debit %][% PROCESS account_type_description account=offset.debit %][% IF ( offset.debit.itemnumber ) %] - [% offset.debit.item.biblio.title %][% END %] [% offset.amount * -1 | $Price %]
Total: [% credit.amount * -1 | $Price %]
Change given: [% change | $Price %]
-

[% debit.date | $KohaDates %]

-
Fee ID: [% debit.accountlines_id %]
DateDescription of chargesAmount
[% debit.date | $KohaDates %][% PROCESS account_type_description account=debit %][% debit.amount | $Price %]
Total owed:[% debit.amount | $Price %]
Date
Total owed:[% debit.amount | $Price %]
Total outstanding:Total outstanding: [% debit.amountoutstanding | $Price %]
" - " [% IF ( LibraryName ) %]" - " " @@ -70,7 +71,7 @@ tables: - " [% END %]" - " " - " " - " " - " " @@ -81,40 +82,76 @@ tables: - " " - " " - " " + - " [% IF credit.payment_type %]" - " " - " " - - " " + - " " - " " + - " [% END %]" - " " - " " - " " + - " [% IF ( credit.credit_type_code == 'PAYMENT' ) %]" - " " - " " - " " + - " [% ELSIF ( credit.credit_type_code == 'CREDIT' ) %]" + - " " + - " " + - " " + - " [% ELSIF ( credit.credit_type_code == 'WRITEOFF' ) %]" + - " " + - " " + - " " + - " [% END %]" + - " [% IF credit.amountoutstanding + 0 != 0 %]" + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " [% END %]" + - " [% IF credit.amount != credit.amountoutstanding %]" - " " - " " - " " - " " - " [% FOREACH offset IN credit.credit_offsets %]" - " " - - " " + - " " - " " - " " - " [% END %]" + - " [% END %]" - " " - " " - " " - " " - " " + - " [% IF change.defined %]" - " " - " " - " " - " " + - " [% END %]" - " " - " " - " " @@ -152,11 +189,6 @@ tables: - " " - " [% END %]" - " " - - " " - - " " - - " " - " " - " " - " " @@ -177,6 +209,22 @@ tables: - " Card number: [% debit.patron.cardnumber | html %]
" - " " - " " + - " [% IF debit.amountoutstanding != 0 %]" + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " " + - " [% END %]" - " [% IF debit.amount != debit.amountoutstanding %]" - " " - " " @@ -200,11 +248,7 @@ tables: - " " - " " - " " - - " " - - " " - - " " - - " " - - " " + - " " - " " - " " - " " -- 2.39.5
" - - "

[% credit.date | $KohaDates %]

" + - "

[% today | $KohaDates %]

" - "
Operator ID: [% credit.manager_id %]
Payment type: [% credit.payment_type %][% AuthorisedValues.GetByCode('PAYMENT_TYPE', credit.payment_type) %]
" - - "

Payment receipt

" + - "

[%- PROCESS credit_type_description credit_type = credit.credit_type -%] receipt

" - "
" - " Received with thanks from [% credit.patron.firstname | html %] [% credit.patron.surname | html %]
" - " Card number: [% credit.patron.cardnumber | html %]
" - "
" + - " Credit added to account for [% credit.patron.firstname | html %] [% credit.patron.surname | html %]
" + - " Card number: [% credit.patron.cardnumber | html %]
" + - "
" + - " Writeoff added to account for [% credit.patron.firstname | html %] [% credit.patron.surname | html %]
" + - " Card number: [% credit.patron.cardnumber | html %]
" + - "
Description of creditAmount
[%- PROCESS credit_type_description credit_type = credit.credit_type -%][% credit.amount * -1 | $Price %]
Total available:[% credit.amountoutstanding * -1 | $Price %]
Description of chargesAmount
[% PROCESS account_type_description account=offset.debit %][% PROCESS account_type_description account=offset.debit %][% IF ( offset.debit.itemnumber ) %] - [% offset.debit.item.biblio.title %][% END %][% offset.amount * -1 | $Price %]
Total:[% credit.amount * -1 | $Price %]
Change given: [% change | $Price %]
" - - "

[% debit.date | $KohaDates %]

" - - "
Fee ID: [% debit.accountlines_id %]
DateDescription of chargesAmount
[% debit.date | $KohaDates %][% PROCESS account_type_description account=debit %][% debit.amount | $Price %]
Total owed:[% debit.amount | $Price %]
Date
Total owed:[% debit.amount | $Price %]
Total outstanding:Total outstanding:[% debit.amountoutstanding | $Price %]