Clean-up in ui_list codes.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 16 Jun 2009 08:21:19 +0000 (08:21 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 16 Jun 2009 08:21:19 +0000 (08:21 +0000)
CHANGELOG.txt
includes/ui/ui_lists.inc
manufacturing/inquiry/bom_cost_inquiry.php
manufacturing/manage/bom_edit.php

index 4bc0d1345fb78c3e72ef4e3a771b20d916ff133d..501ee78ebfa01a746ee03bdd58d6ef981668e225 100644 (file)
@@ -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.
index d7e2c964c511b3f16abdfc793ce33ff5c7683c15..213837812b926cdfc2488a1032666aed96fe3cee 100644 (file)
@@ -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 "<td>$label</td>\n";
-       echo "<td>";
-       $str = stock_bom_items_list($name, $selected_id, $all_option, $submit_on_change);
-       echo "</td>\n";
-       return $str;
-}
-
-function stock_bom_items_list_row($label, $name, $selected_id=null, $all_option=false, $submit_on_change=false)
-{
-       echo "<tr>\n";
-       $str = stock_bom_items_list_cells($label, $name, $selected_id, $all_option, $submit_on_change);
-       echo "</tr>\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 "<td>$label</td>\n";
        echo "<td>";
-       $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 "</td>\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 "<tr>\n";
-       if ($label != null)
-               echo "<td>$label</td>\n";
-       echo "<td>";
-       $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 "</td>\n";
+       $str = stock_manufactured_items_list_cells($label, $name, $selected_id, $all_option, $submit_on_change);
        echo "</tr>\n";
        return $str;
 }
index e484ea9f3a3a9c48edd00740b35688cf79b52b25..8faae1ccbf9728464abee9e081bd90cfe7be9bce 100644 (file)
@@ -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 '<td>';
-       stock_bom_items_list('stock_id', null, false, true);
-       echo '</td>';
-       end_table();
-       
-       echo "<hr>";
-
-       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();
 
index 673a54329efb710f0b3e7aeb97c50b548e1395a2..f3ace9fd401900b23818f26dfe72fa8c06c22116 100644 (file)
@@ -215,13 +215,15 @@ if ($Mode == 'RESET')
 
 start_form(false, true);
 
-echo "<center>" . _("Select a manufacturable item:") . "&nbsp;";
-stock_bom_items_list('stock_id', null, false, true);
-echo "</center><br>";
+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') != '')