Bugzilla – Attachment 120017 Details for
Bug 24300
Add a 'payout amount' option to accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24300: Add payout amount to boraccount page
Bug-24300-Add-payout-amount-to-boraccount-page.patch (text/plain), 3.85 KB, created by
Martin Renvoize (ashimema)
on 2021-04-22 16:07:06 UTC
(
hide
)
Description:
Bug 24300: Add payout amount to boraccount page
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-04-22 16:07:06 UTC
Size:
3.85 KB
patch
obsolete
>From 01be37bd0533c983e4b71231d7d8b42710213ecc Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 5 Feb 2021 15:11:37 +0000 >Subject: [PATCH] Bug 24300: Add payout amount to boraccount page > >Test plan >1/ Add some debts and credits to a patrons account, resulting in an >overall credit >2/ Note the appearance of a 'Payout amount' button next to the total due >line. >3/ Try paying out an amount with the button >4/ Signoff > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../prog/en/modules/members/boraccount.tt | 7 ++- > members/boraccount.pl | 49 +++++++++++++------ > 2 files changed, 39 insertions(+), 17 deletions(-) > >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 191e9d3731..7b0f34fd80 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -143,10 +143,15 @@ > <td colspan="12">Total due</td> > [% IF ( totalcredit ) %] > <td class="credit" style="text-align: right;">[% total | $Price %]</td> >+ <td> >+ [% IF CAN_user_updatecharges_payout %] >+ <button type="button" data-toggle="modal" data-target="#issuePayoutModal" data-amount="[% total | $Price %]" class="btn btn-default btn-xs"><i class="fa fa-money"></i> Payout amount</button> >+ [% END %] >+ </td> > [% ELSE %] > <td class="debit"style="text-align: right;">[% total | $Price %]</td> >+ <td></td> > [% END %] >- <td></td> > </tr> > </tfoot> > </table> >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 7bd550940d..0fec75ed59 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -76,24 +76,41 @@ if ( $action eq 'void' ) { > } > > if ( $action eq 'payout' ) { >- my $payment_id = scalar $input->param('accountlines_id'); >- my $payment = Koha::Account::Lines->find($payment_id); >+ my $payment_id = scalar $input->param('accountlines_id'); > my $amount = scalar $input->param('amount'); > my $payout_type = scalar $input->param('payout_type'); >- $schema->txn_do( >- sub { >- my $payout = $payment->payout( >- { >- payout_type => $payout_type, >- branch => $library_id, >- staff_id => $logged_in_user->id, >- cash_register => $registerid, >- interface => 'intranet', >- amount => $amount >- } >- ); >- } >- ); >+ if ( $payment_id eq "" ) { >+ $schema->txn_do( >+ sub { >+ $patron->account->payout_amount( >+ { >+ payout_type => $payout_type, >+ branch => $library_id, >+ staff_id => $logged_in_user->id, >+ cash_register => $registerid, >+ interface => 'intranet', >+ amount => $amount >+ } >+ ); >+ } >+ ); >+ } else { >+ my $payment = Koha::Account::Lines->find($payment_id); >+ $schema->txn_do( >+ sub { >+ my $payout = $payment->payout( >+ { >+ payout_type => $payout_type, >+ branch => $library_id, >+ staff_id => $logged_in_user->id, >+ cash_register => $registerid, >+ interface => 'intranet', >+ amount => $amount >+ } >+ ); >+ } >+ ); >+ } > } > > if ( $action eq 'refund' ) { >-- >2.20.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 24300
:
116395
|
116412
|
116413
|
116837
|
116838
|
117917
|
117918
|
117919
|
118335
|
118392
|
118393
|
118394
|
118395
|
118396
|
118464
|
118503
|
118601
|
118602
|
118603
|
118604
|
118605
|
118606
|
118612
|
119195
|
119196
|
119197
|
119198
|
119199
|
119200
|
120016
| 120017 |
120018
|
120019
|
120020
|
120021