diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 83961ac74cf..0ddbe7f2ad5 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -274,8 +274,9 @@ if ($type_element == 'propal') { } if ($type_element == 'order') { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $langs->load('sendings'); // delivery planned date $documentstatic = new Commande($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, NULL as paid, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_commande as dateprint, c.fk_statut as status, NULL as paid, c.date_livraison as delivery_planned_date,'; $tables_from = MAIN_DB_PREFIX."commande as c,".MAIN_DB_PREFIX."commandedet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND d.fk_commande = c.rowid"; @@ -310,8 +311,9 @@ if ($type_element == 'supplier_proposal') { } if ($type_element == 'supplier_order') { // Supplier : Show products from orders. require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + $langs->load('sendings'); // delivery planned date $documentstatic = new CommandeFournisseur($db); - $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, NULL as paid, '; + $sql_select = 'SELECT c.rowid as doc_id, c.ref as doc_number, \'1\' as doc_type, c.date_valid as dateprint, c.fk_statut as status, NULL as paid, c.date_livraison as delivery_planned_date, '; $tables_from = MAIN_DB_PREFIX."commande_fournisseur as c,".MAIN_DB_PREFIX."commande_fournisseurdet as d"; $where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".((int) $socid); $where .= " AND d.fk_commande = c.rowid"; @@ -396,14 +398,6 @@ if (empty($elementTypeArray) && !$object->client && !$object->fournisseur) { $typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPOST('type_element'), $showempty, 0, 0, '', 0, 0, $disabled, '', 'maxwidth150onsmartphone'); $button = ''; -$param = ''; -$param .= "&sref=".urlencode($sref); -$param .= "&month=".urlencode($month); -$param .= "&year=".urlencode($year); -$param .= "&sprod_fulldescr=".urlencode($sprod_fulldescr); -$param .= "&socid=".urlencode($socid); -$param .= "&type_element=".urlencode($type_element); - $total_qty = 0; if ($sql_select) { @@ -451,6 +445,10 @@ if ($sql_select) { print $formother->select_month($month ? $month : -1, 'month', 1, 0, 'valignmiddle'); print $formother->selectyear($year ? $year : -1, 'year', 1, 20, 1, 0, 0, '', 'valignmiddle maxwidth75imp marginleftonly'); print ''; + // delivery planned date + if ($type_element == 'order' || $type_element == 'supplier_order') { + print '