Bugzilla – Attachment 53262 Details for
Bug 16757
Add ability to pay fee by id for SIP2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16757 - Add ability to pay fee by id for SIP2
Bug-16757---Add-ability-to-pay-fee-by-id-for-SIP2.patch (text/plain), 3.21 KB, created by
Kyle M Hall (khall)
on 2016-07-11 11:33:10 UTC
(
hide
)
Description:
Bug 16757 - Add ability to pay fee by id for SIP2
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-07-11 11:33:10 UTC
Size:
3.21 KB
patch
obsolete
>From d620651d8b24381caf6b7bd7e6f29a63e0d32840 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 16 Jun 2016 14:50:44 +0000 >Subject: [PATCH] Bug 16757 - Add ability to pay fee by id for SIP2 > >The SIP protocol allows for a Fee Paid message to specify a fee >identifier in the CG field. While this field is read and passed to >C4::SIP::ILS::pay_fee, it is not passed along to >C4::SIP::ILS::Transaction::FeePayment::pay and is thus not used. We >should enable this functionality in Koha now that accountlines each have >a unique identifier that can be passed along to the payment requestor >via the AV field line items added by bug 14512. > >Test Plan: >1) Create a fee in Koha >2) Ensure your SIP2 server is running and configured correctly >3) Send a 37 Fee Paid message to Koha's SIP server with the > accountlines_id for that fee in the CG fee identifier field, > along with the other required fields. >4) Note that specific fee was paid in Koha >--- > C4/SIP/ILS.pm | 8 +++----- > C4/SIP/ILS/Transaction/FeePayment.pm | 20 ++++++++++++++++++-- > 2 files changed, 21 insertions(+), 7 deletions(-) > >diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm >index 7a40777..dba0ccb 100644 >--- a/C4/SIP/ILS.pm >+++ b/C4/SIP/ILS.pm >@@ -247,13 +247,11 @@ sub end_patron_session { > } > > sub pay_fee { >- my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type, >- $pay_type, $fee_id, $trans_id, $currency) = @_; >+ my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency) = @_; > my $trans; > > $trans = C4::SIP::ILS::Transaction::FeePayment->new(); > >- > $trans->transaction_id($trans_id); > my $patron; > $trans->patron($patron = C4::SIP::ILS::Patron->new($patron_id)); >@@ -261,8 +259,8 @@ sub pay_fee { > $trans->screen_msg('Invalid patron barcode.'); > return $trans; > } >- $trans->pay($patron->{borrowernumber},$fee_amt, $pay_type); >- $trans->ok(1); >+ my $ok =$trans->pay($patron->{borrowernumber},$fee_amt, $pay_type, $fee_id); >+ $trans->ok($ok); > > return $trans; > } >diff --git a/C4/SIP/ILS/Transaction/FeePayment.pm b/C4/SIP/ILS/Transaction/FeePayment.pm >index 4d0e381..ea71a98 100644 >--- a/C4/SIP/ILS/Transaction/FeePayment.pm >+++ b/C4/SIP/ILS/Transaction/FeePayment.pm >@@ -20,7 +20,8 @@ use strict; > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use C4::Accounts qw(recordpayment); >+use C4::Accounts qw(recordpayment makepayment); >+use Koha::Account::Lines; > use parent qw(C4::SIP::ILS::Transaction); > > >@@ -45,8 +46,23 @@ sub pay { > my $borrowernumber = shift; > my $amt = shift; > my $type = shift; >+ my $fee_id = shift; >+ > warn("RECORD:$borrowernumber::$amt"); >- recordpayment( $borrowernumber, $amt,$type ); >+ >+ if ($fee_id) { >+ my $fee = Koha::Account::Lines->find( $fee_id ); >+ if ( $fee && $fee->amountoutstanding == $amt ) { >+ makepayment( $fee_id, $borrowernumber, undef, $amt ); >+ return 1; >+ } else { >+ return 0; >+ } >+ } >+ else { >+ recordpayment( $borrowernumber, $amt, $type ); >+ return 1; >+ } > } > > #sub DESTROY { >-- >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 16757
:
52468
|
52470
|
52472
|
53261
|
53262
|
53263
|
55612
|
55613
|
61375
|
61376
|
61607
|
61608