1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-01-07 13:22:15 +01:00

fix: calcolo righe in template di stampa

This commit is contained in:
valentina 2024-11-11 16:49:08 +01:00
parent 5efc289437
commit 83aae51642
4 changed files with 60 additions and 81 deletions

View File

@ -22,9 +22,9 @@ include_once __DIR__.'/../../core.php';
$prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA');
// Creazione righe fantasma
$autofill = new Util\Autofill($options['pricing'] ? 6 : 3);
$rows_per_page = $options['pricing'] ? 20 : 19;
$autofill->setRows($rows_per_page, 0, $options['pricing'] ? 20 : 19);
$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);
// Intestazione tabella per righe
echo "
@ -75,8 +75,6 @@ foreach ($righe as $riga) {
++$num;
$r = $riga->toArray();
$autofill->count($r['descrizione']);
echo '
<tr>
<td class="text-center" style="vertical-align: middle">';
@ -109,26 +107,23 @@ foreach ($righe as $riga) {
<td>
'.nl2br($text);
$autofill->count($text);
}
}
$r['descrizione'] = preg_replace("/Rif\.(.*)/s", '', (string) $r['descrizione']);
$autofill->count($r['descrizione']);
}
$source_type = $riga::class;
if (!setting('Visualizza riferimento su ogni riga in stampa')) {
echo $num.'
</td>
<td>'.$r['descrizione'];
} else {
echo $num.'
</td>
<td>'.nl2br((string) $r['descrizione']);
}
$autofill->count($r['descrizione']);
echo $num.'
</td>
<td>'.nl2br((string) $r['descrizione']);
if ($riga->isArticolo()) {
echo '<br><small>'.$riga->codice.'</small>';
$autofill->count($riga->codice);
} else {
echo '-';
}

View File

@ -60,39 +60,7 @@ $columns = $options['pricing'] ? $columns : $columns - 3;
// Creazione righe fantasma
$autofill = new Util\Autofill($columns);
$autofill->setRows(27, 0, 31);
// Informazioni aggiuntive
echo '
<table class="table table-striped border-bottom">
<tr>
<td class="small-bold text-muted" style="width:33%">
'.tr('Porto', [], ['upper' => true]).'
</td>
<td class="small-bold text-muted" style="width:33%">
'.tr('Tipo di spedizione', [], ['upper' => true]).'
</td>
<td class="small-bold text-muted" style="width:33%">
'.tr('Vettore', [], ['upper' => true]).'
</td>
</tr>
<tr>
<td class="cell-padded">
$porto$ &nbsp;
</td>
<td class="cell-padded">
$spedizione$ &nbsp;
</td>
<td class="cell-padded">
$vettore$ &nbsp;
</td>
</tr>
</table>';
$autofill->setRows(27, 0, 32);
// Intestazione tabella per righe
echo "
@ -177,47 +145,32 @@ foreach ($righe as $riga) {
echo '
<td>
'.nl2br($text);
$autofill->count($text);
}
}
$r['descrizione'] = preg_replace("/(\r\n|\r|\n)Rif\.(.*)/s", '', (string) $r['descrizione']);
$autofill->count($r['descrizione']);
}
$source_type = $riga::class;
if (!setting('Visualizza riferimento su ogni riga in stampa')) {
echo $num.'</td>';
if ($has_image) {
if ($riga->isArticolo() && !empty($riga->articolo->image)) {
echo '
<td align="center">
<img src="'.$riga->articolo->image.'" style="max-height: 80px; max-width:120px">
</td>';
} else {
echo '
<td></td>';
}
}
echo '
<td>'.$r['descrizione'];
} else {
$autofill->count($r['descrizione']);
echo $num.'
$autofill->count($r['descrizione']);
echo $num.'</td>';
if ($has_image) {
if ($riga->isArticolo() && !empty($riga->articolo->image)) {
echo '
<td align="center">
<img src="'.$riga->articolo->image.'" style="max-height: 80px; max-width:120px">
</td>';
if ($has_image) {
if ($riga->isArticolo() && !empty($riga->articolo->image)) {
echo '
<td align="center">
<img src="'.$riga->articolo->image.'" style="max-height: 80px; max-width:120px">
</td>';
} else {
echo '
<td></td>';
}
} else {
echo '
<td></td>';
}
echo '
<td>'.nl2br((string) $r['descrizione']);
}
echo '
<td>'.nl2br((string) $r['descrizione']);
if ($documento->direzione == 'uscita') {
echo '
<td class="text-center" style="vertical-align: middle">

View File

@ -60,6 +60,37 @@ echo '
</td>
</tr>
</table>
<table class="table table-striped border-bottom">
<tr>
<td class="small-bold text-muted" style="width:33%">
'.tr('Porto', [], ['upper' => true]).'
</td>
<td class="small-bold text-muted" style="width:33%">
'.tr('Tipo di spedizione', [], ['upper' => true]).'
</td>
<td class="small-bold text-muted" style="width:33%">
'.tr('Vettore', [], ['upper' => true]).'
</td>
</tr>
<tr>
<td class="cell-padded">
$porto$ &nbsp;
</td>
<td class="cell-padded">
$spedizione$ &nbsp;
</td>
<td class="cell-padded">
$vettore$ &nbsp;
</td>
</tr>
</table>
</div>
<!-- Dati Cliente/Fornitore -->

View File

@ -65,7 +65,7 @@ if ($has_image) {
// Creazione righe fantasma
$autofill = new Util\Autofill($columns);
$autofill->setRows(22, 0);
$autofill->setRows(22, 0, 36);
echo '
<div class="col-xs-5">