diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 31ea04c1fdf..c4d646160e5 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -188,7 +188,6 @@ if (empty($reshook)) if ($action == 'add' && $user->rights->expedition->creer) { $error = 0; - $predef = ''; $db->begin(); @@ -215,7 +214,6 @@ if (empty($reshook)) $object->fk_delivery_address = $objectsrc->fk_delivery_address; $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->tracking_number = GETPOST('tracking_number', 'alpha'); - $object->ref_int = GETPOST('ref_int', 'alpha'); $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); $object->fk_incoterms = GETPOST('incoterm_id', 'int'); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e4722cabb4d..20091028583 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -671,7 +671,7 @@ class Expedition extends CommonObject // Protection if ($this->statut) { - dol_syslog(get_class($this)."::valid no draft status", LOG_WARNING); + dol_syslog(get_class($this)."::valid not in draft status", LOG_WARNING); return 0; } @@ -757,7 +757,7 @@ class Expedition extends CommonObject //var_dump($this->lines[$i]); $mouvS = new MouvementStock($this->db); - $mouvS->origin = &$this; + $mouvS->origin = dol_clone($this, 1); if (empty($obj->edbrowid)) { @@ -765,6 +765,7 @@ class Expedition extends CommonObject // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. $result = $mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ShipmentValidatedInDolibarr", $numref)); + if ($result < 0) { $error++; $this->error = $mouvS->error; @@ -794,7 +795,6 @@ class Expedition extends CommonObject // Change status of order to "shipment in process" $ret = $this->setStatut(Commande::STATUS_SHIPMENTONPROCESS, $this->origin_id, $this->origin); - if (!$ret) { $error++; diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 2429a4c09c5..4e1c8a4e57f 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -666,7 +666,6 @@ class MouvementStock extends CommonObject } // Retrieve all extrafield - // fetch optionals attributes and labels $this->fetch_optionals(); // $this->fetch_lines();