Bugzilla – Attachment 48339 Details for
Bug 15902
Remove use of recordpayment in process_koc.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15902 - Remove use of recordpayment in process_koc.pl
Bug-15902---Remove-use-of-recordpayment-in-process.patch (text/plain), 2.08 KB, created by
Kyle M Hall (khall)
on 2016-02-24 15:32:14 UTC
(
hide
)
Description:
Bug 15902 - Remove use of recordpayment in process_koc.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-02-24 15:32:14 UTC
Size:
2.08 KB
patch
obsolete
>From b1906957b58b22695afd9b69491fe41db11e239a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 24 Feb 2016 15:23:32 +0000 >Subject: [PATCH] Bug 15902 - Remove use of recordpayment in process_koc.pl > >Test plan: >1) Apply this patch >2) Create an offline circ payment >3) Process the offline circ payment >4) Payment should show in Koha >--- > offline_circ/process_koc.pl | 35 +++++++++++++++++++++++------------ > 1 file changed, 23 insertions(+), 12 deletions(-) > >diff --git a/offline_circ/process_koc.pl b/offline_circ/process_koc.pl >index 8381b1b..1875166 100755 >--- a/offline_circ/process_koc.pl >+++ b/offline_circ/process_koc.pl >@@ -22,6 +22,8 @@ use strict; > use warnings; > > use CGI qw ( -utf8 ); >+use Carp; >+ > use C4::Output; > use C4::Auth; > use C4::Koha; >@@ -32,8 +34,9 @@ use C4::Circulation; > use C4::Items; > use C4::Members; > use C4::Stats; >-use Koha::Upload; > use C4::BackgroundJob; >+use Koha::Upload; >+use Koha::Account; > > use Date::Calc qw( Add_Delta_Days Date_to_Days ); > >@@ -356,17 +359,25 @@ sub kocReturnItem { > } > > sub kocMakePayment { >- my ( $circ ) = @_; >- my $borrower = GetMember( 'cardnumber'=>$circ->{ 'cardnumber' } ); >- recordpayment( $borrower->{'borrowernumber'}, $circ->{'amount'} ); >- push @output, { >- payment => 1, >- amount => $circ->{'amount'}, >- firstname => $borrower->{'firstname'}, >- surname => $borrower->{'surname'}, >- cardnumber => $circ->{'cardnumber'}, >- borrower => $borrower->{'borrowernumber'} >- }; >+ my ($circ) = @_; >+ >+ my $cardnumber = $circ->{cardnumber}; >+ my $amount = $circ->{amount}; >+ >+ my $patron = Koha::Borrowers->find( { cardnumber => $cardnumber } ); >+ >+ Koha::Account->new( { patron_id => $patron->id } ) >+ ->pay( { amount => $amount } ); >+ >+ push @output, >+ { >+ payment => 1, >+ amount => $circ->{'amount'}, >+ firstname => $patron->firstname, >+ surname => $patron->surname, >+ cardnumber => $patron->cardnumber, >+ borrower => $patron->id, >+ }; > } > > =head2 _get_borrowernumber_from_barcode >-- >2.1.4
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 15902
:
48339
|
52144
|
54748
|
55260
|
55875
|
55876
|
55880
|
55881