Bugzilla – Attachment 3689 Details for
Bug 5605
Add Support for SIP Fee Paid Message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed Patch
0001-Bug-5605-SIP-Add-Support-for-the-Fee-Paid-Message.patch (text/plain), 4.21 KB, created by
Colin Campbell
on 2011-04-05 13:41:56 UTC
(
hide
)
Description:
Proposed Patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2011-04-05 13:41:56 UTC
Size:
4.21 KB
patch
obsolete
>From d84d6104bb8d91b91097eb73b54cae222a00a2df Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Sun, 9 Jan 2011 23:53:05 +0000 >Subject: [PATCH] Bug 5605 SIP: Add Support for the Fee Paid Message >Content-Type: text/plain; charset="utf-8" > >Allow fee paid to be supported for those machines which handle it > >Development Sponsered by Halton Borough Council >--- > C4/SIP/ILS.pm | 14 ++++++--- > C4/SIP/ILS/Transaction/FeePayment.pm | 52 ++++++++++++++++++++++++++++++---- > C4/SIP/Sip/MsgType.pm | 8 ++-- > 3 files changed, 59 insertions(+), 15 deletions(-) > >diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm >index 9e20845..7dc29a7 100644 >--- a/C4/SIP/ILS.pm >+++ b/C4/SIP/ILS.pm >@@ -32,7 +32,7 @@ my %supports = ( > "login" => 1, > "patron information" => 1, > "end patron session" => 1, >- "fee paid" => 0, >+ "fee paid" => 1, > "item information" => 1, > "item status update" => 0, > "patron enable" => 1, >@@ -214,14 +214,18 @@ sub pay_fee { > my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type, > $pay_type, $fee_id, $trans_id, $currency) = @_; > my $trans; >- my $patron; > >-# $trans = new ILS::Transaction::FeePayment; >+ $trans = ILS::Transaction::FeePayment->new(); > >- $patron = new ILS::Patron $patron_id; > > $trans->transaction_id($trans_id); >- $trans->patron($patron); >+ my $patron; >+ $trans->patron($patron = ILS::Patron->new($patron_id)); >+ if (!$patron) { >+ $trans->screen_msg('Invalid patron barcode.'); >+ return $trans; >+ } >+ $trans->pay($patron->{borrowernumber},$fee_amt); > $trans->ok(1); > > return $trans; >diff --git a/C4/SIP/ILS/Transaction/FeePayment.pm b/C4/SIP/ILS/Transaction/FeePayment.pm >index 8a156b7..3026296 100644 >--- a/C4/SIP/ILS/Transaction/FeePayment.pm >+++ b/C4/SIP/ILS/Transaction/FeePayment.pm >@@ -3,16 +3,56 @@ package ILS::Transaction::FeePayment; > use warnings; > use strict; > >+# Copyright 2011 PTFS-Europe Ltd. >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use C4::Accounts qw(recordpayment); >+use ILS; >+use base qw(ILS::Transaction); >+ > use vars qw($VERSION @ISA $debug); > >-BEGIN { >- $VERSION = 1.00; >- @ISA = qw(ILS::Transaction); >- $debug = 0; >+our $debug = 0; >+our $VERSION = 1.00; >+ >+my %fields = (); >+ >+sub new { >+ my $class = shift; >+ my $self = $class->SUPER::new(); >+ >+ foreach ( keys %fields ) { >+ $self->{_permitted}->{$_} = $fields{$_}; # overlaying _permitted >+ } >+ >+ @{$self}{ keys %fields } = values %fields; # copying defaults into object >+ return bless $self, $class; > } > >-use ILS; >-use ILS::Transaction; >+sub pay { >+ my $self = shift; >+ my $borrowernumber = shift; >+ my $amt = shift; >+ warn("RECORD:$borrowernumber::$amt"); >+ recordpayment( $borrowernumber, $amt ); >+} >+ >+#sub DESTROY { >+#} > > 1; > __END__ >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index 508a06b..e2cb3da 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -176,13 +176,13 @@ my %handlers = ( > handler => \&handle_fee_paid, > protocol => { > 2 => { >- template => "A18A2A3", >- template_len => 0, >+ template => "A18A2A2A3", >+ template_len => 25, > fields => [(FID_FEE_AMT), (FID_INST_ID), > (FID_PATRON_ID), (FID_TERMINAL_PWD), > (FID_PATRON_PWD), (FID_FEE_ID), >- (FID_TRANSACTION_ID)], >- } >+ (FID_TRANSACTION_ID)], >+ } > } > }, > (ITEM_INFORMATION) => { >-- >1.7.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 5605
: 3689