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 <eldy@destailleur.fr>
This commit is contained in:
omogenot 2024-09-20 02:24:24 +02:00 committed by GitHub
parent ae59ed2c97
commit a7dcfab8a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -648,7 +648,7 @@ if ($action == 'create') {
print_liste_field_titre($form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")), "", "p.pmp", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
$totalarray['nbfield']++;
print_liste_field_titre("EstimatedStockValueShort", "", "", "&amp;id=".$id, "", '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("EstimatedStockValueShort", "", "svalue", "&amp;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