Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-08-17 18:08:40 +02:00
commit ae28dad72e
12 changed files with 106 additions and 82 deletions

View File

@ -79,7 +79,10 @@ $form = new Form($db);
$block_static = new BlockedLog($db);
$block_static->loadTrackedEvents();
llxHeader('', $langs->trans("BlockedLogSetup"));
$title = $langs->trans("BlockedLogSetup");
$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
llxHeader('', $title, $help_url);
$linkback = '';
if ($withtab) {

View File

@ -275,8 +275,9 @@ if (GETPOST('withtab', 'alpha')) {
} else {
$title = $langs->trans("BrowseBlockedLog");
}
$help_url="EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
llxHeader('', $langs->trans("BrowseBlockedLog"));
llxHeader('', $title, $help_url);
$MAXLINES = 10000;

View File

@ -530,7 +530,8 @@ class FactureFournisseur extends CommonInvoice
$this->lines[$i]->date_end,
$this->lines[$i]->array_options,
$this->lines[$i]->fk_unit,
$this->lines[$i]->multicurrency_subprice
$this->lines[$i]->multicurrency_subprice,
$this->lines[$i]->ref_supplier
);
} else {
$this->error = $this->db->lasterror();
@ -568,7 +569,15 @@ class FactureFournisseur extends CommonInvoice
$line->fk_product,
'HT',
(!empty($line->info_bits) ? $line->info_bits : ''),
$line->product_type
$line->product_type,
$line->remise_percent,
0,
$line->date_start,
$line->date_end,
$line->array_options,
$line->fk_unit,
$line->multicurrency_subprice,
$line->ref_supplier
);
} else {
$this->error = $this->db->lasterror();

View File

@ -721,12 +721,12 @@ if ($id > 0 || !empty($ref)) {
print '<td>'.$langs->trans("Description").'</td>';
if (!empty($conf->productbatch->enabled)) {
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
}
} else {
print '<td></td>';
print '<td></td>';
@ -814,12 +814,12 @@ if ($id > 0 || !empty($ref)) {
print $linktoprod;
print "</td>";
print '<td class="dispatch_batch_number"></td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo"></td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc"></td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo"></td>';
}
} else {
print '<td>';
print $linktoprod;
@ -827,12 +827,12 @@ if ($id > 0 || !empty($ref)) {
print '<td class="dispatch_batch_number">';
print $langs->trans("ProductDoesNotUseBatchSerial");
print '</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo"></td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc"></td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo"></td>';
}
}
} else {
print '<td colspan="4">';
@ -901,7 +901,7 @@ if ($id > 0 || !empty($ref)) {
print '<td>';
print '<input type="text" class="inputlotnumber quatrevingtquinzepercent" id="lot_number'.$suffix.'" name="lot_number'.$suffix.'" value="'.GETPOST('lot_number'.$suffix).'">';
print '</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="nowraponall">';
$dlcdatesuffix = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
print $form->selectDate($dlcdatesuffix, 'dlc'.$suffix, '', '', 1, '');
@ -917,8 +917,8 @@ if ($id > 0 || !empty($ref)) {
} else {
$type = 'dispatch';
$colspan = 7;
$colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan;
$colspan = (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) ? --$colspan : $colspan;
$colspan = (!empty($conf->global->PRODUCT_DISABLE_EATBY)) ? --$colspan : $colspan;
print '<td class="right">';
print '</td>'; // Qty to dispatch
print '<td>';
@ -1140,12 +1140,12 @@ if ($id > 0 || !empty($ref)) {
print '<td>'.$langs->trans("DateDeliveryPlanned").'</td>';
if (!empty($conf->productbatch->enabled)) {
print '<td class="dispatch_batch_number_title">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc_title">'.$langs->trans("SellByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo_title">'.$langs->trans("EatByDate").'</td>';
}
}
print '<td class="right">'.$langs->trans("QtyDispatched").'</td>';
print '<td>'.$langs->trans("Warehouse").'</td>';
@ -1199,16 +1199,20 @@ if ($id > 0 || !empty($ref)) {
$lot = new Productlot($db);
$lot->fetch(0, $objp->pid, $objp->batch);
print '<td class="dispatch_batch_number">'.$lot->getNomUrl(1).'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo">'.dol_print_date($lot->eatby, 'day').'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc">'.dol_print_date($lot->sellby, 'day').'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo">'.dol_print_date($lot->eatby, 'day').'</td>';
}
} else {
print '<td class="dispatch_batch_number"></td>';
print '<td class="dispatch_dluo"></td>';
print '<td class="dispatch_dlc"></td>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="dispatch_dlc"></td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="dispatch_dluo"></td>';
}
}
}

View File

@ -133,12 +133,12 @@ $arrayfields = array(
//'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>"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']);
}
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
unset($arrayfields['pl.eatby']);
}
$objectlist->fields = dol_sort_array($objectlist->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -343,10 +343,10 @@ if ($resql) {
print '<td class="liste_titre center"><input class="flat" type="text" name="search_batch" size="6" value="'.$search_batch.'"></td>';
print '<td class="liste_titre right">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="liste_titre">&nbsp;</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="liste_titre">&nbsp;</td>';
}
print '<td class="liste_titre">&nbsp;</td>';
@ -367,12 +367,12 @@ if ($resql) {
print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref", $param, "", '', $sortfield, $sortorder);
//print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'',$sortfield,$sortorder, 'right );
print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch", $param, "", '', $sortfield, $sortorder, 'center ');
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center ');
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby", $param, "", '', $sortfield, $sortorder, 'center ');
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", $param, "", '', $sortfield, $sortorder, 'right ');
// TODO Add info of running suppliers/customers orders
//print_liste_field_titre("TheoreticalStock",$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'',$sortfield,$sortorder, 'right ');
@ -470,23 +470,30 @@ if ($resql) {
}
print '</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="center">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="center">'.dol_print_date($db->jdate($objp->sellby), 'day').'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="center">'.dol_print_date($db->jdate($objp->eatby), 'day').'</td>';
}
print '<td class="right">';
//if ($objp->seuil_stock_alerte && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' ';
print $objp->stock_physique;
print '</td>';
print '<td class="right">';
print img_picto($langs->trans("StockMovement"), 'movement', 'class="pictofixedwidth"');
print '<a href="'.DOL_URL_ROOT.'/product/stock/movement_list.php?idproduct='.$product_static->id.'&search_warehouse='.$objp->fk_entrepot.'&search_batch='.($objp->batch != 'Undefined' ? $objp->batch : 'Undefined').'">'.$langs->trans("Movements").'</a>';
print '</td>';
print '<td class="right nowrap">'.$product_static->LibStatut($objp->statut, 5, 0).'</td>';
print '<td class="right nowrap">'.$product_static->LibStatut($objp->tobuy, 5, 1).'</td>';
print '<td></td>';
print "</tr>\n";
$i++;
}

View File

@ -136,12 +136,12 @@ $arrayfields = array(
//'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
//'m.tms'=>array('label'=>"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']);
}
if (!empty($conf->global->PRODUCT_DISABLE_EATBY)) {
unset($arrayfields['pl.eatby']);
}
// Security check
if (!$user->rights->stock->mouvement->lire) {

View File

@ -946,14 +946,14 @@ if (!$variants) {
}
print '</td>';
print '<td class="right">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$colspan--;
print '<td class="center width100">'.$langs->trans("EatByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
$colspan--;
print '<td class="center width100">'.$langs->trans("SellByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$colspan--;
print '<td class="center width100">'.$langs->trans("EatByDate").'</td>';
}
print '<td colspan="'.$colspan.'"></td>';
print '<td></td>';
print '<td></td>';
@ -1061,16 +1061,16 @@ if (!$variants) {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="pdluoid" value="'.$pdluo->id.'"><input type="hidden" name="action" value="updateline"><input type="hidden" name="id" value="'.$id.'"><table class="noborder centpercent"><tr><td width="10%"></td>';
print '<td class="right" width="10%"><input type="text" name="batch_number" value="'.$pdluo->batch.'"></td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="center" width="10%">';
print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0);
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="center" width="10%">';
print $form->selectDate($pdluo->sellby, 'sellby', '', '', 1, '', 1, 0);
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="center" width="10%">';
print $form->selectDate($pdluo->eatby, 'eatby', '', '', 1, '', 1, 0);
print '</td>';
}
print '<td class="right" colspan="3">'.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').'</td>';
print '<td colspan="4"><input type="submit" class="button button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'">';
print '<input type="submit" class="button button-cancel" id="cancellinebutton" name="Cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
@ -1087,14 +1087,14 @@ if (!$variants) {
print $product_lot_static->getNomUrl(1);
print '</td>';
$colspan = 3;
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$colspan--;
print '<td class="center">'.dol_print_date($pdluo->eatby, 'day').'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
$colspan--;
print '<td class="center">'.dol_print_date($pdluo->sellby, 'day').'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
$colspan--;
print '<td class="center">'.dol_print_date($pdluo->eatby, 'day').'</td>';
}
print '<td class="right" colspan="'.$colspan.'">'.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').'</td>';
print '<td colspan="4"></td>';
print '<td>';

View File

@ -463,16 +463,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print $producttmp->getNomUrl(1, 'stock')." - ".$producttmp->label;
print '</td></tr>';
// Eat by
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<tr><td>';
print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
print '</td><td>';
print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
print '</td>';
print '</tr>';
}
// Sell by
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<tr><td>';
@ -483,6 +473,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</tr>';
}
// Eat by
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<tr><td>';
print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
print '</td><td>';
print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker');
print '</td>';
print '</tr>';
}
if (!empty($conf->global->PRODUCT_LOT_ENABLE_TRACEABOLITY)) {
print '<tr><td>'.$form->editfieldkey($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->rights->stock->creer).'</td>';
print '<td>'.$form->editfieldval($langs->trans('ManufacturingDate'), 'manufacturing_date', $object->manufacturing_date, $object, $user->rights->stock->creer, 'datepicker').'</td>';

View File

@ -120,18 +120,18 @@ if (!empty($conf->productbatch->enabled) &&
print '</td>';
print '</tr>';
print '<tr>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td>'.$langs->trans("EatByDate").'</td><td>';
$eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td>'.$langs->trans("SellByDate").'</td><td>';
$sellbyselected = dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
print $form->selectDate($sellbyselected, 'sellby', '', '', 1, "");
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td>'.$langs->trans("EatByDate").'</td><td>';
$eatbyselected = dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
print $form->selectDate($eatbyselected, 'eatby', '', '', 1, "");
print '</td>';
}
print '</tr>';
}

View File

@ -110,16 +110,16 @@ if (!empty($conf->productbatch->enabled) &&
print '</tr>';
print '<tr>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td>'.$langs->trans("EatByDate").'</td><td>';
print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td>'.$langs->trans("SellByDate").'</td><td>';
print $form->selectDate(($d_sellby ? $d_sellby : $pdluo->sellby), 'sellby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td>'.$langs->trans("EatByDate").'</td><td>';
print $form->selectDate(($d_eatby ? $d_eatby : $pdluo->eatby), 'eatby', '', '', 1, "", 1, 0, ($pdluoid > 0 ? 1 : 0)); // If form was opened for a specific pdluoid, field is disabled
print '</td>';
}
print '</tr>';
}

View File

@ -999,12 +999,12 @@ if ($action == 'create') {
}
if (!empty($conf->productbatch->enabled)) {
print '<td class="left">'.$langs->trans("batch_number").'</td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="left">'.$langs->trans("EatByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="left">'.$langs->trans("SellByDate").'</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="left">'.$langs->trans("EatByDate").'</td>';
}
}
print "</tr>\n";
}
@ -1153,12 +1153,12 @@ if ($action == 'create') {
if (!empty($conf->productbatch->enabled)) {
if (!empty($product->status_batch)) {
print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print '<td class="nowraponall">';
print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc'.$indiceAsked, '', '', 1, "");
print '</td>';
}
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print '<td class="nowraponall">';
print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo'.$indiceAsked, '', '', 1, "");
print '</td>';
@ -1829,14 +1829,14 @@ if ($action == 'create') {
print '<td>'.$formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).'</td>';
// Batch number managment
if ($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)) {
print '<td class="nowraponall"><input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"></br>';
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print $langs->trans('EatByDate').' : ';
print $form->selectDate($lines[$i]->eatby, 'dlc'.$line_id, '', '', 1, "").'</br>';
}
print '<td class="nowraponall"><input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"><br>';
if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
print $langs->trans('SellByDate').' : ';
print $form->selectDate($lines[$i]->sellby, 'dluo'.$line_id, '', '', 1, "");
print $form->selectDate($lines[$i]->sellby, 'dlc'.$line_id, '', '', 1, "").'</br>';
}
if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
print $langs->trans('EatByDate').' : ';
print $form->selectDate($lines[$i]->eatby, 'dluo'.$line_id, '', '', 1, "");
}
print '</td>';
}