diff --git a/ChangeLog b/ChangeLog index 24307c883cf..f8c7c2c9b9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,7 +13,6 @@ English Dolibarr changelog - Little enhancements to OSCommerce module. - Building a PDF document for invoices works like other modules. You can change model just before generating the PDF. -- Provide PDF generation for orders. - Can generate documents (PDF) for customer orders. Can send them by mail. - Can make one payment for several supplier invoices. - Rule to suggests passwords when creating a user are in modules diff --git a/INSTALL b/INSTALL index 2437170806d..2c587bb3f43 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ -English: See file docs/install/en_US/README. +English: See file README. -French: Voir fichier dans docs/install/fr_FR/README-FR. +French: Voir fichier README-FR. diff --git a/htdocs/expedition/expedition.class.php b/htdocs/expedition/expedition.class.php index 96aea7ee1b7..6d8e7543d7f 100644 --- a/htdocs/expedition/expedition.class.php +++ b/htdocs/expedition/expedition.class.php @@ -180,23 +180,23 @@ class Expedition return 1; } } - /** - * - * Lit une expedition - * - */ + + /** + * \brief Lit une expedition + * \param id + */ function fetch ($id) { global $conf; $sql = "SELECT e.rowid, e.date_creation, e.ref, e.fk_user_author, e.fk_statut, e.fk_commande, e.fk_entrepot"; - $sql .= ", ".$this->db->pdate("e.date_expedition")." as date_expedition, c.fk_adresse_livraison"; + $sql.= ", ".$this->db->pdate("e.date_expedition")." as date_expedition, c.fk_adresse_livraison"; if ($conf->livraison->enabled) $sql.=", l.rowid as livraison_id"; - $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e"; - $sql .= ", ".MAIN_DB_PREFIX."commande as c"; + $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; + $sql.= ", ".MAIN_DB_PREFIX."expedition as e"; if ($conf->livraison->enabled) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON e.rowid = l.fk_expedition"; - $sql .= " WHERE e.rowid = $id"; - $sql .= " AND e.fk_commande = c.rowid"; + $sql.= " WHERE e.rowid = ".$id; + $sql.= " AND e.fk_commande = c.rowid"; $result = $this->db->query($sql) ; @@ -221,17 +221,17 @@ class Expedition if ($this->statut == 0) $this->brouillon = 1; // ligne de produit associée à une expédition - $this->lignes = array(); - $sql = "SELECT c.description, c.qty as qtycom, e.qty as qtyexp, e.fk_commande_ligne"; - $sql .= ", c.fk_product, c.label, p.ref"; - $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as e"; - $sql .= " , ".MAIN_DB_PREFIX."commandedet as c"; - $sql .= " , ".MAIN_DB_PREFIX."product as p"; - $sql .= " WHERE e.fk_expedition = ".$this->id; - $sql .= " AND e.fk_commande_ligne = c.rowid"; - $sql .= " AND c.fk_product = p.rowid"; - - $resultp = $this->db->query($sql); + $this->lignes = array(); + $sql = "SELECT c.description, c.qty as qtycom, e.qty as qtyexp, e.fk_commande_ligne"; + $sql .= ", c.fk_product, c.label, p.ref"; + $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as e"; + $sql .= " , ".MAIN_DB_PREFIX."commandedet as c"; + $sql .= " , ".MAIN_DB_PREFIX."product as p"; + $sql .= " WHERE e.fk_expedition = ".$this->id; + $sql .= " AND e.fk_commande_ligne = c.rowid"; + $sql .= " AND c.fk_product = p.rowid"; + + $resultp = $this->db->query($sql); if ($resultp) { diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 13a79b1575a..b2acce2e4c7 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -149,6 +149,8 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post * */ +llxHeader('','Fiche expedition','ch-expedition.html',$form_search); + $html = new Form($db); /********************************************************************* @@ -158,7 +160,6 @@ $html = new Form($db); *********************************************************************/ if ($_GET["action"] == 'create') { - llxHeader('','Fiche expedition','ch-expedition.html',$form_search); print_titre($langs->trans("CreateASending")); @@ -334,14 +335,12 @@ else $expedition = New Expedition($db); $result = $expedition->fetch($_GET["id"]); - if ( $expedition->id > 0) + if ($expedition->id > 0) { $author = new User($db); $author->id = $expedition->user_author_id; $author->fetch(); - llxHeader('','Fiche expedition','ch-expedition.html',$form_search,$author); - $commande = New Commande($db); $commande->fetch($expedition->commande_id); @@ -409,8 +408,7 @@ else // Client print ''.$langs->trans("Customer").''; - print ''; - print ''.$soc->nom.''; + print ''.$soc->getNomUrl(1).''; // Auteur print ''.$langs->trans("Author").''.$author->fullname.''; @@ -419,7 +417,7 @@ else // Commande liée print ''.$langs->trans("Order").''; - print ''.$commande->ref."\n"; + print ''.img_object($langs->trans("ShowOrder"),'order').' '.$commande->ref."\n"; print '  '; // Date @@ -713,15 +711,11 @@ else } else { - /* Expedition non trouvée */ - llxHeader('','Fiche expedition','ch-expedition.html',$form_search); - print "Expedition inexistante ou accés refusé"; + dolibarr_print_error($db); } } else { - /* Expedition non trouvée */ - llxHeader('','Fiche expedition','ch-expedition.html',$form_search); print "Expedition inexistante ou accés refusé"; } }