Bugzilla – Attachment 118602 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.88 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-22 14:42:19 UTC
(
hide
)
Description:
Bug 24300: Add payout amount to boraccount page
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-22 14:42:19 UTC
Size:
3.88 KB
patch
obsolete
>From 22692bfe7e95aad2cd8e434233c7b5979264141f 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 f2be33ab51a..a411db62bc1 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 35930810be2..ebe69db39c2 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.31.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