if ($use_popup_windows)
$js .= get_js_open_window(900, 600);
-if ($_GET['trans_type'] == 32)
+if ($_GET['trans_type'] == ST_SALESQUOTE)
{
- page(_("View Sales Quotation"), true, false, "", $js);
+ page(_($help_context = "View Sales Quotation"), true, false, "", $js);
display_heading(sprintf(_("Sales Quotation #%d"),$_GET['trans_no']));
}
else
{
- page(_("View Sales Order"), true, false, "", $js);
+ page(_($help_context = "View Sales Order"), true, false, "", $js);
display_heading(sprintf(_("Sales Order #%d"),$_GET['trans_no']));
}
start_table("$table_style2 width=95%", 5);
echo "<tr valign=top><td>";
display_heading2(_("Order Information"));
-if ($_GET['trans_type'] != 32)
+if ($_GET['trans_type'] != ST_SALESQUOTE)
{
echo "</td><td>";
display_heading2(_("Deliveries"));
end_row();
start_row();
label_cells(_("Ordered On"), $_SESSION['View']->document_date, "class='tableheader2'");
-if ($_GET['trans_type'] == 32)
+if ($_GET['trans_type'] == ST_SALESQUOTE)
label_cells(_("Valid until"), $_SESSION['View']->due_date, "class='tableheader2'");
else
label_cells(_("Requested Delivery"), $_SESSION['View']->due_date, "class='tableheader2'");
label_row(_("Comments"), $_SESSION['View']->Comments, "class='tableheader2'", "colspan=3");
end_table();
-if ($_GET['trans_type'] != 32)
+if ($_GET['trans_type'] != ST_SALESQUOTE)
{
echo "</td><td valign='top'>";
start_table($table_style);
display_heading2(_("Delivery Notes"));
+
$th = array(_("#"), _("Ref"), _("Date"), _("Total"));
table_header($th);
- $sql = "SELECT * FROM ".TB_PREF."debtor_trans WHERE type=13 AND order_=" . $_GET['trans_no'];
- $result = db_query($sql,"The related delivery notes could not be retreived");
+ $result = get_related_documents(ST_CUSTDELIVERY, $_GET['trans_no']);
$delivery_total = 0;
$k = 0;
$th = array(_("#"), _("Ref"), _("Date"), _("Total"));
table_header($th);
- $sql = "SELECT * FROM ".TB_PREF."debtor_trans WHERE type=10 AND order_=" . $_GET['trans_no'];
- $result = db_query($sql,"The related invoices could not be retreived");
+ $result = get_related_documents(ST_SALESINVOICE, $_GET['trans_no']);
$invoices_total = 0;
$k = 0;
$th = array(_("#"), _("Ref"), _("Date"), _("Total"));
table_header($th);
- $sql = "SELECT * FROM ".TB_PREF."debtor_trans WHERE type=11 AND order_=" . $_GET['trans_no'];
- $result = db_query($sql,"The related credit notes could not be retreived");
+ $result = get_related_documents(ST_CUSTCREDIT, $_GET['trans_no']);
$credits_total = 0;
$k = 0;
end_table();
}
echo "<center>";
+if ($_SESSION['View']->so_type == 1)
+ display_note(_("This Sales Order is used as a Template."), 0, 0, "class='currentfg'");
display_heading2(_("Line Details"));
start_table("colspan=9 width=95% $table_style");
$display_total = price_format($items_total + $_SESSION['View']->freight_cost);
label_row(_("Shipping"), price_format($_SESSION['View']->freight_cost),
- "align=right colspan=6", "nowrap align=right");
+ "align=right colspan=6", "nowrap align=right", 1);
label_row(_("Total Order Value"), $display_total, "align=right colspan=6",
- "nowrap align=right");
+ "nowrap align=right", 1);
end_table(2);