|
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 |
}; |
| 66 |
|
| 60 |
if ($fee_id) { |
67 |
if ($fee_id) { |
| 61 |
my $fee = Koha::Account::Lines->find($fee_id); |
68 |
my $fee = Koha::Account::Lines->find($fee_id); |
| 62 |
if ( $fee ) { |
69 |
if ( $fee ) { |
| 63 |
my $pay_response = $account->pay( |
70 |
$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 |
} |
71 |
} |
| 77 |
else { |
72 |
else { |
| 78 |
return { |
73 |
return { |
|
Lines 80-100
sub pay {
Link Here
|
| 80 |
}; |
75 |
}; |
| 81 |
} |
76 |
} |
| 82 |
} |
77 |
} |
| 83 |
else { |
78 |
my $pay_response = $account->pay($pay_options); |
| 84 |
my $pay_response = $account->pay( |
79 |
return { |
| 85 |
{ |
80 |
ok => 1, |
| 86 |
amount => $amt, |
81 |
pay_response => $pay_response |
| 87 |
type => $type, |
82 |
}; |
| 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 |
} |
83 |
} |
| 99 |
|
84 |
|
| 100 |
#sub DESTROY { |
85 |
#sub DESTROY { |
| 101 |
- |
|
|