Task 672 : only for product not services
This commit is contained in:
parent
9c340d7af8
commit
b6a2fa61c8
@ -1110,7 +1110,7 @@ class Commande extends CommonOrder
|
||||
$result=$product->fetch($fk_product);
|
||||
$product_type=$product->type;
|
||||
|
||||
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product->stock_reel < $qty) {
|
||||
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty) {
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
|
||||
@ -2073,7 +2073,7 @@ class Facture extends CommonInvoice
|
||||
$result=$product->fetch($fk_product);
|
||||
$product_type=$product->type;
|
||||
|
||||
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product->stock_reel < $qty) {
|
||||
if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) {
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user