mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-04 07:05:18 +01:00
Fix: Change status of order to cancel
This commit is contained in:
@@ -476,7 +476,7 @@ class Commande extends CommonObject
|
||||
if ($this->db->query($sql) )
|
||||
{
|
||||
// If stock is decremented on validate order, we must reincrement it
|
||||
if($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
|
||||
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/mouvementstock.class.php");
|
||||
|
||||
@@ -488,23 +488,20 @@ class Commande extends CommonObject
|
||||
$result=$mouvP->reception($user, $this->lignes[$i]->fk_product, $entrepot_id, $this->lignes[$i]->qty, $this->lignes[$i]->subprice);
|
||||
if ($result < 0) { $error++; }
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->statut=-1;
|
||||
$this->db->commit();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$mouvP->error;
|
||||
$this->db->rollback();
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
if (! $error)
|
||||
{
|
||||
$this->statut=-1;
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$mouvP->error;
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user