|
Lines 56-62
This method allows payments to be made against fees/fines
Link Here
|
| 56 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
56 |
Koha::Account->new( { patron_id => $borrowernumber } )->pay( |
| 57 |
{ |
57 |
{ |
| 58 |
amount => $amount, |
58 |
amount => $amount, |
| 59 |
sip => $sipmode, |
|
|
| 60 |
note => $note, |
59 |
note => $note, |
| 61 |
description => $description, |
60 |
description => $description, |
| 62 |
library_id => $branchcode, |
61 |
library_id => $branchcode, |
|
Lines 72-78
sub pay {
Link Here
|
| 72 |
my ( $self, $params ) = @_; |
71 |
my ( $self, $params ) = @_; |
| 73 |
|
72 |
|
| 74 |
my $amount = $params->{amount}; |
73 |
my $amount = $params->{amount}; |
| 75 |
my $sip = $params->{sip}; |
|
|
| 76 |
my $description = $params->{description}; |
74 |
my $description = $params->{description}; |
| 77 |
my $note = $params->{note} || q{}; |
75 |
my $note = $params->{note} || q{}; |
| 78 |
my $library_id = $params->{library_id}; |
76 |
my $library_id = $params->{library_id}; |
|
Lines 199-207
sub pay {
Link Here
|
| 199 |
} |
197 |
} |
| 200 |
|
198 |
|
| 201 |
$account_type ||= |
199 |
$account_type ||= |
| 202 |
$type eq 'writeoff' ? 'W' |
200 |
$type eq 'writeoff' |
| 203 |
: defined($sip) ? "Pay$sip" |
201 |
? 'W' |
| 204 |
: 'Pay'; |
202 |
: 'Pay'; |
| 205 |
|
203 |
|
| 206 |
$description ||= $type eq 'writeoff' ? 'Writeoff' : q{}; |
204 |
$description ||= $type eq 'writeoff' ? 'Writeoff' : q{}; |
| 207 |
|
205 |
|
|
Lines 297-303
my $credit_line = Koha::Account->new({ patron_id => $patron_id })->add_credit(
Link Here
|
| 297 |
user_id => $user_id, |
295 |
user_id => $user_id, |
| 298 |
interface => $interface, |
296 |
interface => $interface, |
| 299 |
library_id => $library_id, |
297 |
library_id => $library_id, |
| 300 |
sip => $sip, |
|
|
| 301 |
payment_type => $payment_type, |
298 |
payment_type => $payment_type, |
| 302 |
type => $credit_type, |
299 |
type => $credit_type, |
| 303 |
item_id => $item_id |
300 |
item_id => $item_id |
|
Lines 324-330
sub add_credit {
Link Here
|
| 324 |
my $user_id = $params->{user_id}; |
321 |
my $user_id = $params->{user_id}; |
| 325 |
my $interface = $params->{interface}; |
322 |
my $interface = $params->{interface}; |
| 326 |
my $library_id = $params->{library_id}; |
323 |
my $library_id = $params->{library_id}; |
| 327 |
my $sip = $params->{sip}; |
|
|
| 328 |
my $payment_type = $params->{payment_type}; |
324 |
my $payment_type = $params->{payment_type}; |
| 329 |
my $type = $params->{type} || 'payment'; |
325 |
my $type = $params->{type} || 'payment'; |
| 330 |
my $item_id = $params->{item_id}; |
326 |
my $item_id = $params->{item_id}; |
|
Lines 338-347
sub add_credit {
Link Here
|
| 338 |
my $schema = Koha::Database->new->schema; |
334 |
my $schema = Koha::Database->new->schema; |
| 339 |
|
335 |
|
| 340 |
my $account_type = $Koha::Account::account_type_credit->{$type}; |
336 |
my $account_type = $Koha::Account::account_type_credit->{$type}; |
| 341 |
$account_type .= $sip |
|
|
| 342 |
if defined $sip && |
| 343 |
$type eq 'payment'; |
| 344 |
|
| 345 |
my $line; |
337 |
my $line; |
| 346 |
|
338 |
|
| 347 |
$schema->txn_do( |
339 |
$schema->txn_do( |