Bug 21801: Make paycollect.pl pass library_id when calling ->pay
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 9 Nov 2018 14:33:59 +0000 (11:33 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 4 Jul 2019 12:56:24 +0000 (13:56 +0100)
This patch makes paycollect store the branchcode of the current library
when payments are done.

- Try all the possible options, specially selecting things to pay for (not
using the individual buttons).
- Check on the DB, that the  accountlines for the patron you're playin
with have the branchcode stored correctly in all cases:
  $ sudo koha-mysql kohadev
  > SELECT * FROM accountlines WHERE borrowernumber=<the_bn>;
=> SUCCESS: Things are as expected
- SIgn off :-D

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

members/paycollect.pl

index f105c8e..eb7f892 100755 (executable)
@@ -157,6 +157,7 @@ if ( $total_paid and $total_paid ne '0.00' ) {
                     {
                         type         => $type,
                         amount       => $total_paid,
+                        library_id   => $branch,
                         lines        => \@lines,
                         note         => $note,
                         interface    => C4::Context->interface,
@@ -169,6 +170,7 @@ if ( $total_paid and $total_paid ne '0.00' ) {
                 Koha::Account->new( { patron_id => $borrowernumber } )->pay(
                     {
                         amount       => $total_paid,
+                        library_id   => $branch,
                         note         => $note,
                         payment_type => $payment_type,
                         interface    => C4::Context->interface