Lines 60-67
Koha::Account->new( { patron_id => $borrowernumber } )->pay(
Link Here
|
60 |
note => $note, |
60 |
note => $note, |
61 |
description => $description, |
61 |
description => $description, |
62 |
library_id => $branchcode, |
62 |
library_id => $branchcode, |
63 |
lines => $lines, # Arrayref of Koha::Account::Line objects to pay |
63 |
lines => $lines, # Arrayref of Koha::Account::Line objects to pay |
64 |
account_type => $type, # accounttype code |
64 |
credit_type => $type, # credit_type_code code |
65 |
offset_type => $offset_type, # offset type code |
65 |
offset_type => $offset_type, # offset type code |
66 |
} |
66 |
} |
67 |
); |
67 |
); |
Lines 78-84
sub pay {
Link Here
|
78 |
my $lines = $params->{lines}; |
78 |
my $lines = $params->{lines}; |
79 |
my $type = $params->{type} || 'payment'; |
79 |
my $type = $params->{type} || 'payment'; |
80 |
my $payment_type = $params->{payment_type} || undef; |
80 |
my $payment_type = $params->{payment_type} || undef; |
81 |
my $account_type = $params->{account_type}; |
81 |
my $credit_type = $params->{credit_type}; |
82 |
my $offset_type = $params->{offset_type} || $type eq 'writeoff' ? 'Writeoff' : 'Payment'; |
82 |
my $offset_type = $params->{offset_type} || $type eq 'writeoff' ? 'Writeoff' : 'Payment'; |
83 |
my $cash_register = $params->{cash_register}; |
83 |
my $cash_register = $params->{cash_register}; |
84 |
|
84 |
|
Lines 215-221
sub pay {
Link Here
|
215 |
last unless $balance_remaining > 0; |
215 |
last unless $balance_remaining > 0; |
216 |
} |
216 |
} |
217 |
|
217 |
|
218 |
$account_type ||= |
218 |
$credit_type ||= |
219 |
$type eq 'writeoff' |
219 |
$type eq 'writeoff' |
220 |
? 'W' |
220 |
? 'W' |
221 |
: 'Pay'; |
221 |
: 'Pay'; |
Lines 228-234
sub pay {
Link Here
|
228 |
date => dt_from_string(), |
228 |
date => dt_from_string(), |
229 |
amount => 0 - $amount, |
229 |
amount => 0 - $amount, |
230 |
description => $description, |
230 |
description => $description, |
231 |
accounttype => $account_type, |
231 |
credit_type_code => $credit_type, |
232 |
payment_type => $payment_type, |
232 |
payment_type => $payment_type, |
233 |
amountoutstanding => 0 - $balance_remaining, |
233 |
amountoutstanding => 0 - $balance_remaining, |
234 |
manager_id => $manager_id, |
234 |
manager_id => $manager_id, |
Lines 263-269
sub pay {
Link Here
|
263 |
borrowernumber => $self->{patron_id}, |
263 |
borrowernumber => $self->{patron_id}, |
264 |
amount => 0 - $amount, |
264 |
amount => 0 - $amount, |
265 |
amountoutstanding => 0 - $balance_remaining, |
265 |
amountoutstanding => 0 - $balance_remaining, |
266 |
accounttype => $account_type, |
266 |
credit_type_code => $credit_type, |
267 |
accountlines_paid => \@fines_paid, |
267 |
accountlines_paid => \@fines_paid, |
268 |
manager_id => $manager_id, |
268 |
manager_id => $manager_id, |
269 |
} |
269 |
} |
Lines 360-366
sub add_credit {
Link Here
|
360 |
|
360 |
|
361 |
my $schema = Koha::Database->new->schema; |
361 |
my $schema = Koha::Database->new->schema; |
362 |
|
362 |
|
363 |
my $account_type = $Koha::Account::account_type_credit->{$type}; |
363 |
my $credit_type = $Koha::Account::account_type_credit->{$type}; |
364 |
my $line; |
364 |
my $line; |
365 |
|
365 |
|
366 |
$schema->txn_do( |
366 |
$schema->txn_do( |
Lines 372-378
sub add_credit {
Link Here
|
372 |
date => \'NOW()', |
372 |
date => \'NOW()', |
373 |
amount => $amount, |
373 |
amount => $amount, |
374 |
description => $description, |
374 |
description => $description, |
375 |
accounttype => $account_type, |
375 |
credit_type_code => $credit_type, |
376 |
amountoutstanding => $amount, |
376 |
amountoutstanding => $amount, |
377 |
payment_type => $payment_type, |
377 |
payment_type => $payment_type, |
378 |
note => $note, |
378 |
note => $note, |
Lines 410-416
sub add_credit {
Link Here
|
410 |
amount => $amount, |
410 |
amount => $amount, |
411 |
description => $description, |
411 |
description => $description, |
412 |
amountoutstanding => $amount, |
412 |
amountoutstanding => $amount, |
413 |
accounttype => $account_type, |
413 |
credit_type_code => $credit_type, |
414 |
note => $note, |
414 |
note => $note, |
415 |
itemnumber => $item_id, |
415 |
itemnumber => $item_id, |
416 |
manager_id => $user_id, |
416 |
manager_id => $user_id, |