Changed so total in bank payments/deposits shows correctly if negative amount are...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 6 Sep 2009 11:41:13 +0000 (11:41 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 6 Sep 2009 11:41:13 +0000 (11:41 +0000)
CHANGELOG.txt
gl/includes/ui/gl_bank_ui.inc

index 0ce4cb305c3f8b0ae77b9cbc5f079d9cc7c54be9..7a2bedd509531071385694cbfe4c5958069b58c7 100644 (file)
@@ -22,6 +22,8 @@ $ -> Affected files
 05-Sep-2009 Joe Hunt
 # Changed Class Type to Class Name in GL Account groups
 $ /gl/manage/gl_account_types.php
+# Changed so total in bank payments/deposits shows correctly if negative amount are entered.
+$ /gl/includes/ui/gl_bank_ui.inc
 
 30-Aug-2009 Janusz Dobrowolski
 # Fixed sql error during sales order line update with line cancelation.
index ee3af8089a13ef184c36df2fcbeecc922a356cfc..3a22184e9d8324e5093f770750963596ce148ffe 100644 (file)
@@ -168,8 +168,12 @@ function display_gl_items($title, &$order)
                gl_edit_item_controls($order, $dim);
 
        if ($order->count_gl_items())
-               label_row(_("Total"), number_format2(abs($order->gl_items_total()), user_price_dec()),"colspan=" . $colspan . " align=right", "align=right",3);
-
+       {
+               $total = $order->gl_items_total();
+               if ($order->trans_type == systypes::bank_deposit())
+                       $total *= -1;
+               label_row(_("Total"), number_format2($total, user_price_dec()),"colspan=" . $colspan . " align=right", "align=right",3);
+       }
     end_table();
        div_end();
 }