Bugzilla – Attachment 169787 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.57 KB, created by
Roman Dolny
on 2024-07-26 19:55:19 UTC
(
hide
)
Description:
Bug 23674: Add ability to add note to canceled charge
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-26 19:55:19 UTC
Size:
6.57 KB
patch
obsolete
>From 45ace04cc1c3f4e61215995a36b083d43ef28f99 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> >--- > 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 aee9ea3f8a..249f50023e 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -436,6 +436,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 f7f7d44830..4cf0e44460 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -179,15 +179,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="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 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-toggle="modal" data-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> >@@ -425,6 +417,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' %] >@@ -510,6 +533,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 5748fa54c4..ac95397233 100755 >--- a/members/cancel-charge.pl >+++ b/members/cancel-charge.pl >@@ -34,12 +34,13 @@ my ($user, $cookie) = C4::Auth::checkauth($cgi, $authnotrequired, $flags, $type) > > my $borrowernumber = $cgi->param('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); > $charge->cancel( > { > branch => C4::Context->userenv->{'branch'}, >- staff_id => C4::Context->userenv->{'number'} >+ staff_id => C4::Context->userenv->{'number'}, >+ note => $cancel_charge_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
|
177225
|
177226
|
177227
|
177228
|
177229
|
177230
|
177231
|
177232
|
177233