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 ''; + } print ''; print ''; print ''; @@ -470,6 +468,10 @@ if ($sql_select) { print ''; print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left '); print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, '', $sortfield, $sortorder, 'center '); + // delivery planned date + if ($type_element == 'order' || $type_element == 'supplier_order') { + print_liste_field_titre('DateDeliveryPlanned', $_SERVER['PHP_SELF'], 'delivery_planned_date', '', $param, '', $sortfield, $sortorder, 'center '); + } print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left '); print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right '); @@ -499,6 +501,10 @@ if ($sql_select) { print $documentstatic->getNomUrl(1); print ''; print ''.dol_print_date($db->jdate($objp->dateprint), 'day').''; + // delivery planned date + if ($type_element == 'order' || $type_element == 'supplier_order') { + print ''.dol_print_date($db->jdate($objp->delivery_planned_date), 'day').''; + } // Status print ''; @@ -679,6 +685,10 @@ if ($sql_select) { print ''; print ''.$langs->trans('Total').''; print ''; + // delivery planned date + if ($type_element == 'order' || $type_element == 'supplier_order') { + print ''; + } print ''.$total_qty.''; print ''.price($total_ht).''; print ''.price(price2num($total_ht / (empty($total_qty) ? 1 : $total_qty), 'MU')).'';