hide other eatby sellby dates

This commit is contained in:
Christian Foellmann 2020-08-20 15:27:34 +02:00
parent a5b4fcedb7
commit 179fc2e70a
4 changed files with 30 additions and 6 deletions

View File

@ -2307,8 +2307,12 @@ if ($action == 'create')
foreach ($lines[$i]->detail_batch as $dbatch) // $dbatch is instance of ExpeditionLineBatch
{
$detail .= $langs->trans("Batch").': '.$dbatch->batch;
$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day");
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day");
}
$detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty;
$detail .= '<br>';
}

View File

@ -143,6 +143,12 @@ $arrayfields = array(
//'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
);
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
unset($arrayfields['pl.eatby']);
}
if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
unset($arrayfields['pl.sellby']);
}
$objectlist->fields = dol_sort_array($objectlist->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -159,8 +159,12 @@ if ($resql)
if (!empty($conf->productbatch->enabled))
{
print '<th>'.$langs->trans("Batch").'</th>';
print '<th>'.$langs->trans("SellByDate").'</th>';
print '<th>'.$langs->trans("EatByDate").'</th>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<th>'.$langs->trans("SellByDate").'</th>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<th>'.$langs->trans("EatByDate").'</th>';
}
}
print '<th>'.$langs->trans("Warehouse").'</th>';
print '<th class="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/product/stock/movement_list.php">'.$langs->trans("FullList").'</a></th>';
@ -191,8 +195,12 @@ if ($resql)
if (!empty($conf->productbatch->enabled))
{
print '<td>'.$objp->batch.'</td>';
print '<td>'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
print '<td>'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td>'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td>'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
}
}
print '<td class="tdoverflowmax200">';
print $warehouse->getNomUrl(1);

View File

@ -121,6 +121,12 @@ $arrayfields = array(
//'m.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500)
);
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
unset($arrayfields['pl.eatby']);
}
if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
unset($arrayfields['pl.sellby']);
}
// Security check
if (!$user->rights->stock->mouvement->lire) {