From c39bb227ee6ca517be8a444a2fa40456d502c0c0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 21 Mar 2007 16:54:31 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20champs=20suppl=E9mentaire=20dans?= =?UTF-8?q?=20l'export=20des=20commandes.=20r=E9cup=E9ration=20des=20notes?= =?UTF-8?q?=20priv=E9es=20et=20public=20de=20propal=20=E0=20commande.=20Aj?= =?UTF-8?q?out=20option=20dans=20la=20config=20du=20module=20commande=20qu?= =?UTF-8?q?i=20permet=20de=20valider=20la=20commande=20apr=E8s=20cloture?= =?UTF-8?q?=20de=20la=20propale,=20permet=20de=20ne=20pas=20passer=20par?= =?UTF-8?q?=20une=20commande=20provisoire.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/commande.php | 22 ++++++++++++++++++++-- htdocs/commande/commande.class.php | 1 - htdocs/propal.class.php | 7 +++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index aaa063482a7..3ea5cb4204a 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -129,6 +129,11 @@ if ($_POST["action"] == 'sethidetreated') dolibarr_set_const($db, "COMMANDE_HIDE_TREATED",$_POST["hidetreated"]); } +if ($_POST["action"] == 'setvalidorder') +{ + dolibarr_set_const($db, "COMMANDE_VALID_AFTER_CLOSE_PROPAL",$_POST["validorder"]); +} + if ($_POST["action"] == 'deliverycostline') { dolibarr_set_const($db, "COMMANDE_ADD_DELIVERY_COST_LINE",$_POST["addline"]); @@ -343,7 +348,7 @@ print ''.$langs->trans("Value").''; print "\n"; $var=true; -// cacher les commandes classer facturées des listes +// Cacher les commandes classer facturées des listes $var=! $var; print ''; @@ -356,8 +361,21 @@ print '' print "\n"; print "\n"; +// Valider la commande après cloture de la propale +// permet de na pas passer par l'option commande provisoire +$var=! $var; -// cacher les commandes classer facturées des listes +print ''; +print $langs->trans("ValidOrderAfterPropalClosed"); +print ''; +print '
'; +print ''; +print $html->selectyesno("validorder",$conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL,1); +print ''; +print "
\n"; +print "\n"; + +// Ajouter une ligne de frais port indiquant le poids de la commande $var=! $var; print ''; diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index cbc220db2a3..0f0f3f41e7f 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -492,7 +492,6 @@ class Commande extends CommonObject // Fin appel triggers $this->db->commit(); - #$this->valid($user); return $this->id; } else diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 63bc5385aff..b4aaa0d0c1c 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -1306,6 +1306,13 @@ class Propal extends CommonObject include_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php"); $commande = new Commande($this->db); $result=$commande->create_from_propale($user, $this->id); + + // Ne pas passer par la commande provisoire + if ($conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL == 1) + { + $commande->fetch($result); + $commande->valid($user); + } return $result; }