Bugzilla – Attachment 93830 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 receipt from FinePaymentAutoPopup
Bug-23507-Add-ability-to-show-change-given-on-auto.patch (text/plain), 10.91 KB, created by
Katrin Fischer
on 2019-10-07 18:43:22 UTC
(
hide
)
Description:
Bug 23507: Add ability to show change given on auto-popup fee receipt from FinePaymentAutoPopup
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-10-07 18:43:22 UTC
Size:
10.91 KB
patch
obsolete
>From f1fdde9ffabf5255dd754d4f9bccba544b729550 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 > receipt 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> > >Signed-off-by: Hasina Akhte <hasinaa@pascolibraries.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > 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 | 7 ++++++- > members/boraccount.pl | 2 ++ > members/pay.pl | 6 +++++- > members/paycollect.pl | 5 +++-- > members/printfeercpt.pl | 3 +++ > 7 files changed, 21 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 dfd4935571..6ede0640b0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt >@@ -78,6 +78,7 @@ > <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding | html %]" /> > <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id | html %]" /> > <input type="hidden" name="title" id="title" value="[% title | html %]" /> >+ <input type="hidden" name="change_given" id="change_given" /> > > <fieldset class="rows"> > <legend>Pay an individual fine</legend> >@@ -167,6 +168,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> >@@ -209,6 +211,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 ) %] >@@ -324,7 +327,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'); >@@ -431,10 +434,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..a490e58e42 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" ); > >@@ -135,6 +137,7 @@ for (@names) { > $template->param( > finesview => 1, > payment_id => $payment_id, >+ change_given => $change_given, > ); > > add_accounts_to_template(); >@@ -198,6 +201,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 0974997885..9e25476a0d 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -39,6 +39,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'; >@@ -162,7 +163,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,]*).*/ ) { >@@ -208,7 +209,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