Removed many global variables from config.default.php to GL Setup, Company Setup...
[fa-stable.git] / inventory / includes / db / items_transfer_db.inc
index 0acd090081c006b3cd9324e8af25a23cc8c5b295..8448ae8968b71a5bde2598f6c32c724952675201 100644 (file)
@@ -13,7 +13,7 @@
 
 function add_stock_transfer($Items, $location_from, $location_to, $date_, $type, $reference, $memo_)
 {
-       global $loc_notification, $path_to_root, $Refs;
+       global $SysPrefs, $path_to_root, $Refs;
 
        begin_transaction();
        $args = func_get_args();
@@ -24,7 +24,7 @@ function add_stock_transfer($Items, $location_from, $location_to, $date_, $type,
 
        $transfer_id = get_next_trans_no(ST_LOCTRANSFER);
 
-       if ($loc_notification == 1)
+       if ($SysPrefs->loc_notification() == 1)
        {
                include_once($path_to_root . "/inventory/includes/inventory_db.inc");
                $st_ids = array();
@@ -34,7 +34,7 @@ function add_stock_transfer($Items, $location_from, $location_to, $date_, $type,
        }
        foreach ($Items as $line_item)
        {
-               if ($loc_notification == 1)
+               if ($SysPrefs->loc_notification() == 1)
                        $loc = calculate_reorder_level($location_from, $line_item, $st_ids, $st_names, $st_num, $st_reorder); 
                add_stock_transfer_item($transfer_id, $line_item->stock_id, $location_from,
                        $location_to, $date_, $type, $reference, $line_item->quantity);
@@ -50,7 +50,7 @@ function add_stock_transfer($Items, $location_from, $location_to, $date_, $type,
 
        commit_transaction();
        
-       if ($loc_notification == 1 && count($st_ids) > 0)
+       if ($SysPrefs->loc_notification() == 1 && count($st_ids) > 0)
                send_reorder_email($loc, $st_ids, $st_names, $st_num, $st_reorder);
 
        return $transfer_id;