fix: stampa fatture di vendita con note

This commit is contained in:
valentina 2024-10-31 17:07:52 +01:00
parent 0b1e4d764e
commit a02499cea8
2 changed files with 7 additions and 2 deletions

View File

@ -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);
}

View File

@ -253,6 +253,7 @@ if (!empty($record['note'])) {
echo '
<p class="small-bold text-muted">'.tr('Note', [], ['upper' => true]).':</p>
<p>'.nl2br((string) $record['note']).'</p>';
$autofill->count($record['note'], true);
}
echo '