From 81c2b485c83898529006c48f2092800882b4120b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 26 Aug 2010 15:46:39 +0000 Subject: [PATCH] New: Can add a comment on stock dispatching to be saved into the stock movement. --- ChangeLog | 1 + htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- htdocs/fourn/commande/dispatch.php | 8 +++++++- htdocs/langs/en_US/orders.lang | 2 +- htdocs/langs/fr_FR/orders.lang | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) 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 '
'; diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 9a03c2c72c1..835e8103114 100755 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -104,6 +104,7 @@ UserWithApproveOrderGrant=Users granted with "approve orders" permission. PaymentOrderRef=Payment of order %s CloneOrder=Clone order ConfirmCloneOrder=Are you sure you want to clone this order %s ? +DispatchSupplierOrder=Receiving supplier order %s ##### Types de contacts ##### TypeContact_commande_internal_SALESREPFOLL=Representative following-up customer order TypeContact_commande_internal_SHIPPING=Representative following-up shipping @@ -132,7 +133,6 @@ OrderSource6=Store QtyOrdered=Qty ordered AddDeliveryCostLine=Add a delivery cost line indicating the weight of the order - # Documents models PDFEinsteinDescription=A complete order model (logo...) PDFEdisonDescription=A simple order model diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index 16391f5ab34..38d268f332b 100755 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -104,6 +104,7 @@ UserWithApproveOrderGrant=Utilisateurs habilités à approuver les commandes PaymentOrderRef=Paiement commande %s CloneOrder=Cloner commande ConfirmCloneOrder=Êtes-vous sûr de vouloir cloner cette commande %s ? +DispatchSupplierOrder=Réception de la commande fournisseur %s ##### Types de contacts ##### TypeContact_commande_internal_SALESREPFOLL=Reponsable suivi commande client TypeContact_commande_internal_SHIPPING=Reponsable envoi commande client