Add autopick_null in config.
authorMaxime Bourget <bmx007@gmail.com>
Sat, 15 Jun 2013 16:34:07 +0000 (17:34 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Sat, 15 Jun 2013 16:34:07 +0000 (17:34 +0100)
This flag decide if non available item should be autopicked
or not.

config.php
includes/order_xtra_config.inc
includes/picking.inc

index 3b140bdc1087d0cf24cfeb1a3a83a98566ceb952..e0cb0cc50b2561fa77ecf8a19a8283a1a108b571 100644 (file)
@@ -2,6 +2,7 @@
 include_once('includes/order_xtra_config.inc');
 
 OrderXtraConfig::$default_location = 'DEF';
+OrderXtraConfig::$autopick_null = false;
 OrderXtraConfig::$locations = array(
        'C4' => array('delivery' => '2013-06-01')
        ,'C5' => array('delivery' => '2013-07-31')
index d9943d164f836f47fa5b53865239131589984ac1..bd7fa4d61189e1d7049f2378803c08774de1fb9a 100644 (file)
@@ -4,6 +4,7 @@ require_once($path_to_root.'/'.'includes/date_functions.inc');
 class OrderXtraConfig {
        // Location code of the default or main location
        static $default_location = "";
+       static $autopick_null = true;
        
        // Array location => { delivery, parent }
        // Location not listed are excluded
index 3591a7744c201eb398d23978d904440a67718e3e..c1a8dd4d7a46434dc3965fa06737c6b6f454f81d 100644 (file)
@@ -61,7 +61,8 @@ class Picker {
                        foreach($row as $key => $value) { $$key = $value; }
                        $available = max(min($quantity-$held, $qoh-$quantity_before-$held) ,0 );
 
-               insert_pick($stock_id, $order_id, $detail_id, $debtor_no, $branch_code, $available, $quantity);
+               if($available || OrderXtraConfig::$autopick_null)
+                       insert_pick($stock_id, $order_id, $detail_id, $debtor_no, $branch_code, $available, $quantity);
 
                }
        }