Partial (inventory related) include files cleanup.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 6 Apr 2015 14:24:54 +0000 (16:24 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 6 Apr 2015 15:17:05 +0000 (17:17 +0200)
28 files changed:
dimensions/dimension_entry.php
includes/db/inventory_db.inc
includes/db/manufacturing_db.inc
includes/inventory.inc [new file with mode: 0644]
includes/manufacturing.inc [deleted file]
inventory/cost_update.php
inventory/includes/inventory_db.inc
inventory/inquiry/stock_status.php
inventory/manage/item_codes.php
inventory/manage/sales_kits.php
inventory/purchasing_data.php
manufacturing/includes/manufacturing_db.inc
manufacturing/inquiry/bom_cost_inquiry.php
manufacturing/manage/bom_edit.php
manufacturing/view/wo_costs_view.php
manufacturing/view/wo_issue_view.php
manufacturing/view/wo_production_view.php
manufacturing/view/work_order_view.php
manufacturing/work_order_add_finished.php
manufacturing/work_order_costs.php
manufacturing/work_order_entry.php
manufacturing/work_order_release.php
purchasing/includes/purchasing_db.inc
sales/customer_credit_invoice.php
sales/customer_delivery.php
sales/customer_invoice.php
sales/includes/sales_db.inc
sales/includes/ui/sales_order_ui.inc

index d5c4f2a9fab9b6daa1fe83bd1e4488477f2a7c84..7809bd1bb2f397307c936c4881302145849f8f5a 100644 (file)
@@ -14,7 +14,6 @@ $path_to_root = "..";
 include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 include_once($path_to_root . "/admin/db/tags_db.inc");
index b0807f19108ba9267c7e06e1a3eb77b35c34a9dc..48aa125d37b56918c0abe2ce8af964a1b6b957c5 100644 (file)
@@ -445,3 +445,17 @@ function get_location_name($loc_code)
 
        display_db_error("could not retreive the location name for $loc_code", $sql, true);
 }
+
+function get_mb_flag($stock_id)
+{
+       $sql = "SELECT mb_flag FROM ".TB_PREF."stock_master WHERE stock_id = "
+               .db_escape($stock_id);
+       $result = db_query($sql, "retreive mb_flag from item");
+       
+       if (db_num_rows($result) == 0)
+               return -1;
+
+       $myrow = db_fetch_row($result);
+       return $myrow[0];
+}
+
index aba53fa7427bd20bb0f32c62411c003c34f497ba..6473ba4bcf0f335e067402879389325cc222e6c8 100644 (file)
@@ -179,19 +179,6 @@ function get_on_worder_qty($stock_id, $location)
        return $qoo;
 }
 
-function get_mb_flag($stock_id)
-{
-       $sql = "SELECT mb_flag FROM ".TB_PREF."stock_master WHERE stock_id = "
-               .db_escape($stock_id);
-       $result = db_query($sql, "retreive mb_flag from item");
-       
-       if (db_num_rows($result) == 0)
-               return -1;
-
-       $myrow = db_fetch_row($result);
-       return $myrow[0];
-}
-
 //--------------------------------------------------------------------------------------
 
 function add_bom($selected_parent, $component, $workcentre_added, $loc_code, $quantity)
diff --git a/includes/inventory.inc b/includes/inventory.inc
new file mode 100644 (file)
index 0000000..84638a8
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
+include_once($path_to_root . "/includes/db/inventory_db.inc");
+
+
+function is_manufactured($mb_flag)
+{
+       return ($mb_flag == 'M');
+}
+
+function is_purchased($mb_flag)
+{
+       return ($mb_flag == 'B');
+}
+
+function is_service($mb_flag)
+{
+       return ($mb_flag == 'D');
+}
+
+function has_stock_holding($mb_flag)
+{
+       return is_purchased($mb_flag) || is_manufactured($mb_flag);
+}
diff --git a/includes/manufacturing.inc b/includes/manufacturing.inc
deleted file mode 100644 (file)
index a68b89e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**********************************************************************
-    Copyright (C) FrontAccounting, LLC.
-       Released under the terms of the GNU General Public License, GPL, 
-       as published by the Free Software Foundation, either version 3 
-       of the License, or (at your option) any later version.
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
-***********************************************************************/
-include_once($path_to_root . "/includes/db/manufacturing_db.inc");
-
-
-function is_manufactured($mb_flag)
-{
-       return ($mb_flag == 'M');
-}
-
-function is_purchased($mb_flag)
-{
-       return ($mb_flag == 'B');
-}
-
-function is_service($mb_flag)
-{
-       return ($mb_flag == 'D');
-}
-
-function has_stock_holding($mb_flag)
-{
-       return is_purchased($mb_flag) || is_manufactured($mb_flag);
-}
-
-//--------------------------------------------------------------------------------------
-
index 4fcb852d69ed27be158bba9d005d06c8a7dc34e6..be6a19e64e898b0c4576d2a849bfce5fd31971c6 100644 (file)
@@ -19,7 +19,6 @@ include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/banking.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 include_once($path_to_root . "/inventory/includes/inventory_db.inc");
 
index 4b61255236232a5e7cb43f0388da664c8b2653dc..7277dde30c51ad66f59a5cf337806abe8a492031 100644 (file)
@@ -11,7 +11,7 @@
 ***********************************************************************/
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/banking.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
+include_once($path_to_root . "/includes/inventory.inc");
 
 include_once($path_to_root . "/inventory/includes/db/items_category_db.inc");
 include_once($path_to_root . "/inventory/includes/db/items_trans_db.inc");
index f5dde1309f6e7f8720d50e8f4515f26f0ec4676d..f409307517172f8e9ca7cadbdd996f775a59715e 100644 (file)
@@ -20,10 +20,10 @@ if (isset($_GET['stock_id']))
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 include_once($path_to_root . "/inventory/includes/inventory_db.inc");
+include_once($path_to_root . "/includes/db/manufacturing_db.inc");
 
 if (list_updated('stock_id')) 
        $Ajax->activate('status_tbl');
index 3a8c199f7c95b6c6806890b888f4da114380d287..11d918c6504a046ff5850e090e531b295636a690 100644 (file)
@@ -17,7 +17,6 @@ page(_($help_context = "Foreign Item Codes"));
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 check_db_has_purchasable_items(_("There are no inventory items defined in the system."));
index b45ab3639744c4584689bf8c9a712f02477b7ee3..ab4831f0914dba831479355b4c4a5375cefc638c 100644 (file)
@@ -19,8 +19,6 @@ include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
-include_once($path_to_root . "/includes/manufacturing.inc");
-
 check_db_has_stock_items(_("There are no items defined in the system."));
 
 simple_page_mode(true);
index 655772821c2b81035d11eb42ba188522d8e8555f..676540f7e753ce15bcc12b1b1f579d2018b3059c 100644 (file)
@@ -18,7 +18,6 @@ else
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 page(_($help_context = "Supplier Purchasing Data"));
index 17af9db29423ee663ed155e95c080df3251b1854..16428eec0cafeac897d6736ae3dfb69818b2a87f 100644 (file)
@@ -9,6 +9,7 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
+include_once($path_to_root . "/includes/db/manufacturing_db.inc");
 include_once($path_to_root . "/manufacturing/includes/db/work_centres_db.inc");
 include_once($path_to_root . "/manufacturing/includes/db/work_orders_db.inc");
 include_once($path_to_root . "/manufacturing/includes/db/work_order_costing_db.inc");
index 0a594aa123c0ba300e541d5c47a04cc72667f68b..02605b5637ef1866fc68e298a2927b6439eb35d1 100644 (file)
@@ -16,7 +16,6 @@ include_once($path_to_root . "/includes/session.inc");
 page(_($help_context = "Costed Bill Of Material Inquiry"));
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/banking.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
index f9218caa34ea0fb9979ec31353f1dc8a35cf6517..aca1d7610ff1f31d6348faceb8815637d018c38b 100644 (file)
@@ -19,8 +19,6 @@ include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
-include_once($path_to_root . "/includes/manufacturing.inc");
-
 check_db_has_bom_stock_items(_("There are no manufactured or kit items defined in the system."));
 
 check_db_has_workcentres(_("There are no work centres defined in the system. BOMs require at least one work centre be defined."));
index ff474a97a8b84596a22071cd8c3fb4dcae078078..6e139ec62447cc5c595d4f752bbfc072f15d9932 100644 (file)
@@ -20,7 +20,6 @@ if ($SysPrefs->use_popup_windows)
 page(_($help_context = "View Work Order Costs"), true, false, "", $js);
 
 include_once($path_to_root . "/includes/date_functions.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
index 6787dee678c24d8b62c734b7f6f6b583551a7258..799a2b47ed5170a22b7460860beb0ea9686e3e73 100644 (file)
@@ -19,7 +19,6 @@ if ($SysPrefs->use_popup_windows)
 page(_($help_context = "View Work Order Issue"), true, false, "", $js);
 
 include_once($path_to_root . "/includes/date_functions.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
index 0661fd1e43ca1c8b9ab72f5377c8539ac8f575dd..6cd68020850e57ed3a869665a329314026233653 100644 (file)
@@ -20,7 +20,6 @@ if ($SysPrefs->use_popup_windows)
 page(_($help_context = "View Work Order Production"), true, false, "", $js);
 
 include_once($path_to_root . "/includes/date_functions.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
index b298555e24e1031502fb5a7a082b5ca9529fdd23..4d999ab9c705d9925bcba071b1a0cb24eb2c9bc8 100644 (file)
@@ -15,7 +15,6 @@ $path_to_root = "../..";
 include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
index 1d42cbf643ceb86be1945854c0ae1e34f0852188..fefbf1b5eb8abc83e216201f4059171e56d87e23 100644 (file)
 $page_security = 'SA_MANUFRECEIVE';
 $path_to_root = "..";
 include_once($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/includes/inventory.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/gl/includes/db/gl_db_bank_trans.inc");
-include_once($path_to_root . "/includes/db/inventory_db.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
index 32184da9151fa3115270d2006322590a5db13f6e..df0ea0583ae081eea5b852fc7ede0129ce44d35e 100644 (file)
 $page_security = 'SA_WORKORDERCOST';
 $path_to_root = "..";
 include_once($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/includes/inventory.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/gl/includes/db/gl_db_bank_trans.inc");
-include_once($path_to_root . "/includes/db/inventory_db.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
index 37d761e1c9cb194c9f5c1baccfb3334bf09216ff..ccc2635e3ecb86dbb458e85f10862d21df4182d0 100644 (file)
@@ -15,7 +15,6 @@ $path_to_root = "..";
 include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
index 2837f5e9eac2fcc2082a17ba62bb50db831c4abd..0f274fd83e9163d7a3b780b7f1ab2a9e8b622365 100644 (file)
@@ -14,7 +14,6 @@ $path_to_root = "..";
 include_once($path_to_root . "/includes/session.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 
 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
 include_once($path_to_root . "/manufacturing/includes/manufacturing_ui.inc");
index 5aa8be944b32b883f3e61a74803a47e1132fa292..7b18d6ca13a9a75e129c65f59ddf44581e84a7f6 100644 (file)
 include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc");
 
 include_once($path_to_root . "/includes/banking.inc");
+include_once($path_to_root . "/includes/inventory.inc");
 
 include_once($path_to_root . "/includes/date_functions.inc");
 
-include_once($path_to_root . "/includes/db/inventory_db.inc");
 include_once($path_to_root . "/includes/db/allocations_db.inc");
 
 include_once($path_to_root . "/purchasing/includes/db/supp_trans_db.inc");
index 5713a9a2c1e3cc73cd44827f6543d1c1c5e2ca1f..7cf3856d0c50090755aff89816ad432935b2ef04 100644 (file)
@@ -20,7 +20,6 @@ $path_to_root = "..";
 include_once($path_to_root . "/sales/includes/cart_class.inc");
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/sales/includes/sales_db.inc");
 include_once($path_to_root . "/sales/includes/sales_ui.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
index 422b93c0edff3a7d4cfeaf337fd253301af29cb8..a49c5c55c236c5a0d95156f9fd44ba8e15740eac 100644 (file)
@@ -19,7 +19,6 @@ $path_to_root = "..";
 include_once($path_to_root . "/sales/includes/cart_class.inc");
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/sales/includes/sales_db.inc");
 include_once($path_to_root . "/sales/includes/sales_ui.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
index 2f4d05988458008d57d36accec0c64e03508aaa3..ec42340284cd6beb9034caa4dcc067dae6bb711e 100644 (file)
@@ -19,7 +19,6 @@ $path_to_root = "..";
 include_once($path_to_root . "/sales/includes/cart_class.inc");
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/data_checks.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 include_once($path_to_root . "/sales/includes/sales_db.inc");
 include_once($path_to_root . "/sales/includes/sales_ui.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
index 965238f7b85596ca4fa6c6ab20120c12b631b7c7..1698e40a2d88ff2c1a603f28e4e195fbdc08bf22 100644 (file)
@@ -10,7 +10,7 @@
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 include_once($path_to_root . "/includes/banking.inc");
-include_once($path_to_root . "/includes/db/inventory_db.inc");
+include_once($path_to_root . "/includes/inventory.inc");
 include_once($path_to_root . "/includes/db/allocations_db.inc");
 include_once($path_to_root . "/sales/includes/db/sales_order_db.inc");
 include_once($path_to_root . "/sales/includes/db/sales_credit_db.inc");
index ce0b8604c9f6d4e3fbc1472a766c23896cd6ac04..a515859b0a9cbcd2149d732b23ad2a3cdf306483 100644 (file)
@@ -10,7 +10,6 @@
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 include_once($path_to_root . "/sales/includes/cart_class.inc");
-include_once($path_to_root . "/includes/manufacturing.inc");
 
 //--------------------------------------------------------------------------------
 function add_to_order(&$order, $new_item, $new_item_qty, $price, $discount, $description='')