Bug 43288: Fix change amount missing from printed fee receipts
pay.tt, paycollect.tt and boraccount.tt all open printfeercpt.pl with a change_given= query parameter after a payment, but printfeercpt.pl only ever reads a 'change' param into its GetPreparedLetter substitute hash - matching the ACCOUNT_CREDIT/CREDIT_* default notice templates, which use [% change | $Price %], not [% change_given | $Price %]. As a result the change amount is silently blank on every printed fee receipt that shows it, regardless of FinePaymentAutoPopup. Rather than touch printfeercpt.pl or the notice content (both already agree on 'change', matching a similar migration Koha did once before in installer/data/mysql/db_revs/220600072.pl going the same direction), fix the three query strings that build the printfeercpt.pl URL to send change= instead of change_given=. The change_given variable name is kept everywhere else (form fields, JS locals, Perl params) since this is purely about the query key at the printfeercpt.pl boundary. Test plan: 1) Set FinePaymentAutoPopup to 'show' 2) Take a payment for a patron via members/pay.pl or members/paycollect.pl that generates change (fine amount not evenly covered by cash tendered) 3) Note the auto-popped-up receipt shows the change amount (before this patch, the Change line was always blank) 4) Repeat via the boraccount.pl > printfeercpt.pl print receipt route Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
7bba6e855a
commit
f8601c1b0f
|
|
@ -599,7 +599,7 @@
|
|||
<script nonce="[% Koha.CSPNonce | $raw %]">
|
||||
$(document).ready(function () {
|
||||
if (payment_id && Koha.prefs.FinePaymentAutoPopup) {
|
||||
window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=${change_given}&accountlines_id=${payment_id}`, "_blank");
|
||||
window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&change=${change_given}&accountlines_id=${payment_id}`, "_blank");
|
||||
}
|
||||
|
||||
var txtActivefilter = _("Filter paid transactions");
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@
|
|||
}
|
||||
$(document).ready(function () {
|
||||
if (payment_id && Koha.prefs.FinePaymentAutoPopup) {
|
||||
window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=${payment_id}&change_given=${change_given}&borrowernumber=${patron_id}`, "_blank");
|
||||
window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=${payment_id}&change=${change_given}&borrowernumber=${patron_id}`, "_blank");
|
||||
}
|
||||
|
||||
$("#pay-fines-form").preventDoubleFormSubmit();
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@
|
|||
<script nonce="[% Koha.CSPNonce | $raw %]" data-tt-allowed="true">
|
||||
$(document).ready(function() {
|
||||
[% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %]
|
||||
window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&change_given=[% change_given | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
|
||||
window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&change=[% change_given | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank');
|
||||
[% END %]
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue