Bugzilla – Attachment 163746 Details for
Bug 24597
Add ability to add note on all payment/writeoff screens
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24597: Add Void payment modal and ability to add a Void payment note
Bug-24597-Add-Void-payment-modal-and-ability-to-ad.patch (text/plain), 7.06 KB, created by
Lucas Gass (lukeg)
on 2024-03-22 21:58:55 UTC
(
hide
)
Description:
Bug 24597: Add Void payment modal and ability to add a Void payment note
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-03-22 21:58:55 UTC
Size:
7.06 KB
patch
obsolete
>From c27e61636f3ceb6b4b8085c24a919c202b34e628 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 22 Mar 2024 21:57:14 +0000 >Subject: [PATCH] Bug 24597: Add Void payment modal and ability to add a Void > payment note > >--- > Koha/Account/Line.pm | 1 + > .../prog/en/includes/modals/void_payment.inc | 35 +++++++++++++++++++ > .../prog/en/modules/members/boraccount.tt | 28 ++++++--------- > members/boraccount.pl | 2 ++ > 4 files changed, 48 insertions(+), 18 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/modals/void_payment.inc > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 7496f17677..bdb8988fce 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -301,6 +301,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/includes/modals/void_payment.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/void_payment.inc >new file mode 100644 >index 0000000000..e2f565c8da >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/void_payment.inc >@@ -0,0 +1,35 @@ >+<!-- 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="op" value="cud-void" /> >+ <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"> >+ <input id="voidline" type="hidden" name="accountlines_id"> >+ <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="applyDiscountLabel">Void payment</h4> >+ </div> >+ <div class="modal-body"> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <span class="label">Amount to void: </span> >+ <span id="void_amount"></span> >+ </li> >+ <li> >+ <span class="label">Note:</span> >+ <textarea id="void_note" name="void_note"></textarea> >+ </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> >+</div> <!-- /#voidPayment modal --> >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 16aceab48f..9e2d6a5294 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-account="[%- PROCESS account_type_description account=account -%]" data-accountline="[% account.accountlines_id | html %]" data-amount="[% account.amount | $Price on_editing => 1 %]" class="btn btn-default btn-xs void-action"><i class="fa-solid 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"> >@@ -245,6 +236,7 @@ > [% INCLUDE 'modals/issue_payout.inc' %] > [% INCLUDE 'modals/issue_refund.inc' %] > [% INCLUDE 'modals/issue_refund.inc' %] >+ [% INCLUDE 'modals/void_payment.inc' %] > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >@@ -280,14 +272,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'); >@@ -330,6 +314,14 @@ > $("#discount").focus(); > }); > >+ $("#voidPaymentModal").on("shown.bs.modal", function(e){ >+ var button = $(e.relatedTarget); >+ var accountline = button.data('accountline'); >+ $('#voidline').val(accountline); >+ var amount = button.data('amount'); >+ $('#void_amount').text(amount); >+ }); >+ > $(".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 707dc4b279..733f49dca3 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -72,12 +72,14 @@ my $registerid = $input->param('registerid'); > 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 $void_note = scalar $input->param('void_note'); > my $payment = Koha::Account::Lines->find( $payment_id ); > $payment->void( > { > branch => $library_id, > staff_id => $logged_in_user->id, > interface => 'intranet', >+ note => $void_note, > } > ); > } >-- >2.30.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 24597
:
163745
| 163746