From a7dcfab8a2805eb3925cb8deefd40174a581be53 Mon Sep 17 00:00:00 2001 From: omogenot Date: Fri, 20 Sep 2024 02:24:24 +0200 Subject: [PATCH] NEW : Update warehouse product list to add another sorting option (#30971) * Update warehouse product list to add another sorting option Add the ability to sort product list by average buying price to identify high cost laying products in stock. * Fix variable typo * Update card.php --------- Co-authored-by: Laurent Destailleur --- htdocs/product/stock/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 34843626dc5..ce5fb254b84 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -648,7 +648,7 @@ if ($action == 'create') { print_liste_field_titre($form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")), "", "p.pmp", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; - print_liste_field_titre("EstimatedStockValueShort", "", "", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("EstimatedStockValueShort", "", "svalue", "&id=".$id, "", '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; $totalarray['pos'][$totalarray['nbfield']] = 'totalvalue'; $totalarray['type'][$totalarray['nbfield']] = ''; @@ -705,6 +705,7 @@ if ($action == 'create') { if (getDolGlobalString('PRODUCT_USE_UNITS')) { $sql .= ",fk_unit"; } + $sql .= ", (ps.reel * p.pmp) as svalue"; // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook