1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-10 14:44:04 +01:00

fix: stampa ddt

This commit is contained in:
valentina 2024-11-27 14:42:16 +01:00
parent 9e5af1ae18
commit 467b5c4bb2
3 changed files with 7 additions and 12 deletions

View File

@ -47,12 +47,10 @@ class Autofill
public function count($text, $small = null)
{
$count = ceil(strlen((string) $text) / $this->char_number);
$text = strip_tags($text);
$count = ceil(strlen($text) / $this->char_number);
// Ricerca dei caratteri a capo e <br>
preg_match_all("/(\r\n|\r|\n|<br\s*\/?>)/", (string) $text, $matches);
$count += count($matches[0]);
if ($small || $count != 1) {
if ($small) {
$count /= 1.538461538;
}

View File

@ -23,8 +23,8 @@ $prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA');
// Creazione righe fantasma
$autofill = new Util\Autofill($options['pricing'] ? 6 : 3, 70);
$rows_per_page = $options['pricing'] ? 20 : 18;
$autofill->setRows($rows_per_page, 0, $options['pricing'] ? 20 : 18);
$rows_per_page = ($documento['note'] || $options['pricing'] ? 19 : 27);
$autofill->setRows($rows_per_page, 0, 32 );
// Intestazione tabella per righe
echo "
@ -119,13 +119,10 @@ foreach ($righe as $riga) {
echo $num.'
</td>
<td>'.nl2br((string) $r['descrizione']);
if ($riga->isArticolo()) {
echo '<br><small>'.$riga->codice.'</small>';
$autofill->count($riga->codice);
} else {
echo '-';
$autofill->count($riga->codice, true);
}
if ($riga->isArticolo()) {

View File

@ -115,7 +115,7 @@ if ($options['pricing']) {
</td>
</tr>';
}
} else {
} else if ($documento['note']){
// Riga 1
echo "
<tr>