Cosmetic fix in viewing supp invoice payments section.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 2 May 2012 23:03:08 +0000 (01:03 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 2 May 2012 23:03:08 +0000 (01:03 +0200)
includes/ui/ui_view.inc

index e366af368f085e0aee7051d550782f4ae24bb8ec..8ffad405f1e1a045bc7e799e4bf7310ff9716129 100644 (file)
@@ -500,9 +500,10 @@ function display_allocations($alloc_result, $total, $payments=false)
        label_cell(sql2date($alloc_row['tran_date']));
        $alloc_row['Total'] = round2($alloc_row['Total'], user_price_dec());
        $alloc_row['amt'] = round2($alloc_row['amt'], user_price_dec());
+       if ($payments && ($alloc_row['type'] == ST_SUPPAYMENT || $alloc_row['type'] == ST_BANKPAYMENT))
+               $alloc_row['Total'] = -$alloc_row['Total'];
        amount_cell($alloc_row['Total']);
-       //amount_cell($alloc_row['Total'] - $alloc_row['PrevAllocs'] - $alloc_row['amt']);
-       amount_cell($alloc_row['Total'] - $alloc_row['amt']);
+               amount_cell($alloc_row['Total'] - $alloc_row['amt']);
        amount_cell($alloc_row['amt']);
        end_row();