Bugzilla – Attachment 92483 Details for
Bug 23507
Add ability to show and print change given on fee receipt from FinePaymentAutoPopup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23507: Add ability to show change given on auto-popup fee reciept from FinePaymentAutoPopup
Bug-23507-Add-ability-to-show-change-given-on-auto.patch (text/plain), 10.17 KB, created by
ByWater Sandboxes
on 2019-08-27 18:02:13 UTC
(
hide
)
Description:
Bug 23507: Add ability to show change given on auto-popup fee reciept from FinePaymentAutoPopup
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2019-08-27 18:02:13 UTC
Size:
10.17 KB
patch
obsolete
>From 504180b23e62b8d5b9983b7c626097b09af1aa41 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 26 Aug 2019 14:33:29 -0400 >Subject: [PATCH] Bug 23507: Add ability to show change given on auto-popup fee > reciept from FinePaymentAutoPopup > >Some libraries would like to show the amount of change given on print reciepts triggered by FinePaymentAutoPopup >so the patron can verify he or she has recieved the correct amount of change. > >1) Apply this patch >2) Edit ACCOUNT_CREDIT slip and add "[% IF change_given %]<h1>CHANGE: [% change_given %]</h1>[% END %]" at the top >3) Enable FinePaymentAutoPopup >4) Make a payment >5) Note the change given is shown on the popup receipt >6) Note the change given is *not* shown on subsequent prints of the same receipt using the "print" button for the payment > >Signed-off-by: Kyle Hall <kyle@bywatersolutions.com> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt | 6 +++++- > members/boraccount.pl | 2 ++ > members/pay.pl | 5 ++++- > members/paycollect.pl | 5 +++-- > members/printfeercpt.pl | 3 +++ > 7 files changed, 19 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index 1677f0932a..2ad20bb340 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -121,7 +121,7 @@ > <script> > $(document).ready(function() { > [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %] >- window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank'); >+ window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=[% change_given | html %]&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank'); > [% END %] > > var txtActivefilter = _("Filter paid transactions"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >index a733221e48..8dec77b827 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt >@@ -180,7 +180,7 @@ > } > $(document).ready(function(){ > [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %] >- window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank'); >+ 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'); > [% END %] > > $('#pay-fines-form').preventDoubleFormSubmit(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >index 2f0b1679b3..bc89fe00fc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -146,6 +146,7 @@ > <input type="hidden" name="payment_note" id="payment_note" value="[% payment_note | html %]" /> > <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" /> > <input type="hidden" name="confirm_writeoff" id="confirm_writeoff" value="1" /> >+ <input type="hidden" name="change_given" id="change_given" /> > <table> > <thead><tr> > <th>Description</th> >@@ -183,6 +184,7 @@ > <input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts | html %]" /> > <input type="hidden" name="total" id="total" value="[% total | html %]" /> > <input type="hidden" name="type" value="[% type | html %]" /> >+ <input type="hidden" name="change_given" id="change_given" /> > > <fieldset class="rows"> > [% IF ( selected_accts ) %] >@@ -278,7 +280,7 @@ > <script> > $(document).ready(function() { > [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %] >- window.open('/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=[% payment_id | html %]&borrowernumber=[% patron.borrowernumber | html %]', '_blank'); >+ 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'); > [% END %] > > var forms = $('#payindivfine, #payfine'); >@@ -385,10 +387,12 @@ > change.innerHTML = Math.round(($('#collected')[0].value - $('#paid')[0].value) * 100) / 100; > if (change.innerHTML <= 0) { > change.innerHTML = "0.00"; >+ $('input[name="change_given"]').val('0.00'); > } else { > change.value = change.innerHTML; > moneyFormat(change); > change.innerHTML = change.value; >+ $('input[name="change_given"]').val(change.value); > } > > $('#modal_change').html(change.innerHTML); >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 5ccfb0c04d..251a3aa565 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -49,6 +49,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user( > > my $borrowernumber = $input->param('borrowernumber'); > my $payment_id = $input->param('payment_id'); >+my $change_given = $input->param('change_given'); > my $action = $input->param('action') || ''; > > my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; >@@ -86,6 +87,7 @@ $template->param( > totalcredit => $totalcredit, > accounts => \@accountlines, > payment_id => $payment_id, >+ change_given => $change_given, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/members/pay.pl b/members/pay.pl >index 00e6f7b386..d491d06870 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -64,6 +64,7 @@ if ( !$borrowernumber ) { > } > > my $payment_id = $input->param('payment_id'); >+our $change_given = $input->param('change_given'); > > # get borrower details > my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; >@@ -77,7 +78,7 @@ our $branch = C4::Context->userenv->{'branch'}; > > if ( $input->param('paycollect') ) { > print $input->redirect( >- "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber"); >+ "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber&change_given=$change_given"); > } > elsif ( $input->param('payselected') ) { > payselected({ params => \@names }); >@@ -105,6 +106,7 @@ elsif ( $input->param('confirm_writeoff') ) { > . "&amountoutstanding=" . $accountline->amountoutstanding > . "&accounttype=" . $accountline->accounttype > . "&accountlines_id=" . $accountlines_id >+ . "&change_given=" . $change_given > . "&writeoff_individual=1" > . "&error_over=1" ); > >@@ -198,6 +200,7 @@ sub redirect_to_paycollect { > $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 ); > $redirect .= q{&} . 'payment_note' . q{=} . uri_escape_utf8( scalar $input->param("payment_note_$line_no") ); > $redirect .= '&remote_user='; >+ $redirect .= "change_given=$change_given"; > $redirect .= $user; > return print $input->redirect($redirect); > } >diff --git a/members/paycollect.pl b/members/paycollect.pl >index a25f6a4030..12c7970876 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -38,6 +38,7 @@ my $input = CGI->new(); > > my $payment_id = $input->param('payment_id'); > my $writeoff_individual = $input->param('writeoff_individual'); >+my $change_given = $input->param('change_given'); > my $type = scalar $input->param('type') || 'payment'; > > my $updatecharges_permissions = ($writeoff_individual || $type eq 'writeoff') ? 'writeoff' : 'remaining_permissions'; >@@ -133,7 +134,7 @@ if ( $total_paid and $total_paid ne '0.00' ) { > } > ); > print $input->redirect( >- "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber&payment_id=$payment_id"); >+ "/cgi-bin/koha/members/pay.pl?borrowernumber=$borrowernumber&payment_id=$payment_id&change_given=$change_given"); > } else { > if ($select) { > if ( $select =~ /^([\d,]*).*/ ) { >@@ -176,7 +177,7 @@ if ( $total_paid and $total_paid ne '0.00' ) { > ); > } > >- print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber&payment_id=$payment_id"); >+ print $input->redirect("/cgi-bin/koha/members/boraccount.pl?borrowernumber=$borrowernumber&payment_id=$payment_id&change_given=$change_given"); > } > } > } else { >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index 85d9b17e4b..1d92e19b07 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -50,6 +50,7 @@ my ($template, $loggedinuser, $cookie) > my $borrowernumber=$input->param('borrowernumber'); > my $action = $input->param('action') || ''; > my $accountlines_id = $input->param('accountlines_id'); >+my $change_given = $input->param('change_given'); > > my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; > my $patron = Koha::Patrons->find( $borrowernumber ); >@@ -92,6 +93,8 @@ $template->param( > total => $total, > totalcredit => $totalcredit, > accounts => [$accountline], # FIXME There is always only 1 row! >+ >+ change_given => $change_given, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23507
:
92477
|
92483
|
92484
|
92673
|
93830