A bug in Customer Allocations fixed.
[fa-stable.git] / sales / inquiry / customer_allocation_inquiry.php
index 2bd2d58e38f94c1d648e87065280d04c84f539fc..5630f04d20facd74821acb5918f19a9266f9c6ff 100644 (file)
@@ -87,7 +87,7 @@ function due_date($row)
 
 function fmt_balance($row)
 {
-       return $row["TotalAmount"] - $row["Allocated"];
+       return ($row["type"] == ST_JOURNAL && $row["TotalAmount"] < 0 ? -$row["TotalAmount"] : $row["TotalAmount"]) - $row["Allocated"];
 }
 
 function alloc_link($row)