fixed note with slash
This commit is contained in:
@@ -272,11 +272,20 @@ try {
|
|||||||
return strcmp((string)($a['field_label'] ?? ''), (string)($b['field_label'] ?? ''));
|
return strcmp((string)($a['field_label'] ?? ''), (string)($b['field_label'] ?? ''));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Valori "vuoti convenzionali" da NON includere nelle note.
|
||||||
|
// Il cliente usa "/" (e simili) come placeholder di campo vuoto.
|
||||||
|
$addnotePlaceholders = ['/', '-', 'n/a', 'na', 'n.a.', '//'];
|
||||||
|
|
||||||
foreach ($addnoteRows as $r) {
|
foreach ($addnoteRows as $r) {
|
||||||
$val = trim((string)($r['field_value'] ?? ''));
|
$val = trim((string)($r['field_value'] ?? ''));
|
||||||
if ($val !== '') {
|
if ($val === '') {
|
||||||
$addnoteChunks[] = $val;
|
continue;
|
||||||
}
|
}
|
||||||
|
// Scarta i placeholder (confronto case-insensitive)
|
||||||
|
if (in_array(mb_strtolower($val), $addnotePlaceholders, true)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$addnoteChunks[] = $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
$addnoteText = implode(' - ', $addnoteChunks);
|
$addnoteText = implode(' - ', $addnoteChunks);
|
||||||
|
|||||||
Reference in New Issue
Block a user