diff --git a/src/Util/Autofill.php b/src/Util/Autofill.php index 1d4f1371a..9f88ecf6e 100755 --- a/src/Util/Autofill.php +++ b/src/Util/Autofill.php @@ -46,14 +46,18 @@ class Autofill $this->max_rows_first_page = $first_page ?? $this->max_rows_first_page; } - public function count($text, $small = false) + public function count($text, $small = null) { $count = ceil(strlen((string) $text) / $this->char_number); // Ricerca dei caratteri a capo preg_match_all("/(\r\n|\r|\n)/", (string) $text, $matches); $count += count($matches[0]); - $count = ($count == 1 ? $count : $count / 1.538461538 ); + if ($small) { + $count *= 1.5; + } elseif ($count != 1) { + $count /= 1.538461538; + } $this->set($count); } diff --git a/templates/fatture/body.php b/templates/fatture/body.php index 6271dffcf..f736fad5c 100755 --- a/templates/fatture/body.php +++ b/templates/fatture/body.php @@ -253,6 +253,7 @@ if (!empty($record['note'])) { echo '
'.tr('Note', [], ['upper' => true]).':
'.nl2br((string) $record['note']).'
'; + $autofill->count($record['note'], true); } echo '