Bug 20629: (follow-up) fix reverse_col value
authorMark Tompsett <mtompset@hotmail.com>
Mon, 15 Oct 2018 18:50:09 +0000 (18:50 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 6 Nov 2018 16:32:42 +0000 (16:32 +0000)
Before this patch the Void button didn't appear.
After this patch the Void button appears on payments.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

members/boraccount.pl

index 7f94bf2..9677819 100755 (executable)
@@ -79,7 +79,9 @@ if($total <= 0){
         $totalcredit = 1;
 }
 
-my $reverse_col = 0; # Flag whether we need to show the reverse column
+my $reverse_col = ( Koha::Account::Lines->search(
+    { borrowernumber => $patron->borrowernumber },
+    { where => { amount => { '<=', 0 } } } )->count > 0 ) ? 1 : 0;
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
     my $attributes = GetBorrowerAttributes($borrowernumber);