Bugzilla – Attachment 91200 Details for
Bug 21801
paycollect.pl should pass library_id when adding accountlines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21801: (follow-up) Use ->account
Bug-21801-follow-up-Use--account.patch (text/plain), 3.31 KB, created by
Mark Tompsett
on 2019-07-03 02:29:06 UTC
(
hide
)
Description:
Bug 21801: (follow-up) Use ->account
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2019-07-03 02:29:06 UTC
Size:
3.31 KB
patch
obsolete
>From 5b77b008390d93c12e7af0f83cc66bc0242d27b0 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 9 Nov 2018 11:58:10 -0300 >Subject: [PATCH] Bug 21801: (follow-up) Use ->account > >This patch is a minor refactoring, that reuses the $account object we >already get from $patron, instead of creating new ones all over the >place. Code gets simpler to read too. > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > members/paycollect.pl | 21 +++++++++------------ > 1 file changed, 9 insertions(+), 12 deletions(-) > >diff --git a/members/paycollect.pl b/members/paycollect.pl >index eb7f892a60..1cb6cbe41a 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -57,11 +57,12 @@ my $patron = Koha::Patrons->find( $borrowernumber ); > output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); > > my $borrower = $patron->unblessed; >+my $account = $patron->account; > my $category = $patron->category; > my $user = $input->remote_user; > >-my $branch = C4::Context->userenv->{'branch'}; >-my $total_due = $patron->account->outstanding_debits->total_outstanding; >+my $library_id = C4::Context->userenv->{'branch'}; >+my $total_due = $account->outstanding_debits->total_outstanding; > > my $total_paid = $input->param('paid'); > >@@ -120,11 +121,11 @@ if ( $total_paid and $total_paid ne '0.00' ) { > > if ($pay_individual) { > my $line = Koha::Account::Lines->find($accountlines_id); >- Koha::Account->new( { patron_id => $borrowernumber } )->pay( >+ $account->pay( > { > lines => [$line], > amount => $total_paid, >- library_id => $branch, >+ library_id => $library_id, > note => $payment_note, > interface => C4::Context->interface, > payment_type => $payment_type, >@@ -149,15 +150,11 @@ if ( $total_paid and $total_paid ne '0.00' ) { > { order_by => 'date' } > ); > >- Koha::Account->new( >- { >- patron_id => $borrowernumber, >- } >- )->pay( >+ $account->pay( > { > type => $type, > amount => $total_paid, >- library_id => $branch, >+ library_id => $library_id, > lines => \@lines, > note => $note, > interface => C4::Context->interface, >@@ -167,10 +164,10 @@ if ( $total_paid and $total_paid ne '0.00' ) { > } > else { > my $note = $input->param('selected_accts_notes'); >- Koha::Account->new( { patron_id => $borrowernumber } )->pay( >+ $account->pay( > { > amount => $total_paid, >- library_id => $branch, >+ library_id => $library_id, > note => $note, > payment_type => $payment_type, > interface => C4::Context->interface >-- >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 21801
:
82172
|
82173
|
91199
|
91200
|
91248
|
91249