From ccc6ec0bcb632b559ee068effa0b61f5b1b6276f Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 6 Feb 2008 15:37:54 +0000 Subject: [PATCH] Additional changes for delivery notes implementation --- includes/systypes.inc | 1 + includes/types.inc | 6 ++++++ includes/ui/ui_controls.inc | 6 +++++- includes/ui/ui_lists.inc | 1 + includes/ui/ui_view.inc | 20 +++++++++++++++----- inventory/inquiry/stock_status.php | 4 ++-- 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/includes/systypes.inc b/includes/systypes.inc index 0c9aa048..e9aa6987 100644 --- a/includes/systypes.inc +++ b/includes/systypes.inc @@ -35,6 +35,7 @@ function get_systype_db_info($type) case 10 : return array("".TB_PREF."debtor_trans", "type", "trans_no", "reference", "tran_date"); case 11 : return array("".TB_PREF."debtor_trans", "type", "trans_no", "reference", "tran_date"); case 12 : return array("".TB_PREF."debtor_trans", "type", "trans_no", "reference", "tran_date"); + case 13 : return array("".TB_PREF."debtor_trans", "type", "trans_no", "reference", "tran_date"); case 16 : return array("".TB_PREF."stock_moves", "type", "trans_no", "reference", "tran_date"); case 17 : return array("".TB_PREF."stock_moves", "type", "trans_no", "reference", "tran_date"); case 18 : return array("".TB_PREF."purch_orders", null, "order_no", "reference", "tran_date"); diff --git a/includes/types.inc b/includes/types.inc index 1d8eeb54..c8c5f904 100644 --- a/includes/types.inc +++ b/includes/types.inc @@ -10,6 +10,7 @@ $systypes_array = array ( 10=> array ('name' => _("Sales Invoice")), 11=> array ('name' => _("Customer Credit Note")), 12=> array ('name' => _("Customer Payment")), + 13=> array ('name' => _("Delivery Note")), 16=> array ('name' => _("Location Transfer")), 17=> array ('name' => _("Inventory Adjustment")), 18=> array ('name' => _("Purchase Order")), @@ -52,6 +53,11 @@ class systypes return 12; } + function cust_dispatch() + { + return 13; + } + function location_transfer() { return 16; diff --git a/includes/ui/ui_controls.inc b/includes/ui/ui_controls.inc index 8e815e73..2d5a9274 100644 --- a/includes/ui/ui_controls.inc +++ b/includes/ui/ui_controls.inc @@ -103,9 +103,13 @@ function hyperlink_params_td($target, $label, $params) //----------------------------------------------------------------------------------- -function hyperlink_params_separate($target, $label, $params) +function hyperlink_params_separate($target, $label, $params, $center=false) { + if ($center) + echo "
"; echo "$label\n"; + if ($center) + echo "
"; } function hyperlink_params_separate_td($target, $label, $params) diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 3c7fd1e5..687c035e 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -2079,6 +2079,7 @@ function cust_allocations_list_cells($label, $name, $selected) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; } diff --git a/includes/ui/ui_view.inc b/includes/ui/ui_view.inc index a2e96564..21bb3f2f 100644 --- a/includes/ui/ui_view.inc +++ b/includes/ui/ui_view.inc @@ -79,24 +79,34 @@ function get_customer_trans_view_str($type, $trans_no, $label="") $viewer = "view_credit.php"; elseif ($type == 12) $viewer = "view_receipt.php"; + elseif ($type == 13) + $viewer = "view_dispatch.php"; elseif ($type == 30) $viewer = "view_sales_order.php"; else return null; + + if(!is_array($trans_no)) $trans_no = array($trans_no); + $lbl = $label; + $preview_str = ''; + foreach($trans_no as $trans) { if ($label == "") - $label = $trans_no; + $lbl = $trans; + + if($preview_str!='') $preview_str .= ','; if ($viewer != "") { if ($use_popup_windows) - $preview_str = "$label"; + $preview_str .= "$lbl"; else - $preview_str = "$label"; + $preview_str .= "$lbl"; } else - $preview_str = $label; - + $preview_str .= $lbl; + } + return $preview_str; } diff --git a/inventory/inquiry/stock_status.php b/inventory/inquiry/stock_status.php index 9b16d753..e9ffcf60 100644 --- a/inventory/inquiry/stock_status.php +++ b/inventory/inquiry/stock_status.php @@ -66,11 +66,11 @@ while ($myrow = db_fetch($loc_details)) alt_table_row_color($k); - $sql = "SELECT Sum(".TB_PREF."sales_order_details.quantity-".TB_PREF."sales_order_details.qty_invoiced) AS DEM + $sql = "SELECT Sum(".TB_PREF."sales_order_details.quantity-".TB_PREF."sales_order_details.qty_sent) AS DEM FROM ".TB_PREF."sales_order_details, ".TB_PREF."sales_orders WHERE ".TB_PREF."sales_orders.order_no = ".TB_PREF."sales_order_details.order_no AND ".TB_PREF."sales_orders.from_stk_loc='" . $myrow["loc_code"] . "' - AND ".TB_PREF."sales_order_details.qty_invoiced < ".TB_PREF."sales_order_details.quantity + AND ".TB_PREF."sales_order_details.qty_sent < ".TB_PREF."sales_order_details.quantity AND ".TB_PREF."sales_order_details.stk_code='" . $_POST['stock_id'] . "'"; $demand_result = db_query($sql,"Could not retreive demand for item"); -- 2.30.2