Lines 86-91
sub pay {
Link Here
|
86 |
my $patron = Koha::Patrons->find( $self->{patron_id} ); |
86 |
my $patron = Koha::Patrons->find( $self->{patron_id} ); |
87 |
|
87 |
|
88 |
my $manager_id = $userenv ? $userenv->{number} : 0; |
88 |
my $manager_id = $userenv ? $userenv->{number} : 0; |
|
|
89 |
my $interface = $params ? ( $params->{interface} || C4::Context->interface ) : C4::Context->interface; |
89 |
|
90 |
|
90 |
my @fines_paid; # List of account lines paid on with this payment |
91 |
my @fines_paid; # List of account lines paid on with this payment |
91 |
|
92 |
|
Lines 135-141
sub pay {
Link Here
|
135 |
manager_id => $manager_id, |
136 |
manager_id => $manager_id, |
136 |
note => $note, |
137 |
note => $note, |
137 |
} |
138 |
} |
138 |
) |
139 |
), |
|
|
140 |
$interface |
139 |
); |
141 |
); |
140 |
push( @fines_paid, $fine->id ); |
142 |
push( @fines_paid, $fine->id ); |
141 |
} |
143 |
} |
Lines 185-191
sub pay {
Link Here
|
185 |
manager_id => $manager_id, |
187 |
manager_id => $manager_id, |
186 |
note => $note, |
188 |
note => $note, |
187 |
} |
189 |
} |
188 |
) |
190 |
), |
|
|
191 |
$interface |
189 |
); |
192 |
); |
190 |
push( @fines_paid, $fine->id ); |
193 |
push( @fines_paid, $fine->id ); |
191 |
} |
194 |
} |
Lines 211-216
sub pay {
Link Here
|
211 |
payment_type => $payment_type, |
214 |
payment_type => $payment_type, |
212 |
amountoutstanding => 0 - $balance_remaining, |
215 |
amountoutstanding => 0 - $balance_remaining, |
213 |
manager_id => $manager_id, |
216 |
manager_id => $manager_id, |
|
|
217 |
interface => $interface, |
214 |
branchcode => $library_id, |
218 |
branchcode => $library_id, |
215 |
note => $note, |
219 |
note => $note, |
216 |
} |
220 |
} |
Lines 244-250
sub pay {
Link Here
|
244 |
accountlines_paid => \@fines_paid, |
248 |
accountlines_paid => \@fines_paid, |
245 |
manager_id => $manager_id, |
249 |
manager_id => $manager_id, |
246 |
} |
250 |
} |
247 |
) |
251 |
), |
|
|
252 |
$interface |
248 |
); |
253 |
); |
249 |
} |
254 |
} |
250 |
|
255 |
|
Lines 289-294
my $credit_line = Koha::Account->new({ patron_id => $patron_id })->add_credit(
Link Here
|
289 |
description => $description, |
294 |
description => $description, |
290 |
note => $note, |
295 |
note => $note, |
291 |
user_id => $user_id, |
296 |
user_id => $user_id, |
|
|
297 |
interface => $interface, |
292 |
library_id => $library_id, |
298 |
library_id => $library_id, |
293 |
sip => $sip, |
299 |
sip => $sip, |
294 |
payment_type => $payment_type, |
300 |
payment_type => $payment_type, |
Lines 315-320
sub add_credit {
Link Here
|
315 |
my $description = $params->{description} // q{}; |
321 |
my $description = $params->{description} // q{}; |
316 |
my $note = $params->{note} // q{}; |
322 |
my $note = $params->{note} // q{}; |
317 |
my $user_id = $params->{user_id}; |
323 |
my $user_id = $params->{user_id}; |
|
|
324 |
my $interface = $params->{interface}; |
318 |
my $library_id = $params->{library_id}; |
325 |
my $library_id = $params->{library_id}; |
319 |
my $sip = $params->{sip}; |
326 |
my $sip = $params->{sip}; |
320 |
my $payment_type = $params->{payment_type}; |
327 |
my $payment_type = $params->{payment_type}; |
Lines 344-349
sub add_credit {
Link Here
|
344 |
payment_type => $payment_type, |
351 |
payment_type => $payment_type, |
345 |
note => $note, |
352 |
note => $note, |
346 |
manager_id => $user_id, |
353 |
manager_id => $user_id, |
|
|
354 |
interface => $interface, |
347 |
branchcode => $library_id, |
355 |
branchcode => $library_id, |
348 |
itemnumber => $item_id, |
356 |
itemnumber => $item_id, |
349 |
lastincrement => undef, |
357 |
lastincrement => undef, |
Lines 382-388
sub add_credit {
Link Here
|
382 |
manager_id => $user_id, |
390 |
manager_id => $user_id, |
383 |
branchcode => $library_id, |
391 |
branchcode => $library_id, |
384 |
} |
392 |
} |
385 |
) |
393 |
), |
|
|
394 |
$interface |
386 |
); |
395 |
); |
387 |
} |
396 |
} |
388 |
} |
397 |
} |
Lines 401-406
my $debit_line = Koha::Account->new({ patron_id => $patron_id })->add_debit(
Link Here
|
401 |
description => $description, |
410 |
description => $description, |
402 |
note => $note, |
411 |
note => $note, |
403 |
user_id => $user_id, |
412 |
user_id => $user_id, |
|
|
413 |
interface => $interface, |
404 |
library_id => $library_id, |
414 |
library_id => $library_id, |
405 |
type => $debit_type, |
415 |
type => $debit_type, |
406 |
item_id => $item_id, |
416 |
item_id => $item_id, |
Lines 437-442
sub add_debit {
Link Here
|
437 |
my $description = $params->{description} // q{}; |
447 |
my $description = $params->{description} // q{}; |
438 |
my $note = $params->{note} // q{}; |
448 |
my $note = $params->{note} // q{}; |
439 |
my $user_id = $params->{user_id}; |
449 |
my $user_id = $params->{user_id}; |
|
|
450 |
my $interface = $params->{interface}; |
440 |
my $library_id = $params->{library_id}; |
451 |
my $library_id = $params->{library_id}; |
441 |
my $type = $params->{type}; |
452 |
my $type = $params->{type}; |
442 |
my $item_id = $params->{item_id}; |
453 |
my $item_id = $params->{item_id}; |
Lines 468-473
sub add_debit {
Link Here
|
468 |
payment_type => undef, |
479 |
payment_type => undef, |
469 |
note => $note, |
480 |
note => $note, |
470 |
manager_id => $user_id, |
481 |
manager_id => $user_id, |
|
|
482 |
interface => $interface, |
471 |
itemnumber => $item_id, |
483 |
itemnumber => $item_id, |
472 |
issue_id => $issue_id, |
484 |
issue_id => $issue_id, |
473 |
branchcode => $library_id, |
485 |
branchcode => $library_id, |
Lines 498-504
sub add_debit {
Link Here
|
498 |
itemnumber => $item_id, |
510 |
itemnumber => $item_id, |
499 |
manager_id => $user_id, |
511 |
manager_id => $user_id, |
500 |
} |
512 |
} |
501 |
) |
513 |
), |
|
|
514 |
$interface |
502 |
); |
515 |
); |
503 |
} |
516 |
} |
504 |
} |
517 |
} |