Transaction references extended with parametrized patterns, added check_reference...
[fa-stable.git] / includes / db / inventory_db.inc
index 9c9d2b2e3e68756b225184a06d9f74950c42bf5f..87f045f8cdd6bcecea0c776d18204b11e3456583 100644 (file)
@@ -320,7 +320,7 @@ function handle_negative_inventory($stock_id, $quantity, $standard_cost, $date_)
                global $Refs;
 
                $id = get_next_trans_no(ST_JOURNAL);
-               $ref = $Refs->get_next(ST_JOURNAL);
+               $ref = $Refs->get_next(ST_JOURNAL, null, $date_);
                $diff = round($qoh*get_standard_cost($stock_id) + $quantity*$standard_cost, user_price_dec());
 
                if ($diff != 0)