View | Details | Raw Unified | Return to bug 5605
Collapse All | Expand All

(-)a/C4/SIP/ILS.pm (-5 / +9 lines)
Lines 32-38 my %supports = ( Link Here
32
    "login"                 => 1,
32
    "login"                 => 1,
33
    "patron information"    => 1,
33
    "patron information"    => 1,
34
    "end patron session"    => 1,
34
    "end patron session"    => 1,
35
    "fee paid"              => 0,
35
    "fee paid"              => 1,
36
    "item information"      => 1,
36
    "item information"      => 1,
37
    "item status update"    => 0,
37
    "item status update"    => 0,
38
    "patron enable"         => 1,
38
    "patron enable"         => 1,
Lines 214-227 sub pay_fee { Link Here
214
    my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type,
214
    my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type,
215
	$pay_type, $fee_id, $trans_id, $currency) = @_;
215
	$pay_type, $fee_id, $trans_id, $currency) = @_;
216
    my $trans;
216
    my $trans;
217
    my $patron;
218
217
219
#    $trans = new ILS::Transaction::FeePayment;
218
    $trans = ILS::Transaction::FeePayment->new();
220
219
221
    $patron = new ILS::Patron $patron_id;
222
220
223
    $trans->transaction_id($trans_id);
221
    $trans->transaction_id($trans_id);
224
    $trans->patron($patron);
222
    my $patron;
223
    $trans->patron($patron = ILS::Patron->new($patron_id));
224
    if (!$patron) {
225
        $trans->screen_msg('Invalid patron barcode.');
226
        return $trans;
227
    }
228
    $trans->pay($patron->{borrowernumber},$fee_amt);
225
    $trans->ok(1);
229
    $trans->ok(1);
226
230
227
    return $trans;
231
    return $trans;
(-)a/C4/SIP/ILS/Transaction/FeePayment.pm (-6 / +46 lines)
Lines 3-18 package ILS::Transaction::FeePayment; Link Here
3
use warnings;
3
use warnings;
4
use strict;
4
use strict;
5
5
6
# Copyright 2011 PTFS-Europe Ltd.
7
#
8
# This file is part of Koha.
9
#
10
# Koha is free software; you can redistribute it and/or modify it under the
11
# terms of the GNU General Public License as published by the Free Software
12
# Foundation; either version 2 of the License, or (at your option) any later
13
# version.
14
#
15
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License along
20
# with Koha; if not, write to the Free Software Foundation, Inc.,
21
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
23
use C4::Accounts qw(recordpayment);
24
use ILS;
25
use base qw(ILS::Transaction);
26
6
use vars qw($VERSION @ISA $debug);
27
use vars qw($VERSION @ISA $debug);
7
28
8
BEGIN {
29
our $debug   = 0;
9
	$VERSION = 1.00;
30
our $VERSION = 1.00;
10
	@ISA = qw(ILS::Transaction);
31
11
	$debug = 0;
32
my %fields = ();
33
34
sub new {
35
    my $class = shift;
36
    my $self  = $class->SUPER::new();
37
38
    foreach ( keys %fields ) {
39
        $self->{_permitted}->{$_} = $fields{$_};    # overlaying _permitted
40
    }
41
42
    @{$self}{ keys %fields } = values %fields;    # copying defaults into object
43
    return bless $self, $class;
12
}
44
}
13
45
14
use ILS;
46
sub pay {
15
use ILS::Transaction;
47
    my $self           = shift;
48
    my $borrowernumber = shift;
49
    my $amt            = shift;
50
    warn("RECORD:$borrowernumber::$amt");
51
    recordpayment( $borrowernumber, $amt );
52
}
53
54
#sub DESTROY {
55
#}
16
56
17
1;
57
1;
18
__END__
58
__END__
(-)a/C4/SIP/Sip/MsgType.pm (-5 / +4 lines)
Lines 176-188 my %handlers = ( Link Here
176
		    handler => \&handle_fee_paid,
176
		    handler => \&handle_fee_paid,
177
		    protocol => {
177
		    protocol => {
178
			2 => {
178
			2 => {
179
			    template => "A18A2A3",
179
			    template => "A18A2A2A3",
180
			    template_len => 0,
180
			    template_len => 25,
181
			    fields => [(FID_FEE_AMT), (FID_INST_ID),
181
			    fields => [(FID_FEE_AMT), (FID_INST_ID),
182
				       (FID_PATRON_ID), (FID_TERMINAL_PWD),
182
				       (FID_PATRON_ID), (FID_TERMINAL_PWD),
183
				       (FID_PATRON_PWD), (FID_FEE_ID),
183
				       (FID_PATRON_PWD), (FID_FEE_ID),
184
				       (FID_TRANSACTION_ID)],
184
                       (FID_TRANSACTION_ID)],
185
			}
185
               }
186
		    }
186
		    }
187
		},
187
		},
188
		(ITEM_INFORMATION) => {
188
		(ITEM_INFORMATION) => {
189
- 

Return to bug 5605