Bug 5512: Customer Allocation Inquiry - No alloc-icon for DEBET-Accounts-receivable...
[fa-stable.git] / sales / inquiry / customer_allocation_inquiry.php
index 5630f04d20facd74821acb5918f19a9266f9c6ff..7dd21b43b7d7a4109dc1d27f9a6946f44f034381 100644 (file)
@@ -114,9 +114,10 @@ function alloc_link($row)
        {
                /*its a negative receipt */
                return '';
-       } elseif (($row["type"] == ST_SALESINVOICE && ($row['TotalAmount'] - $row['Allocated']) > 0) || $row["type"] == ST_BANKPAYMENT)
+       } elseif (($row["type"] == ST_SALESINVOICE && ($row['TotalAmount'] - $row['Allocated']) > 0) || 
+               ($row["type"] == ST_JOURNAL && (ABS($row['TotalAmount']) - $row['Allocated']) > 0) || $row["type"] == ST_BANKPAYMENT)
                return pager_link(_("Payment"),
-                       "/sales/customer_payments.php?customer_id=".$row["debtor_no"]."&SInvoice=" . $row["trans_no"], ICON_MONEY);
+                       "/sales/customer_payments.php?customer_id=".$row["debtor_no"]."&SInvoice=" . $row["trans_no"]."&Type=".$row["type"], ICON_MONEY);
 
 }