Bug 24492: (RM follow-up) Varaible name corretion
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 09:36:35 +0000 (10:36 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 6 Apr 2020 09:38:00 +0000 (10:38 +0100)
Bug 24492 was not correctly rebased after bug 23355 and did not account
for a variable name change in the 'add_cashup' action. This patch deals
with that.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
pos/registers.pl

index fafaf64..620b45d 100755 (executable)
@@ -56,20 +56,21 @@ else {
 my $op = $input->param('op') // '';
 if ( $op eq 'cashup' ) {
     my $registerid = $input->param('registerid');
-    if ( $registerid ) {
+    if ($registerid) {
         my $register = Koha::Cash::Registers->find( { id => $registerid } );
         $register->add_cashup(
             {
-                user_id => $logged_in_user->id,
-                amount  => $register->outstanding_accountlines->total
+                manager_id => $logged_in_user->id,
+                amount     => $register->outstanding_accountlines->total
             }
         );
-    } else {
+    }
+    else {
         for my $register ( $registers->as_list ) {
             $register->add_cashup(
                 {
-                    user_id => $logged_in_user->id,
-                    amount  => $register->outstanding_accountlines->total
+                    manager_id => $logged_in_user->id,
+                    amount     => $register->outstanding_accountlines->total
                 }
             );
         }