From 611e31c5abfcf01c05bb95df7d39c3794a6d0991 Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
Date: Thu, 13 Aug 2015 12:03:15 -0300
Subject: [PATCH] Bug 11229: (followup) makepartialpayment fix

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>
---
 C4/Accounts.pm | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/C4/Accounts.pm b/C4/Accounts.pm
index d798b34..9ca87e3 100644
--- a/C4/Accounts.pm
+++ b/C4/Accounts.pm
@@ -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({
-- 
2.1.0