FIX Stock limit for alert added into list of available fields for stock

This commit is contained in:
Laurent Destailleur 2016-04-27 14:05:35 +02:00
parent 810a6c2cb4
commit c6371060d0
2 changed files with 22 additions and 3 deletions

View File

@ -140,7 +140,8 @@ $arrayfields=array(
'p.duration'=>array('label'=>$langs->trans("Duration"), 'checked'=>($contextpage != 'productlist'), 'enabled'=>(! empty($conf->service->enabled))),
'p.sellprice'=>array('label'=>$titlesellprice, 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(! empty($user->rights->fournisseur->lire))),
'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
'p.tobatch'=>array('label'=>$langs->trans("ManageLotSerial"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))),
'p.stock'=>array('label'=>$langs->trans("PhysicalStock"), 'checked'=>1, 'enabled'=>(! empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
'p.accountancy_code_sell'=>array('label'=>$langs->trans("ProductAccountancySellCode"), 'checked'=>0),
@ -425,6 +426,7 @@ else
if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,"",$sortfield,$sortorder);
if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.seuil_stock_alerte']['checked'])) print_liste_field_titre($arrayfields['p.seuil_stock_alerte']['label'], $_SERVER["PHP_SELF"],"p.seuil_stock_alerte","",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desiredstock","",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.tobatch']['checked'])) print_liste_field_titre($arrayfields['p.tobatch']['label'], $_SERVER["PHP_SELF"],"p.tobatch","",$param,'align="center"',$sortfield,$sortorder);
if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder);
@ -499,6 +501,13 @@ else
print ' ';
print '</td>';
}
// Limit for alert
if (! empty($arrayfields['p.seuil_stock_alerte']['checked']))
{
print '<td class="liste_titre">';
print '&nbsp;';
print '</td>';
}
// Desired stock
if (! empty($arrayfields['p.desiredstock']['checked']))
{
@ -681,6 +690,16 @@ else
}
}
// Limit alert
if (! empty($arrayfields['p.seuil_stock_alerte']['checked']))
{
print '<td align="right">';
if ($objp->fk_product_type != 1)
{
print $objp->seuil_stock_alerte;
}
print '</td>';
}
// Desired stock
if (! empty($arrayfields['p.desiredstock']['checked']))
{
@ -691,7 +710,7 @@ else
}
print '</td>';
}
// Desired stock
// Lot/Serial
if (! empty($arrayfields['p.tobatch']['checked']))
{
print '<td align="center">';

View File

@ -316,7 +316,7 @@ if ($resql)
$product_static->label = $objp->label;
$product_static->type=$objp->fk_product_type;
$product_static->entity=$objp->entity;
print $product_static->getNomUrl(1,'',16);
print $product_static->getNomUrl(1,'',24);
//if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow"));
print '</td>';
print '<td>'.$objp->label.'</td>';