Fix default fields for POS

This commit is contained in:
Laurent Destailleur 2025-10-22 22:07:17 +02:00
parent 93bb6035b8
commit ec109fa7ea

View file

@ -335,12 +335,19 @@ foreach ($object->fields as $key => $val) {
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
// For POS context, we force possource and posmodule
$arrayfields["f.pos_source"]['checked'] = 1;
// For POS context, we force some fields
if ($contextpage == 'poslist') {
$arrayfields["f.pos_source"]['checked'] = 1;
$arrayfields["f.date_lim_reglement"]['checked'] = 0;
$arrayfields["f.total_ttc"]['checked'] = 1;
$arrayfields["f.tms"]['checked'] = 1;
$arrayfields["p.ref"]['checked'] = 0;
}
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Check only if it's an internal user, external users are already filtered by $socid
if (empty($user->socid) && !$user->hasRight('societe', 'client', 'voir')) {
$search_sale = $user->id;