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 |
} |
357 |
} |
Lines 381-387
sub add_credit {
Link Here
|
381 |
manager_id => $user_id, |
389 |
manager_id => $user_id, |
382 |
branchcode => $library_id, |
390 |
branchcode => $library_id, |
383 |
} |
391 |
} |
384 |
) |
392 |
), |
|
|
393 |
$interface |
385 |
); |
394 |
); |
386 |
} |
395 |
} |
387 |
} |
396 |
} |
Lines 400-405
my $debit_line = Koha::Account->new({ patron_id => $patron_id })->add_debit(
Link Here
|
400 |
description => $description, |
409 |
description => $description, |
401 |
note => $note, |
410 |
note => $note, |
402 |
user_id => $user_id, |
411 |
user_id => $user_id, |
|
|
412 |
interface => $interface, |
403 |
library_id => $library_id, |
413 |
library_id => $library_id, |
404 |
type => $debit_type, |
414 |
type => $debit_type, |
405 |
item_id => $item_id, |
415 |
item_id => $item_id, |
Lines 436-441
sub add_debit {
Link Here
|
436 |
my $description = $params->{description} // q{}; |
446 |
my $description = $params->{description} // q{}; |
437 |
my $note = $params->{note} // q{}; |
447 |
my $note = $params->{note} // q{}; |
438 |
my $user_id = $params->{user_id}; |
448 |
my $user_id = $params->{user_id}; |
|
|
449 |
my $interface = $params->{interface}; |
439 |
my $library_id = $params->{library_id}; |
450 |
my $library_id = $params->{library_id}; |
440 |
my $type = $params->{type}; |
451 |
my $type = $params->{type}; |
441 |
my $item_id = $params->{item_id}; |
452 |
my $item_id = $params->{item_id}; |
Lines 467-472
sub add_debit {
Link Here
|
467 |
payment_type => undef, |
478 |
payment_type => undef, |
468 |
note => $note, |
479 |
note => $note, |
469 |
manager_id => $user_id, |
480 |
manager_id => $user_id, |
|
|
481 |
interface => $interface, |
470 |
itemnumber => $item_id, |
482 |
itemnumber => $item_id, |
471 |
issue_id => $issue_id, |
483 |
issue_id => $issue_id, |
472 |
branchcode => $library_id, |
484 |
branchcode => $library_id, |
Lines 496-502
sub add_debit {
Link Here
|
496 |
itemnumber => $item_id, |
508 |
itemnumber => $item_id, |
497 |
manager_id => $user_id, |
509 |
manager_id => $user_id, |
498 |
} |
510 |
} |
499 |
) |
511 |
), |
|
|
512 |
$interface |
500 |
); |
513 |
); |
501 |
} |
514 |
} |
502 |
} |
515 |
} |