Merge remote-tracking branch 'origin/new/bug_5604'
[koha.git] / C4 / SIP / ILS / Transaction / FeePayment.pm
1 package ILS::Transaction::FeePayment;
2
3 use warnings;
4 use strict;
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
27 use vars qw($VERSION @ISA $debug);
28
29 our $debug   = 0;
30 our $VERSION = 1.00;
31
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;
44 }
45
46 sub pay {
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 #}
56
57 1;
58 __END__
59