Bug 5512: Customer Allocation Inquiry - No alloc-icon for DEBET-Accounts-receivable...
[fa-stable.git] / sales / inquiry / customer_inquiry.php
index 989e6ddd61467bbea0b0814fa932cedf384e9e43..5bdbe785e4b7f4fcee10767fc09fed31718d6a74 100644 (file)
@@ -58,9 +58,13 @@ function gl_view($row)
 
 function fmt_amount($row)
 {
+       /*
        $value =
-           $row['type']==ST_CUSTCREDIT || $row['type']==ST_CUSTPAYMENT || $row['type']==ST_BANKDEPOSIT || $row['type']==ST_JOURNAL ?
-               -$row["TotalAmount"] : $row["TotalAmount"];
+           $row['type']==ST_CUSTCREDIT || $row['type']==ST_CUSTPAYMENT || $row['type']==ST_BANKDEPOSIT || 
+               ($row['type']==ST_JOURNAL && $row['TotalAmount'] < 0) ? -$row["TotalAmount"] : $row["TotalAmount"];
+       */      
+       $value =
+           $row['type']==ST_CUSTCREDIT || $row['type']==ST_CUSTPAYMENT || $row['type']==ST_BANKDEPOSIT ? -$row["TotalAmount"] : $row["TotalAmount"];
     return price_format($value);
 }
 
@@ -106,7 +110,7 @@ function prt_link($row)
 function check_overdue($row)
 {
        return $row['OverDue'] == 1
-               && floatcmp($row["TotalAmount"], $row["Allocated"]) != 0;
+               && floatcmp(ABS($row["TotalAmount"]), $row["Allocated"]) != 0;
 }
 //------------------------------------------------------------------------------------------------