safe_truncate per CausaleTrasporto in exportFE

charcounter per note fattura
This commit is contained in:
Luca 2022-08-04 18:16:49 +02:00
parent e1e9d5a9a3
commit 6583b22ead
4 changed files with 15 additions and 4 deletions

View File

@ -38,10 +38,11 @@ function initCharCounter(input) {
postText: '',
showMaxLength: true,
placement: 'bottom-right-inside',
utf8: false,
utf8: false, //Default: false
appendToParent: true,
alwaysShow: true,
//threshold: 150,
twoCharLinebreak: false, //count linebreak as 2 characters to match IE/Chrome textarea validation. Default: true.
warningClass: "small form-text text-muted",
limitReachedClass: "small form-text text-warning",
limitExceededClass: "small form-text text-danger",
@ -56,7 +57,8 @@ function initCharCounter(input) {
limitReachedClass: "help-block text-danger",
showMaxLength: false,
placement: 'bottom-right-inside',
utf8: false,
utf8: false, //Default: false
twoCharLinebreak: false, //count linebreak as 2 characters to match IE/Chrome textarea validation. Default: true.
appendToParent: true,
alwaysShow: true
});

View File

@ -547,7 +547,7 @@ echo '
?>
<div class="row">
<div class="col-md-12">
{[ "type": "textarea", "label": "<?php echo tr('Note'); ?>", "name": "note", "help": "<?php echo tr('Note visibili anche in fattura.'); ?>", "value": "$note$" ]}
{[ "type": "textarea", "label": "<?php echo tr('Note'); ?>", "name": "note", "help": "<?php echo tr('Note visibili anche in fattura.'); ?>", "value": "$note$", "charcounter": 1 ]}
</div>
</div>

View File

@ -1037,7 +1037,15 @@ class FatturaElettronica
}
if (!empty($causale)) {
$result['CausaleTrasporto'] = $causale;
/**
* Id SdI: 2.1.9.3
* Caratteri min-max: 1 - 100 caretteri
* Ripetibile: No
*/
$result['CausaleTrasporto'] = safe_truncate(html_entity_decode($causale), 100, null);
}
if (!empty($documento['n_colli'])) {

View File

@ -636,6 +636,7 @@ class Validator
$output = htmlspecialchars($output, ENT_NOQUOTES | ENT_XML1 | ENT_SUBSTITUTE, 'UTF-8', false);
// Gestione dei caratteri non supportati e sostituzione con alternativi
// Problemi noti: sostituendo 1 carattere con 2 o più potrebbero verificarsi problemi se, per il testo di quel nodo, si era raggiunta la lunghezza massima prevista dal tracciato
$output = replace($output, [
'€' => 'euro',
'—' => '-',