Bug 11229: (followup) makepartialpayment fix
authorTomas Cohen Arazi <tomascohen@unc.edu.ar>
Thu, 13 Aug 2015 15:03:15 +0000 (12:03 -0300)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Tue, 18 Aug 2015 16:18:21 +0000 (13:18 -0300)
makepartialpayment() wasn't logging the branch either. This patch
fixes that too.

To test:
- Run (with the regression tests applied)
  $ prove t/db_dependent/Accounts.t
=> FAIL: tests fail because makepartialpayment is not logging the branch code
- Apply the patch
- Run
  $ prove t/db_dependent/Accounts.t
=> SUCCESS: tests pass
- Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
C4/Accounts.pm

index d798b34..9ca87e3 100644 (file)
@@ -276,12 +276,12 @@ sub makepayment {
     }
 
     UpdateStats({
-                branch => $branch,
-                type => 'payment',
-                amount => $amount,
-                borrowernumber => $borrowernumber,
-                accountno => $accountno}
-    );
+        branch => $branch,
+        type   => 'payment',
+        amount => $amount,
+        borrowernumber => $borrowernumber,
+        accountno => $accountno
+    });
 
     #check to see what accounttype
     if ( $data->{'accounttype'} eq 'Rep' || $data->{'accounttype'} eq 'L' ) {
@@ -726,12 +726,12 @@ sub makepartialpayment {
         '', 'Pay', $data->{'itemnumber'}, $manager_id, $payment_note);
 
     UpdateStats({
-                branch => $user,
-                type => 'payment',
-                amount => $amount,
-                borrowernumber => $borrowernumber,
-                accountno => $accountno}
-    );
+        branch => $branch,
+        type   => 'payment',
+        amount => $amount,
+        borrowernumber => $borrowernumber,
+        accountno => $accountno
+    });
 
     if ( C4::Context->preference("FinesLog") ) {
         logaction("FINES", 'CREATE',$borrowernumber,Dumper({