From 9fa4f245cc1ca217ad9d259ea13ad699813e5022 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 18 Mar 2020 00:03:26 +0100 Subject: [PATCH] Update list.php --- htdocs/product/stock/list.php | 44 +++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index d5fdf711ea5..8b65d33890e 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -95,6 +95,8 @@ $fieldstosearchall = array( 'e.address'=>"Address", 'e.zip'=>'Zip', 'e.town'=>'Town', + 'e.phone'=>'Phone', + 'e.fax'=>'Fax', ); // Definition of fields for list @@ -105,6 +107,8 @@ $arrayfields = array( 'e.address'=>array('label'=>$langs->trans("Address"), 'checked'=>0), 'e.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), 'e.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0), + 'e.phone'=>array('label'=>$langs->trans("Phone"), 'checked'=>0), + 'e.fax'=>array('label'=>$langs->trans("Fax"), 'checked'=>0), 'stockqty'=>array('type'=>'float', 'label'=>$langs->trans("PhysicalStock"), 'enabled'=>1, 'visible'=>-2, 'position'=>70), 'estimatedvalue'=>array('type'=>'float', 'label'=>$langs->trans("EstimatedStockValue"), 'enabled'=>1, 'visible'=>-2, 'position'=>71), 'sellvalue'=>array('type'=>'float', 'label'=>$langs->trans("EstimatedStockValueSell"), 'enabled'=>1, 'visible'=>-2, 'position'=>72), @@ -182,7 +186,7 @@ $title = $langs->trans("ListOfWarehouses"); // Build and execute select // -------------------------------------------------------------------- -$sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,"; +$sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.phone, e.fax, e.fk_pays, e.fk_parent,"; $sql .= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -222,7 +226,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= " GROUP BY e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent"; +$sql .= " GROUP BY e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.phone, e.fax, e.fk_parent"; $totalnboflines = 0; $result = $db->query($sql); if ($result) @@ -399,6 +403,14 @@ if (!empty($arrayfields['e.town']['checked'])) { print ''; } +if (!empty($arrayfields['e.phone']['checked'])) +{ + print ''; +} +if (!empty($arrayfields['e.fax']['checked'])) +{ + print ''; +} if (!empty($arrayfields['stockqty']['checked'])) { print ''; @@ -462,6 +474,14 @@ if (!empty($arrayfields['e.town']['checked'])) { print_liste_field_titre($arrayfields['e.town']['label'], $_SERVER["PHP_SELF"], "e.town", "", $param, "", $sortfield, $sortorder); } +if (!empty($arrayfields['e.phone']['checked'])) +{ + print_liste_field_titre($arrayfields['e.phone']['label'], $_SERVER["PHP_SELF"], "e.phone", "", $param, "", $sortfield, $sortorder); +} +if (!empty($arrayfields['e.fax']['checked'])) +{ + print_liste_field_titre($arrayfields['e.fax']['label'], $_SERVER["PHP_SELF"], "e.fax", "", $param, "", $sortfield, $sortorder); +} if (!empty($arrayfields['stockqty']['checked'])) { print_liste_field_titre($arrayfields['stockqty']['label'], $_SERVER["PHP_SELF"], "stockqty", '', $param, '', $sortfield, $sortorder, 'right '); @@ -553,6 +573,18 @@ if ($num) print ''.$obj->town.''; } + // Phone + if (!empty($arrayfields['e.phone']['checked'])) + { + print ''.$obj->phone.''; + } + + //Fax + if (!empty($arrayfields['e.fax']['checked'])) + { + print ''.$obj->fax.''; + } + // Stock qty if (!empty($arrayfields['stockqty']['checked'])) { @@ -654,6 +686,14 @@ if ($num) { $emptyColumn++; } + if (!empty($arrayfields['e.phone']['checked'])) + { + $emptyColumn++; + } + if (!empty($arrayfields['e.fax']['checked'])) + { + $emptyColumn++; + } for ($i=0; $i < $emptyColumn; $i++) {