X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fview%2Fview_sales_order.php;h=69273e03c6e569a9050a2f5ab74eb5c3624101e4;hb=a8282cbfa3f17059ca276dfa7769a0efaedea88f;hp=ebf60096fa3cf9585d9c0ed62e61f4b422c9071e;hpb=cb04035914c02ff40b6c1c8c34684663bec432b6;p=fa-stable.git diff --git a/sales/view/view_sales_order.php b/sales/view/view_sales_order.php index ebf60096..69273e03 100644 --- a/sales/view/view_sales_order.php +++ b/sales/view/view_sales_order.php @@ -94,8 +94,7 @@ if ($_GET['trans_type'] != ST_SALESQUOTE) $th = array(_("#"), _("Ref"), _("Date"), _("Total")); table_header($th); - $sql = "SELECT * FROM ".TB_PREF."debtor_trans WHERE type=".ST_CUSTDELIVERY." AND order_=".db_escape($_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; @@ -127,8 +126,7 @@ if ($_GET['trans_type'] != ST_SALESQUOTE) $th = array(_("#"), _("Ref"), _("Date"), _("Total")); table_header($th); - $sql = "SELECT * FROM ".TB_PREF."debtor_trans WHERE type=".ST_SALESINVOICE." AND order_=".db_escape($_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; @@ -159,8 +157,7 @@ if ($_GET['trans_type'] != ST_SALESQUOTE) $th = array(_("#"), _("Ref"), _("Date"), _("Total")); table_header($th); - $sql = "SELECT * FROM ".TB_PREF."debtor_trans WHERE type=".ST_CUSTCREDIT." AND order_=".db_escape($_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;