Update product.class.php
This commit is contained in:
parent
6793bfae3a
commit
6fcc271790
@ -2272,7 +2272,12 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->STOCK_CALCULATE_ON_BILL) && ! empty($conf->global->DECREASE_ONLY_UNINVOICEDPRODUCTS))
|
// If stock decrease is on invoice validation, the theorical stock continue to
|
||||||
|
// count the orders to ship in theorical stock when some are already removed b invoice validation.
|
||||||
|
// If option DECREASE_ONLY_UNINVOICEDPRODUCTS is on, we make a compensation.
|
||||||
|
if (! empty($conf->global->STOCK_CALCULATE_ON_BILL))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->DECREASE_ONLY_UNINVOICEDPRODUCTS))
|
||||||
{
|
{
|
||||||
$adeduire = 0;
|
$adeduire = 0;
|
||||||
$sql = "SELECT sum(fd.qty) as count FROM ".MAIN_DB_PREFIX."facturedet fd ";
|
$sql = "SELECT sum(fd.qty) as count FROM ".MAIN_DB_PREFIX."facturedet fd ";
|
||||||
@ -2292,7 +2297,8 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->stats_commande['qty'] -= $adeduire ;
|
$this->stats_commande['qty'] -= $adeduire;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user