mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Enhance doc for stock movement
This commit is contained in:
@@ -315,11 +315,12 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set draft status
|
||||
* \param user Object user that modify
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* Set draft status
|
||||
*
|
||||
* @param User $user Object user that modify
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function set_draft($user)
|
||||
function set_draft($user, $idwarehouse=1)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@@ -343,7 +344,7 @@ class Commande extends CommonObject
|
||||
$sql.= " SET fk_statut = 0";
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog("Commande::set_draft sql=".$sql, LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
// If stock is decremented on validate order, we must reincrement it
|
||||
@@ -359,8 +360,7 @@ class Commande extends CommonObject
|
||||
{
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
// We increment stock of product (and sub-products)
|
||||
$entrepot_id = "1"; //Todo: ajouter possibilite de choisir l'entrepot
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
|
||||
if ($result < 0) { $error++; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user