From 2e18fa88d147815936340763b8dd4835a8ecc97b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 25 Jul 2014 14:03:41 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Mauvais=20libell=C3=A9=20utilis=C3=A9=20pou?= =?UTF-8?q?r=20statut=20commande?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/core/menus/standard/eldy.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ca3aea39a47..9e6eb820e8d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -688,7 +688,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); - if (empty($leftmenu) || $leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire); + if (empty($leftmenu) || $leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderSentShort"), 2, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=3", $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); // The translation key is StatusOrderToBill but it means StatusDelivered. TODO We should renamed this later if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); if (empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); From 386022947a5489b52aacda1f4282371f74fe8cdb Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 25 Jul 2014 14:11:31 +0200 Subject: [PATCH 2/3] Categorie class was fetching an object even if no param passed --- htdocs/categories/class/categorie.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 8d2c4ceed46..ad436d5c6c8 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -74,6 +74,9 @@ class Categorie extends CommonObject function fetch($id,$label='') { global $conf; + + // Check parameters + if (empty($id) && empty($label)) return -1; $sql = "SELECT rowid, fk_parent, entity, label, description, fk_soc, visible, type"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; From 36b634784b24be32ba3a94202279dc6d62f99a76 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 25 Jul 2014 16:31:41 +0200 Subject: [PATCH 3/3] Fix : real delivery date on livraison was not displayed --- htdocs/expedition/liste.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php index 76dbd7cc9a9..29ab105ee91 100644 --- a/htdocs/expedition/liste.php +++ b/htdocs/expedition/liste.php @@ -58,7 +58,7 @@ $shipment=new Expedition($db); $helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; llxHeader('',$langs->trans('ListOfSendings'),$helpurl); -$sql = "SELECT e.rowid, e.ref, e.date_delivery, e.date_expedition, e.fk_statut"; +$sql = "SELECT e.rowid, e.ref, e.date_delivery as date_expedition, l.date_delivery as date_livraison, e.fk_statut"; $sql.= ", s.nom as socname, s.rowid as socid"; $sql.= " FROM (".MAIN_DB_PREFIX."expedition as e"; if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all @@ -67,6 +67,8 @@ if (!$user->rights->societe->client->voir && !$socid) // Internal user with no p } $sql.= ")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping'"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.rowid = ee.fk_target AND ee.targettype = 'delivery'"; $sql.= " WHERE e.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all { @@ -104,7 +106,9 @@ if ($resql) print_liste_field_titre($langs->trans("Ref"),"liste.php","e.ref","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom", "", $param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDeliveryPlanned"),"liste.php","e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateReceived"),"liste.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder); + if($conf->livraison_bon->enabled) { + print_liste_field_titre($langs->trans("DateReceived"),"liste.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder); + } print_liste_field_titre($langs->trans("Status"),"liste.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder); print "\n"; $var=True; @@ -129,16 +133,18 @@ if ($resql) print ''; // Date delivery planed print ""; - print dol_print_date($db->jdate($objp->date_delivery),"day"); + print dol_print_date($db->jdate($objp->date_expedition),"day"); /*$now = time(); if ( ($now - $db->jdate($objp->date_expedition)) > $conf->warnings->lim && $objp->statutid == 1 ) { }*/ print "\n"; - // Date real - print ""; - print dol_print_date($db->jdate($objp->date_expedition),"day"); - print "\n"; + if($conf->livraison_bon->enabled) { + // Date real + print ""; + print dol_print_date($db->jdate($objp->date_livraison),"day"); + print "\n"; + } print ''.$expedition->LibStatut($objp->fk_statut,5).''; print "\n";