Bugzilla – Attachment 116838 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.84 KB, created by
ByWater Sandboxes
on 2021-02-12 15:52:18 UTC
(
hide
)
Description:
Bug 24300: Add payout amount to boraccount page
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2021-02-12 15:52:18 UTC
Size:
3.84 KB
patch
obsolete
>From 7a318f2176a0e92b6ee965e6f98a80e60c931652 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> >--- > .../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 b23267b970..b329be8971 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -129,10 +129,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 35930810be..ebe69db39c 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 $transaction_type = scalar $input->param('transaction_type'); >- $schema->txn_do( >- sub { >- my $payout = $payment->payout( >- { >- payout_type => $transaction_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 => $transaction_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 => $transaction_type, >+ branch => $library_id, >+ staff_id => $logged_in_user->id, >+ cash_register => $registerid, >+ interface => 'intranet', >+ amount => $amount >+ } >+ ); >+ } >+ ); >+ } > } > > if ( $action eq 'refund' ) { >-- >2.11.0
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