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

(-)a/C4/SIP/ILS.pm (-5 / +3 lines)
Lines 247-259 sub end_patron_session { Link Here
247
}
247
}
248
248
249
sub pay_fee {
249
sub pay_fee {
250
    my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type,
250
    my ($self, $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency) = @_;
251
	$pay_type, $fee_id, $trans_id, $currency) = @_;
252
    my $trans;
251
    my $trans;
253
252
254
    $trans = C4::SIP::ILS::Transaction::FeePayment->new();
253
    $trans = C4::SIP::ILS::Transaction::FeePayment->new();
255
254
256
257
    $trans->transaction_id($trans_id);
255
    $trans->transaction_id($trans_id);
258
    my $patron;
256
    my $patron;
259
    $trans->patron($patron = C4::SIP::ILS::Patron->new($patron_id));
257
    $trans->patron($patron = C4::SIP::ILS::Patron->new($patron_id));
Lines 261-268 sub pay_fee { Link Here
261
        $trans->screen_msg('Invalid patron barcode.');
259
        $trans->screen_msg('Invalid patron barcode.');
262
        return $trans;
260
        return $trans;
263
    }
261
    }
264
    $trans->pay($patron->{borrowernumber},$fee_amt, $pay_type);
262
    my $ok =$trans->pay($patron->{borrowernumber},$fee_amt, $pay_type, $fee_id);
265
    $trans->ok(1);
263
    $trans->ok($ok);
266
264
267
    return $trans;
265
    return $trans;
268
}
266
}
(-)a/C4/SIP/ILS/Transaction/FeePayment.pm (-4 / +22 lines)
Lines 21-30 use strict; Link Here
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
22
22
23
use Koha::Account;
23
use Koha::Account;
24
use parent qw(C4::SIP::ILS::Transaction);
24
use Koha::Account::Lines;
25
25
26
use parent qw(C4::SIP::ILS::Transaction);
26
27
27
our $debug   = 0;
28
our $debug = 0;
28
29
29
my %fields = ();
30
my %fields = ();
30
31
Lines 45-52 sub pay { Link Here
45
    my $borrowernumber = shift;
46
    my $borrowernumber = shift;
46
    my $amt            = shift;
47
    my $amt            = shift;
47
    my $type           = shift;
48
    my $type           = shift;
49
    my $fee_id         = shift;
50
48
    warn("RECORD:$borrowernumber::$amt");
51
    warn("RECORD:$borrowernumber::$amt");
49
    Koha::Account->new( { patron_id => $borrowernumber } )->pay( { amount => $amt, sip => $type } );
52
53
    my $account = Koha::Account->new( { patron_id => $borrowernumber } );
54
55
    if ($fee_id) {
56
        my $fee = Koha::Account::Lines->find($fee_id);
57
        if ( $fee && $fee->amountoutstanding == $amt ) {
58
            $account->pay( { amount => $amt, sip => $type, lines => [$fee] } );
59
            return 1;
60
        }
61
        else {
62
            return 0;
63
        }
64
    }
65
    else {
66
        $account->pay( { amount => $amt, sip => $type } );
67
        return 1;
68
    }
50
}
69
}
51
70
52
#sub DESTROY {
71
#sub DESTROY {
53
- 

Return to bug 16757