diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index efa00af3d80..c77753c0948 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -51,9 +51,9 @@ $langs->load('propal'); $origin = GETPOST('origin','alpha')?GETPOST('origin','alpha'):'expedition'; // Example: commande, propal $origin_id = GETPOST('id','int')?GETPOST('id','int'):''; +$id = $origin_id; if (empty($origin_id)) $origin_id = GETPOST('origin_id','int'); // Id of order or propal if (empty($origin_id)) $origin_id = GETPOST('object_id','int'); // Id of order or propal -$id = $origin_id; $ref=GETPOST('ref','alpha'); // Security check diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 97ad7b33ef5..1ac8d9cbfd5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -621,7 +621,7 @@ class Product extends CommonObject } // Delete all child tables - $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product'); + $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock'); foreach($elements as $table) { if (! $error) @@ -644,7 +644,7 @@ class Product extends CommonObject { $sqlz = "DELETE FROM ".MAIN_DB_PREFIX."product"; $sqlz.= " WHERE rowid = ".$id; - dol_syslog(get_class($this).'::delete sql='.$sql, LOG_DEBUG); + dol_syslog(get_class($this).'::delete sql='.$sqlz, LOG_DEBUG); $resultz = $this->db->query($sqlz); if ( ! $resultz ) { diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 584f5773ede..6e4ada58b34 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -61,6 +61,7 @@ class MouvementStock { global $conf, $langs; + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $error = 0; dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse=$entrepot_id, qty=$qty, type=$type, price=$price label=$label");