From a3c26a4e409bbfda15a3bec1d6a2a988639cd0b4 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 16 Jun 2009 08:21:19 +0000 Subject: [PATCH] Clean-up in ui_list codes. --- CHANGELOG.txt | 4 ++ includes/ui/ui_lists.inc | 66 ++-------------------- manufacturing/inquiry/bom_cost_inquiry.php | 17 ++---- manufacturing/manage/bom_edit.php | 12 ++-- 4 files changed, 23 insertions(+), 76 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4bc0d13..501ee78 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -21,8 +21,12 @@ $ -> Affected files 15-Jun-2009 Joe Hunt ! Added Item Code Entry in Work Order Entry and quantity decimals now follows the item +! Clean-up in ui_list codes. $ /includes/ui/ui_lists.inc /manufacturing/work_order_entry.php + /manufacturing/search_work_orders.php + /manufacturing/manage/bom_edit.php + /manufacturing/inquiry/bom_cost_inquiry.php 14-Jun-2009 Joe Hunt ! Much better presentation of new Balance Sheet, P&L Statement and Monthly Breakdown. diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index d7e2c96..2138378 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -748,58 +748,13 @@ function sales_local_items_list_row($label, $name, $selected_id=null, $all_optio } //------------------------------------------------------------------------------------ -function base_stock_items_list($where, $name, $selected_id=null, - $all_option=false, $submit_on_change=false) -{ - global $all_items; - - $sql = "SELECT stock_id, s.description, c.description - FROM ".TB_PREF."stock_master s,".TB_PREF."stock_category c WHERE - s.category_id=c.category_id"; - - return combo_input($name, $selected_id, $sql, 'stock_id', 's.description', - array( - 'format' => '_format_stock_items', - 'spec_option' => $all_option==true ? _("All Items") : $all_option, - 'spec_id' => $all_items, - 'select_submit'=> $submit_on_change, - 'where' => $where, - 'category' => 2 ) ); -} -//------------------------------------------------------------------------------------ - -function stock_bom_items_list($name, $selected_id=null, $all_option=false, $submit_on_change=false) -{ - - return base_stock_items_list("s.mb_flag='M'", - $name, $selected_id, $all_option, $submit_on_change); -} -/* -function stock_bom_items_list_cells($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false) -{ - if ($label != null) - echo "$label\n"; - echo ""; - $str = stock_bom_items_list($name, $selected_id, $all_option, $submit_on_change); - echo "\n"; - return $str; -} - -function stock_bom_items_list_row($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false) -{ - echo "\n"; - $str = stock_bom_items_list_cells($label, $name, $selected_id, $all_option, $submit_on_change); - echo "\n"; - return $str; -} -*/ -//------------------------------------------------------------------------------------ - function stock_manufactured_items_list($name, $selected_id=null, $all_option=false, $submit_on_change=false) { - return base_stock_items_list("s.mb_flag='M'", - $name, $selected_id, $all_option, $submit_on_change); + $str = stock_items_list($name, $selected_id, $all_option, $submit_on_change, + array('where'=>array("mb_flag= 'M'"), + 'edit_submit' => true)); + return $str; } function stock_manufactured_items_list_cells($label, $name, $selected_id=null, @@ -808,8 +763,7 @@ function stock_manufactured_items_list_cells($label, $name, $selected_id=null, if ($label != null) echo "$label\n"; echo ""; - $str = stock_manufactured_items_list($name, $selected_id, $all_option, - $submit_on_change); + $str = stock_manufactured_items_list($name, $selected_id, $all_option, $submit_on_change); echo "\n"; return $str; } @@ -818,15 +772,7 @@ function stock_manufactured_items_list_row($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false) { echo "\n"; - if ($label != null) - echo "$label\n"; - echo ""; - $str = stock_items_list($name, $selected_id, $all_option, $submit_on_change, - array('where'=>array("mb_flag = 'M'"), - 'edit_submit' => true)); - //$str = stock_manufactured_items_list_cells($label, $name, $selected_id, - // $all_option, $submit_on_change); - echo "\n"; + $str = stock_manufactured_items_list_cells($label, $name, $selected_id, $all_option, $submit_on_change); echo "\n"; return $str; } diff --git a/manufacturing/inquiry/bom_cost_inquiry.php b/manufacturing/inquiry/bom_cost_inquiry.php index e484ea9..8faae1c 100644 --- a/manufacturing/inquiry/bom_cost_inquiry.php +++ b/manufacturing/inquiry/bom_cost_inquiry.php @@ -31,17 +31,12 @@ if (list_updated('stock_id')) $Ajax->activate('_page_body'); start_form(false, true); - start_table("class='tablestyle_noborder'"); - start_row(); - echo ''; - stock_bom_items_list('stock_id', null, false, true); - echo ''; - end_table(); - - echo "
"; - - display_heading(_("All Costs Are In:") . " " . get_company_currency()); - display_bom($_POST['stock_id']); +start_table("class='tablestyle_noborder'"); +stock_manufactured_items_list_row(_("Select a manufacturable item:"), 'stock_id', null, false, true); +end_table(); +br(); +display_heading(_("All Costs Are In:") . " " . get_company_currency()); +display_bom($_POST['stock_id']); end_form(); diff --git a/manufacturing/manage/bom_edit.php b/manufacturing/manage/bom_edit.php index 673a543..f3ace9f 100644 --- a/manufacturing/manage/bom_edit.php +++ b/manufacturing/manage/bom_edit.php @@ -215,13 +215,15 @@ if ($Mode == 'RESET') start_form(false, true); -echo "
" . _("Select a manufacturable item:") . " "; -stock_bom_items_list('stock_id', null, false, true); -echo "

"; +start_form(false, true); +start_table("class='tablestyle_noborder'"); +stock_manufactured_items_list_row(_("Select a manufacturable item:"), 'stock_id', null, false, true); +if (list_updated('stock_id')) + $Ajax->activate('_page_body'); +end_table(); +br(); end_form(); -if (isset($_POST['_stock_id_update'])) - $Ajax->activate('_page_body'); //-------------------------------------------------------------------------------------------------- if (get_post('stock_id') != '') -- 2.30.2