function dispatch_link($row)
{
- global $trans_type;
+ global $trans_type, $page_nested;
if ($row['ord_payments'] + $row['inv_payments'] < $row['prep_amount'])
return '';
if ($trans_type == ST_SALESORDER)
- return pager_link( _("Dispatch"),
- "/sales/customer_delivery.php?OrderNumber=" .$row['order_no'], ICON_DOC);
+ {
+ if ($row['TotDelivered'] < $row['TotQuantity'] && !$page_nested)
+ return pager_link( _("Dispatch"),
+ "/sales/customer_delivery.php?OrderNumber=" .$row['order_no'], ICON_DOC);
+ else
+ return '';
+ }
else
return pager_link( _("Sales Order"),
"/sales/sales_order_entry.php?OrderNumber=" .$row['order_no'], ICON_DOC);
} elseif ($trans_type == ST_SALESORDER) {
array_append($cols,array(
_("Tmpl") => array('insert'=>true, 'fun'=>'tmpl_checkbox'),
+ array('insert'=>true, 'fun'=>'dispatch_link'),
array('insert'=>true, 'fun'=>'edit_link'),
array('insert'=>true, 'fun'=>'prt_link')));
};