mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-06-05 22:09:38 +02:00
fix: stampa documenti con rimandi a capo nelle righe
This commit is contained in:
@@ -47,13 +47,21 @@ class Autofill
|
||||
|
||||
public function count($text, $small = null)
|
||||
{
|
||||
$text = strip_tags((string) $text);
|
||||
$count = ceil(strlen($text) / $this->char_number);
|
||||
$count = 0;
|
||||
$textLines = explode("\n", (string)$text);
|
||||
|
||||
foreach ($textLines as $line) {
|
||||
$count += ceil(strlen($line) / $this->char_number);
|
||||
}
|
||||
|
||||
if ($count > 1) {
|
||||
$count /= 1.25;
|
||||
}
|
||||
|
||||
if ($small) {
|
||||
$count /= 1.538461538;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->set($count);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ $autofill->setRows($rows_per_page, 0);
|
||||
|
||||
// Conteggio le righe da sottrarre al totale
|
||||
$c = 0;
|
||||
$documento['note'] ? $c += 3 : null;
|
||||
foreach ($v_iva as $desc_iva => $tot_iva) {
|
||||
++$c;
|
||||
}
|
||||
@@ -237,6 +236,10 @@ foreach ($diciture as $dicitura) {
|
||||
$autofill->count($dicitura);
|
||||
}
|
||||
|
||||
if ($documento['note']) {
|
||||
$autofill->count($documento['note']);
|
||||
$autofill->count(1);
|
||||
}
|
||||
$autofill->next();
|
||||
|
||||
echo '
|
||||
|
||||
Reference in New Issue
Block a user