fix: stampa fatture di vendita con note
This commit is contained in:
parent
0b1e4d764e
commit
a02499cea8
|
@ -46,14 +46,18 @@ class Autofill
|
||||||
$this->max_rows_first_page = $first_page ?? $this->max_rows_first_page;
|
$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);
|
$count = ceil(strlen((string) $text) / $this->char_number);
|
||||||
|
|
||||||
// Ricerca dei caratteri a capo
|
// Ricerca dei caratteri a capo
|
||||||
preg_match_all("/(\r\n|\r|\n)/", (string) $text, $matches);
|
preg_match_all("/(\r\n|\r|\n)/", (string) $text, $matches);
|
||||||
$count += count($matches[0]);
|
$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);
|
$this->set($count);
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,6 +253,7 @@ if (!empty($record['note'])) {
|
||||||
echo '
|
echo '
|
||||||
<p class="small-bold text-muted">'.tr('Note', [], ['upper' => true]).':</p>
|
<p class="small-bold text-muted">'.tr('Note', [], ['upper' => true]).':</p>
|
||||||
<p>'.nl2br((string) $record['note']).'</p>';
|
<p>'.nl2br((string) $record['note']).'</p>';
|
||||||
|
$autofill->count($record['note'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
|
|
Loading…
Reference in New Issue