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 (-3 / +18 lines)
Lines 20-26 use strict; Link Here
20
# You should have received a copy of the GNU General Public License
20
# You should have received a copy of the GNU General Public License
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 C4::Accounts qw(recordpayment);
23
use C4::Accounts qw(recordpayment makepayment);
24
use Koha::Account::Lines;
24
use parent qw(C4::SIP::ILS::Transaction);
25
use parent qw(C4::SIP::ILS::Transaction);
25
26
26
27
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
    recordpayment( $borrowernumber, $amt,$type );
52
53
    if ($fee_id) {
54
        my $fee = Koha::Account::Lines->find( $fee_id );
55
        if ( $fee && $fee->amountoutstanding == $amt ) {
56
            makepayment( $fee_id, $borrowernumber, undef, $amt );
57
            return 1;
58
        } else {
59
            return 0;
60
        }
61
    }
62
    else {
63
        recordpayment( $borrowernumber, $amt, $type );
64
        return 1;
65
    }
50
}
66
}
51
67
52
#sub DESTROY {
68
#sub DESTROY {
53
- 

Return to bug 16757