Bugzilla – Attachment 177230 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), 6.75 KB, created by
Martin Renvoize (ashimema)
on 2025-01-28 09:36:38 UTC
(
hide
)
Description:
Bug 23674: Add ability to add note to canceled charge
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-01-28 09:36:38 UTC
Size:
6.75 KB
patch
obsolete
>From e2df13913a999cc83e0dd9cedf7b79f0638bc842 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 | 47 +++++++++++++++---- > members/cancel-charge.pl | 5 +- > 3 files changed, 42 insertions(+), 11 deletions(-) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 805cf0856a4..3b72cd1c94a 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -443,6 +443,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 f1a729b9e89..d7910d91025 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -178,15 +178,7 @@ > <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"> >- [% 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 type="button" data-bs-toggle="modal" data-bs-target="#issuePayoutModal" data-account="[%- PROCESS account_type_description account=account -%]" data-accountline="[% account.accountlines_id | html %]" data-amount="[% account.amountoutstanding | $Price on_editing => 1 %]" class="btn btn-default btn-xs payout-action"><i class="fa-solid fa-money-bill-1"></i> Issue payout</button> >@@ -424,6 +416,37 @@ > </form> <!-- /#void_form --> > </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' %] >@@ -509,6 +532,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 0b6d756cd03..5b96b0711b3 100755 >--- a/members/cancel-charge.pl >+++ b/members/cancel-charge.pl >@@ -36,13 +36,14 @@ my $op = $cgi->param('op') // q{}; > > if ( $op eq "cud-cancel" ) { > 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.48.1
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