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

(-)a/C4/SIP/ILS/Transaction/FeePayment.pm (-29 / +14 lines)
Lines 57-78 sub pay { Link Here
57
        return { ok => 0 } if $account->balance < $amt;
57
        return { ok => 0 } if $account->balance < $amt;
58
    }
58
    }
59
59
60
    my $pay_options = {
61
        amount        => $amt,
62
        type          => $type,
63
        payment_type  => 'SIP' . $sip_type,
64
        interface     => C4::Context->interface,
65
        cash_register => $register_id,
66
    };
67
60
    if ($fee_id) {
68
    if ($fee_id) {
61
        my $fee = Koha::Account::Lines->find($fee_id);
69
        my $fee = Koha::Account::Lines->find($fee_id);
62
        if ( $fee ) {
70
        if ( $fee ) {
63
            my $pay_response = $account->pay(
71
            $pay_options->{lines} = [$fee];
64
                {
65
                    amount       => $amt,
66
                    type         => $type,
67
                    payment_type => 'SIP' . $sip_type,
68
                    lines        => [$fee],
69
                    interface    => C4::Context->interface
70
                }
71
            );
72
            return {
73
                ok           => 1,
74
                pay_response => $pay_response
75
            };
76
        }
72
        }
77
        else {
73
        else {
78
            return {
74
            return {
Lines 80-100 sub pay { Link Here
80
            };
76
            };
81
        }
77
        }
82
    }
78
    }
83
    else {
79
    my $pay_response = $account->pay($pay_options);
84
        my $pay_response = $account->pay(
80
    return {
85
            {
81
        ok           => 1,
86
                amount        => $amt,
82
        pay_response => $pay_response
87
                type          => $type,
83
    };
88
                payment_type  => 'SIP' . $sip_type,
89
                interface     => C4::Context->interface,
90
                cash_register => $register_id
91
            }
92
        );
93
        return {
94
            ok           => 1,
95
            pay_response => $pay_response
96
        };
97
    }
98
}
84
}
99
85
100
#sub DESTROY {
86
#sub DESTROY {
101
- 

Return to bug 29385