From 052701f86b69450e42abd6dd924c5cd6d950e9cd Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Wed, 2 Nov 2022 11:50:42 +0000 Subject: [PATCH] Bug 31713: (QA follow-up) Make credits positive * This makes amount and amountoutstanding for credits positive * Adapts the total line to read credits instead of due when the balance is >0 --- installer/data/mysql/atomicupdate/bug_31713.pl | 15 +++++++++++---- .../data/mysql/en/mandatory/sample_notices.yml | 17 +++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_31713.pl b/installer/data/mysql/atomicupdate/bug_31713.pl index 13d608c7e6..c0deacdff7 100644 --- a/installer/data/mysql/atomicupdate/bug_31713.pl +++ b/installer/data/mysql/atomicupdate/bug_31713.pl @@ -82,8 +82,8 @@ return { [% PROCESS account_type_description account=credit %] [%- IF credit.description %], [% credit.description | html %][% END %] - [% credit.amount | $Price %] - [% credit.amountoutstanding | $Price %] + [% credit.amount *-1 | $Price %] + [% credit.amountoutstanding *-1 | $Price %] [% END %] [% ELSE %] @@ -94,8 +94,15 @@ return { - Total outstanding dues as of [% today | $KohaDates %]: - [% IF ( borrower.account.balance <= 0 ) %][% ELSE %][% END %][% borrower.account.balance | $Price %] + + [% IF borrower.account.balance < 0 %] + Total credit as of [% today | $KohaDates %]: + [% ELSE %] + Total outstanding dues as of [% today | $KohaDates %]: + [% END %] + + [% IF ( borrower.account.balance <= 0 ) %][% borrower.account.balance * -1 | $Price %] + [% ELSE %][% borrower.account.balance | $Price %][% END %] diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml index 09b594a759..ed55b289b9 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1366,8 +1366,8 @@ tables: - " [% PROCESS account_type_description account=credit %]" - " [%- IF credit.description %], [% credit.description | html %][% END %]" - " " - - " [% credit.amount | $Price %]" - - " [% credit.amountoutstanding | $Price %]" + - " [% credit.amount *-1 | $Price %]" + - " [% credit.amountoutstanding *-1 | $Price %]" - " " - " [% END %]" - " [% ELSE %]" @@ -1377,10 +1377,15 @@ tables: - " [% END %]" - "" - " " - - " " - - " Total outstanding dues as of [% today | $KohaDates %]: " - - " [% IF ( borrower.account.balance <= 0 ) %][% ELSE %][% END %][% borrower.account.balance | $Price %]" - - " " + - " " + - " [% IF borrower.account.balance < 0 %]" + - " Total credit as of [% today | $KohaDates %]:" + - " [% ELSE %]" + - " Total outstanding dues as of [% today | $KohaDates %]:" + - " [% END %]" + - " " + - " [% IF ( borrower.account.balance <= 0 ) %][% borrower.account.balance * -1 | $Price %]" + - " [% ELSE %][% borrower.account.balance | $Price %][% END %]" - " " - "" -- 2.30.2