Merge pull request #11143 from code-chicken/patch-5
FIX Show unit values if configured
This commit is contained in:
commit
018cd3d034
@ -118,9 +118,11 @@ $htmlother=new FormOther($db);
|
|||||||
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
|
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
|
||||||
$sql.= ' p.fk_product_type, p.tms as datem,';
|
$sql.= ' p.fk_product_type, p.tms as datem,';
|
||||||
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
|
||||||
$sql.= ' SUM(s.reel) as stock_physique';
|
$sql.= ' SUM(s.reel) as stock_physique,';
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ' u.short_label as unit_short';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s on p.rowid = s.fk_product';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s on p.rowid = s.fk_product';
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid';
|
||||||
// We'll need this table joined to the select in order to filter by categ
|
// We'll need this table joined to the select in order to filter by categ
|
||||||
if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp";
|
if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp";
|
||||||
$sql.= " WHERE p.entity IN (".getEntity('product').")";
|
$sql.= " WHERE p.entity IN (".getEntity('product').")";
|
||||||
@ -318,6 +320,10 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($virtualdiffersfromphysical) print_liste_field_titre("VirtualStock", $_SERVER["PHP_SELF"], "", $param, "", '', $sortfield, $sortorder, 'right ');
|
if ($virtualdiffersfromphysical) print_liste_field_titre("VirtualStock", $_SERVER["PHP_SELF"], "", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||||
|
// Units
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
|
print_liste_field_titre("Unit", $_SERVER["PHP_SELF"], "unit_short", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||||
|
}
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", $param, "", '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", $param, "", '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", $param, "", '', $sortfield, $sortorder, 'right ');
|
||||||
@ -378,6 +384,10 @@ if ($resql)
|
|||||||
print $product->stock_theorique;
|
print $product->stock_theorique;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Units
|
||||||
|
if (! empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||||
|
print '<td class="left">' . $objp->unit_short . '</td>';
|
||||||
|
}
|
||||||
print '<td class="right"><a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$product->id.'">'.$langs->trans("Movements").'</a></td>';
|
print '<td class="right"><a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$product->id.'">'.$langs->trans("Movements").'</a></td>';
|
||||||
print '<td class="right nowrap">'.$product->LibStatut($objp->statut, 5, 0).'</td>';
|
print '<td class="right nowrap">'.$product->LibStatut($objp->statut, 5, 0).'</td>';
|
||||||
print '<td class="right nowrap">'.$product->LibStatut($objp->tobuy, 5, 1).'</td>';
|
print '<td class="right nowrap">'.$product->LibStatut($objp->tobuy, 5, 1).'</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user