diff --git a/ChangeLog b/ChangeLog index 925d4a3aad4..b0b776a3cba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ For users: - New: Support NPR in customer product prices. - New: Add more volume units (ounce, gallon, inch, feet, ...) - New: Delivery date accepts hours and minutes. +- New: Can add a comment on stock dispatching to be save into stock movements. - Perf: Avoid reading database to determine country code after each page call. - Fix: Better Postgresql compatibility. diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c4025559c44..431d6c79f81 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -124,7 +124,7 @@ class CommandeFournisseur extends Commande $this->note_public = $obj->note_public; $this->modelpdf = $obj->model_pdf; - $this->db->free(); + $this->db->free($resql); if ($this->statut == 0) $this->brouillon = 1; @@ -968,7 +968,7 @@ class CommandeFournisseur extends Commande if (!$error && $entrepot > 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) { $mouv = new MouvementStock($this->db); - $result=$mouv->reception($user, $product, $entrepot, $qty, $price); + $result=$mouv->reception($user, $product, $entrepot, $qty, $price, $comment); if ($result < 0) { $this->error=$mouv->error; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index def7060b5c0..eb6a6ebb05a 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -76,7 +76,7 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece $pu = "pu_".$reg[1]; if ($_POST[$ent] > 0) { - $result = $commande->DispatchProduct($user, $_POST[$prod], $_POST[$qty], $_POST[$ent], $_POST[$pu], $_POST["label"]); + $result = $commande->DispatchProduct($user, $_POST[$prod], $_POST[$qty], $_POST[$ent], $_POST[$pu], $_POST["comment"]); } else { @@ -307,6 +307,12 @@ if ($id > 0 || ! empty($ref)) if ($nbproduct) { + print $langs->trans("Comment").' : '; + print 'trans("DispatchSupplierOrder",$commande->ref); + // print ' / '.$commande->ref_supplier; // Not yet available + print '" class="flat">'; + print '