Bugzilla – Attachment 168180 Details for
Bug 23674
Allowing notes on all entries in patron Transactions table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23674: Add ability to add note to void payment
Bug-23674-Add-ability-to-add-note-to-void-payment.patch (text/plain), 7.07 KB, created by
Sam Lau
on 2024-06-26 20:20:50 UTC
(
hide
)
Description:
Bug 23674: Add ability to add note to void payment
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2024-06-26 20:20:50 UTC
Size:
7.07 KB
patch
obsolete
>From a4323bda251525a8720eba7180f1b4fa71ed6d6a Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Wed, 26 Jun 2024 20:17:04 +0000 >Subject: [PATCH] Bug 23674: Add ability to add note to void payment > >To test: >1) From patron accounting page -> Create manual credit. Put in some amount and press add credit. >2) Under the actions column, select "Void" >3) Notice no option for a note. Press cancel >4) Apply patch, restart_all >5) Press void again. This time, you should see a modal that gives you the option to type in a note. >6) Type something in and select submit. >7) Ensure the note shows up in the note column. >--- > Koha/Account/Line.pm | 4 +- > .../prog/en/modules/members/boraccount.tt | 60 +++++++++++++------ > members/boraccount.pl | 2 + > 3 files changed, 47 insertions(+), 19 deletions(-) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 75e6733167..694c2f6a25 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -236,7 +236,8 @@ sub debits { > > $payment_accountline->void({ > interface => $interface, >- [ staff_id => $staff_id, branch => $branchcode ] >+ [ staff_id => $staff_id, branch => $branchcode ], >+ note => $note > }); > > Used to 'void' (or reverse) a payment/credit. It will roll back any offsets >@@ -301,6 +302,7 @@ sub void { > manager_id => $params->{staff_id}, > interface => $params->{interface}, > branchcode => $params->{branch}, >+ note => $params->{note} > } > )->store(); > >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 ae52b17d71..37e86c531e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -176,16 +176,7 @@ > </form> > [% END %] > [% IF account.is_credit && account.status != 'VOID' %] >- <form method="post" action="/cgi-bin/koha/members/boraccount.pl"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-void" /> >- <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"> >- <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]"> >- <button type="submit" class="btn btn-default btn-xs void-action"> >- <i class="fa fa-ban"></i> >- Void payment >- </button> >- </form> >+ <button type="button" data-toggle="modal" data-target="#voidPaymentModal" data-accountline="[% account.accountlines_id | html %]" data-member="[% account.borrowernumber | html %]" class="btn btn-default btn-xs void-action"><i class="fa fa-ban"></i> Void payment</button> > [% END %] > [% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %] > <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl"> >@@ -402,6 +393,39 @@ > </form> <!-- /#discount_form --> > </div> <!-- /#applyDiscountModal --> > >+ <!-- Void payment modal --> >+ <div class="modal" id="voidPaymentModal" tabindex="-1" role="dialog" aria-labelledby="voidPaymentLabel"> >+ <form id="void_form" action="/cgi-bin/koha/members/boraccount.pl" method="post" enctype="multipart/form-data" class="validated"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="accountlines_id" value="" id="voidline"> >+ <input type="hidden" name="op" value="cud-void"> >+ <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="voidPaymentLabel">Void payment</h4> >+ </div> >+ <div class="modal-body"> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="apply_discount_note">Note: </label> >+ <input type="text" id="void_note" name="void_note"> >+ </li> >+ </ol> >+ </fieldset> <!-- /.rows --> >+ </div> <!-- /.modal-body --> >+ <div class="modal-footer"> >+ <button type="submit" class="btn btn-default">Confirm</button> >+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> >+ </div> <!-- /.modal-footer --> >+ </div> <!-- /.modal-content --> >+ </div> <!-- /.modal-dialog --> >+ </form> <!-- /#void_form --> >+ </div> <!-- /#voidPaymentModal --> >+ >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'format_price.inc' %] >@@ -436,14 +460,6 @@ > $(this).toggleClass('filtered'); > }); > >- $(".void-action").on("click",function(e){ >- if( confirm( _("Are you sure you want to void this credit?") ) ) { >- return true; >- } else { >- e.preventDefault(); >- } >- }); >- > $("#issuePayoutModal").on("shown.bs.modal", function(e){ > var button = $(e.relatedTarget); > var accountline = button.data('accountline'); >@@ -486,6 +502,14 @@ > $("#discount").focus(); > }); > >+ $("#voidPaymentModal").on("shown.bs.modal", function(e){ >+ var button = $(e.relatedTarget); >+ var item = button.data('item'); >+ $("#item + span").replaceWith(item); >+ var accountline = button.data('accountline'); >+ $('#voidline').val(accountline); >+ }); >+ > $(".receipt-email-action").on("click", function(e){ > e.preventDefault(); > return $(this).siblings('form').submit(); >diff --git a/members/boraccount.pl b/members/boraccount.pl >index ff5ff65047..6e9cd60047 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -73,11 +73,13 @@ if ( $op eq 'cud-void' ) { > output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' }); > my $payment_id = scalar $input->param('accountlines_id'); > my $payment = Koha::Account::Lines->find( $payment_id ); >+ my $note = scalar $input->param('void_note'); > $payment->void( > { > branch => $library_id, > staff_id => $logged_in_user->id, > interface => 'intranet', >+ note => $note > } > ); > } >-- >2.39.2
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 23674
:
168035
|
168036
|
168174
|
168177
|
168178
|
168180
|
168213
|
168329
|
168330
|
169782
|
169783
|
169784
|
169785
|
169786
|
169787
|
169788
|
174300
|
174301
|
174302
|
174303
|
174304
|
174305
|
174306
|
174307
|
174308