FIX: deleting a reception do not create reverse stock movements
This commit is contained in:
parent
2572bc156e
commit
82e092fda3
1 changed files with 2 additions and 2 deletions
|
|
@ -1116,7 +1116,7 @@ class Reception extends CommonObject
|
|||
$this->db->begin();
|
||||
|
||||
// Stock control
|
||||
if (isModEnabled('stock') && !getDolGlobalInt('STOCK_CALCULATE_ON_RECEPTION') && $this->statut > 0) {
|
||||
if (isModEnabled('stock') && getDolGlobalInt('STOCK_CALCULATE_ON_RECEPTION') && $this->statut > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
|
||||
|
||||
$langs->load("agenda");
|
||||
|
|
@ -1140,7 +1140,7 @@ class Reception extends CommonObject
|
|||
// we do not log origin because it will be deleted
|
||||
$mouvS->origin = null;
|
||||
|
||||
$result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed
|
||||
$result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref), '', $obj->eatby ? $this->db->jdate($obj->eatby) : null, $obj->sellby ? $this->db->jdate($obj->sellby) : null, $obj->batch); // Price is set to 0, because we don't want to see WAP changed
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->error = $mouvS->error;
|
||||
|
|
|
|||
Loading…
Reference in a new issue