Bugzilla – Attachment 178796 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 canceled charge
Bug-23674-Add-ability-to-add-note-to-canceled-char.patch (text/plain), 7.09 KB, created by
Lucas Gass (lukeg)
on 2025-02-27 16:49:16 UTC
(
hide
)
Description:
Bug 23674: Add ability to add note to canceled charge
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-02-27 16:49:16 UTC
Size:
7.09 KB
patch
obsolete
>From 780bd41902df083b04b756fe98a807b80050ac74 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 1 Jul 2024 16:45:36 +0000 >Subject: [PATCH] Bug 23674: Add ability to add note to canceled charge > >To test, with this patchset applied: >1) From patron accounting page -> Add a manual invoice >2) Under the transaction tab click 'Cancel charge' >3) You should see a modal that gives you the option to type in a note. >4) Type something in and select submit. >5) Ensure the note shows up in the note column. > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Account/Line.pm | 1 + > .../prog/en/modules/members/boraccount.tt | 62 ++++++++++++++++--- > members/cancel-charge.pl | 11 ++-- > 3 files changed, 60 insertions(+), 14 deletions(-) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 9fa86bf0854..c796b92275a 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -420,6 +420,7 @@ sub cancel { > borrowernumber => $self->borrowernumber, > interface => 'intranet', > 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 6741a9130ae..58312636a76 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -193,15 +193,15 @@ > > > [% 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"> >- [% INCLUDE 'csrf-token.inc' %] >- <input type="hidden" name="op" value="cud-cancel" /> >- <input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]" /> >- <button type="submit" class="btn btn-default btn-xs cancel-action"> >- <i class="fa fa-ban"></i> >- Cancel charge >- </button> >- </form> >+ <button >+ type="button" >+ data-toggle="modal" >+ data-target="#cancelChargeModal" >+ data-accountlines_id="[% account.accountlines_id | html %]" >+ data-borrowernumber="[% patron.borrowernumber | html %]" >+ class="btn btn-default btn-xs void-action" >+ ><i class="fa fa-ban"></i> Cancel charge</button >+ > > [% END %] > [% IF CAN_user_updatecharges_payout && account.is_credit && ( account.amountoutstanding < 0 ) %] > <button >@@ -477,6 +477,44 @@ > </div> > <!-- /#voidPaymentModal --> > >+<!-- Cancel charge modal --> >+<div class="modal" id="cancelChargeModal" tabindex="-1" role="dialog" aria-labelledby="cancelChangreLabel"> >+ <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> >+ <input type="hidden" name="accountlines_id" id="accountlines_id" value="" /> >+ <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="cancelChargeLabel">Cancel charge</h4> >+ </div> >+ <div class="modal-body"> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="cancel_charge_note">Note: </label> >+ <input type="text" id="cnacel_charge_note" name="cancel_charge_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> >+ <!-- /#cancel_charge_form --> >+</div> >+<!-- /#voidPaymentModal --> >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'format_price.inc' %] >@@ -563,6 +601,12 @@ > $('#voidline').val(accountline); > }); > >+ $("#cancelChargeModal").on("shown.bs.modal", function(e){ >+ var button = $(e.relatedTarget); >+ var item = button.data('accountlines_id'); >+ $('#accountlines_id').val(item); >+ }); >+ > $(".receipt-email-action").on("click", function(e){ > e.preventDefault(); > return $(this).siblings('form').submit(); >diff --git a/members/cancel-charge.pl b/members/cancel-charge.pl >index bc7ab8160fd..54c3fd84e95 100755 >--- a/members/cancel-charge.pl >+++ b/members/cancel-charge.pl >@@ -35,14 +35,15 @@ my ( $user, $cookie ) = C4::Auth::checkauth( $cgi, $authnotrequired, $flags, $ty > my $op = $cgi->param('op') // q{}; > > if ( $op eq "cud-cancel" ) { >- my $accountlines_id = $cgi->param('accountlines_id'); >- >- my $charge = Koha::Account::Lines->find($accountlines_id); >- my $borrowernumber = $charge->patron->borrowernumber; >+ my $accountlines_id = $cgi->param('accountlines_id'); >+ my $cancel_charge_note = $cgi->param('cancel_charge_note'); >+ my $charge = Koha::Account::Lines->find($accountlines_id); >+ my $borrowernumber = $charge->patron->borrowernumber; > $charge->cancel( > { > branch => C4::Context->userenv->{'branch'}, >- staff_id => C4::Context->userenv->{'number'} >+ staff_id => C4::Context->userenv->{'number'}, >+ note => $cancel_charge_note, > } > ); > print $cgi->redirect( '/cgi-bin/koha/members/boraccount.pl?borrowernumber=' . $borrowernumber ); >-- >2.39.5
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
|
177225
|
177226
|
177227
|
177228
|
177229
|
177230
|
177231
|
177232
|
177233
|
178059
|
178060
|
178061
|
178062
|
178063
|
178064
|
178065
|
178066
|
178067
|
178791
|
178792
|
178793
|
178794
|
178795
| 178796 |
178797
|
178798
|
178799
|
178884
|
178885