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 211-219
sub pay {
Link Here
|
211 |
} |
209 |
} |
212 |
|
210 |
|
213 |
$account_type ||= |
211 |
$account_type ||= |
214 |
$type eq 'writeoff' ? 'W' |
212 |
$type eq 'writeoff' |
215 |
: defined($sip) ? "Pay$sip" |
213 |
? 'W' |
216 |
: 'Pay'; |
214 |
: 'Pay'; |
217 |
|
215 |
|
218 |
$description ||= $type eq 'writeoff' ? 'Writeoff' : q{}; |
216 |
$description ||= $type eq 'writeoff' ? 'Writeoff' : q{}; |
219 |
|
217 |
|
Lines 309-315
my $credit_line = Koha::Account->new({ patron_id => $patron_id })->add_credit(
Link Here
|
309 |
user_id => $user_id, |
307 |
user_id => $user_id, |
310 |
interface => $interface, |
308 |
interface => $interface, |
311 |
library_id => $library_id, |
309 |
library_id => $library_id, |
312 |
sip => $sip, |
|
|
313 |
payment_type => $payment_type, |
310 |
payment_type => $payment_type, |
314 |
type => $credit_type, |
311 |
type => $credit_type, |
315 |
item_id => $item_id |
312 |
item_id => $item_id |
Lines 336-342
sub add_credit {
Link Here
|
336 |
my $user_id = $params->{user_id}; |
333 |
my $user_id = $params->{user_id}; |
337 |
my $interface = $params->{interface}; |
334 |
my $interface = $params->{interface}; |
338 |
my $library_id = $params->{library_id}; |
335 |
my $library_id = $params->{library_id}; |
339 |
my $sip = $params->{sip}; |
|
|
340 |
my $payment_type = $params->{payment_type}; |
336 |
my $payment_type = $params->{payment_type}; |
341 |
my $type = $params->{type} || 'payment'; |
337 |
my $type = $params->{type} || 'payment'; |
342 |
my $item_id = $params->{item_id}; |
338 |
my $item_id = $params->{item_id}; |
Lines 350-359
sub add_credit {
Link Here
|
350 |
my $schema = Koha::Database->new->schema; |
346 |
my $schema = Koha::Database->new->schema; |
351 |
|
347 |
|
352 |
my $account_type = $Koha::Account::account_type_credit->{$type}; |
348 |
my $account_type = $Koha::Account::account_type_credit->{$type}; |
353 |
$account_type .= $sip |
|
|
354 |
if defined $sip && |
355 |
$type eq 'payment'; |
356 |
|
357 |
my $line; |
349 |
my $line; |
358 |
|
350 |
|
359 |
$schema->txn_do( |
351 |
$schema->txn_do( |