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

This commit is contained in:
Laurent Destailleur 2022-02-28 21:34:17 +01:00
commit b7d20ff20b
3 changed files with 7 additions and 8 deletions

View File

@ -765,8 +765,8 @@ if (empty($reshook)) {
// Define special_code for special lines // Define special_code for special lines
$special_code = GETPOST('special_code', 'int'); $special_code = GETPOST('special_code', 'int');
if (!GETPOST('qty', 'alpha')) { if ($special_code == 3) {
$special_code = 3; $special_code = 0; // Options should not exists on invoices
} }
/*$line = new FactureLigne($db); /*$line = new FactureLigne($db);

View File

@ -2371,9 +2371,9 @@ if (empty($reshook)) {
} }
// Define special_code for special lines // Define special_code for special lines
$special_code = GETPOST('special_code'); $special_code = GETPOST('special_code', 'int');
if (!GETPOST('qty')) { if ($special_code == 3) {
$special_code = 3; $special_code = 0; // Options should not exists on invoices
} }
$line = new FactureLigne($db); $line = new FactureLigne($db);

View File

@ -18,15 +18,14 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
if (empty($extrafieldsobjectprefix)) { if (empty($extrafieldsobjectprefix)) {
$extrafieldsobjectprefix = 'ef.'; $extrafieldsobjectprefix = 'ef.';
} }
foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) { foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['list'][$key])) { if (!empty($extrafields->attributes[$extrafieldsobjectkey]['list'][$key])) {
$arrayfields[$extrafieldsobjectprefix.$key] = array( $arrayfields[$extrafieldsobjectprefix.$key] = array(
'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key],
'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key], 'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key],
'checked' => (($extrafields->attributes[$extrafieldsobjectkey]['list'][$key] < 0) ? 0 : 1), 'checked' => ((dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1) <= 0) ? 0 : 1),
'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key], 'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key],
'enabled' => (abs((int) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key]) != 3 && $extrafields->attributes[$extrafieldsobjectkey]['perms'][$key]), 'enabled' => (abs((int) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key]) != 3 && dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1)),
'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key], 'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key],
'help' => $extrafields->attributes[$extrafieldsobjectkey]['help'][$key], 'help' => $extrafields->attributes[$extrafieldsobjectkey]['help'][$key],
); );