Paged transaction inquiries optimized for maximum links in Sales and Purchasing.
[fa-stable.git] / sales / inquiry / customer_inquiry.php
index eb98d3dad278b040f247b8df3a2f75d7d4dd7bb7..4674989f729a5309669e483c321ed1ea2f9f473b 100644 (file)
@@ -70,9 +70,15 @@ function credit_link($row)
 
        if ($page_nested)
                return '';
-       return $row['type'] == ST_SALESINVOICE && $row["Outstanding"] > 0 ?
-               pager_link(_("Credit This") ,
-                       "/sales/customer_credit_invoice.php?InvoiceNumber=". $row['trans_no'], ICON_CREDIT):'';
+       if ($row["Outstanding"] > 0)
+       {
+               if ($row['type'] == ST_CUSTDELIVERY)
+                       return pager_link(_('Invoice'), "/sales/customer_invoice.php?DeliveryNumber=" 
+                               .$row['trans_no'], ICON_DOC);
+               else if ($row['type'] == ST_SALESINVOICE)
+                       return pager_link(_("Credit This") ,
+                       "/sales/customer_credit_invoice.php?InvoiceNumber=". $row['trans_no'], ICON_CREDIT);
+       }       
 }
 
 function edit_link($row)