if (get_post('type'))
$trans_type = $_POST['type'];
-elseif (isset($_GET['type']) && $_GET['type'] == 32)
- $trans_type = 32;
+elseif (isset($_GET['type']) && $_GET['type'] == ST_SALESQUOTE)
+ $trans_type = ST_SALESQUOTE;
else
- $trans_type = 30;
-if ($trans_type == 30)
+ $trans_type = ST_SALESORDER;
+if ($trans_type == ST_SALESORDER)
{
if (isset($_GET['OutstandingOnly']) && ($_GET['OutstandingOnly'] == true))
{
function check_overdue($row)
{
global $trans_type;
- if ($trans_type == 32)
+ if ($trans_type == ST_SALESQUOTE)
return (date1_greater_date2(Today(), sql2date($row['delivery_date'])));
else
return ($row['type'] == 0
function edit_link($row)
{
global $trans_type;
- $modify = ($trans_type == 30 ? "ModifyOrderNumber" : "ModifyQuotationNumber");
+ $modify = ($trans_type == ST_SALESORDER ? "ModifyOrderNumber" : "ModifyQuotationNumber");
return pager_link( _("Edit"),
"/sales/sales_order_entry.php?$modify=" . $row['order_no'], ICON_EDIT);
}
function dispatch_link($row)
{
global $trans_type;
- if ($trans_type == 30)
+ if ($trans_type == ST_SALESORDER)
return pager_link( _("Dispatch"),
"/sales/customer_delivery.php?OrderNumber=" .$row['order_no'], ICON_DOC);
else
function invoice_link($row)
{
global $trans_type;
- if ($trans_type == 30)
+ if ($trans_type == ST_SALESORDER)
return pager_link( _("Invoice"),
"/sales/sales_order_entry.php?NewInvoice=" .$row["order_no"], ICON_DOC);
else
function tmpl_checkbox($row)
{
global $trans_type;
- if ($trans_type == 32)
+ if ($trans_type == ST_SALESQUOTE)
return '';
$name = "chgtpl" .$row['order_no'];
$value = $row['type'] ? 1:0;
stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true);
-if ($trans_type == 32)
+if ($trans_type == ST_SALESQUOTE)
check_cells(_("Show All:"), 'show_all');
submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
sorder.deliver_to";
}
-if ($trans_type == 30)
+if ($trans_type == ST_SALESORDER)
$cols = array(
_("Order #") => array('fun'=>'view_link'),
_("Ref"),
array('insert'=>true, 'fun'=>'delivery_link'))
);
-} elseif ($trans_type == 32) {
+} elseif ($trans_type == ST_SALESQUOTE) {
array_append($cols,array(
array('insert'=>true, 'fun'=>'edit_link'),
array('insert'=>true, 'fun'=>'order_link'),
array('insert'=>true, 'fun'=>'prt_link')));
-} elseif ($trans_type == 30) {
+} elseif ($trans_type == ST_SALESORDER) {
array_append($cols,array(
_("Tmpl") => array('insert'=>true, 'fun'=>'tmpl_checkbox'),
array('insert'=>true, 'fun'=>'edit_link'),