1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-23 05:54:03 +01:00

Aggiornamento delle stampe

Miglioramento dello stile delle stampe convertite.
This commit is contained in:
Thomas Zilio 2017-09-13 11:15:31 +02:00
parent 5818082c08
commit a9b71e9c4b
12 changed files with 269 additions and 238 deletions

View File

@ -797,7 +797,7 @@ function sum($first, $second = null, $decimals = null)
} }
} }
return $result; return floatval($result);
} }
function redirectOperation($id_module, $id_record) function redirectOperation($id_module, $id_record)

View File

@ -8,6 +8,7 @@ p {
margin: 0px; margin: 0px;
} }
.text-bold,
.small-bold { .small-bold {
font-weight: bold; font-weight: bold;
} }
@ -42,10 +43,24 @@ table.table-bordered thead tr:nth-child(2) th {
small, small,
.small, .small,
.small-bold, .small-bold,
table.table-bordered>th { table.table-bordered thead th,
table#contents thead th {
font-size: 70%; font-size: 70%;
} }
table.table-normal,
table.table-normal td,
table.table-normal th {
border: 0;
}
table.border-bottom,
table.border-bottom td,
table.border-bottom th {
border: 0;
border-bottom: 1px solid #aaa;
}
table.table-bordered, table.table-bordered,
table.table-bordered td, table.table-bordered td,
table.table-bordered th { table.table-bordered th {
@ -63,10 +78,6 @@ table#contents tbody td {
border-bottom: 0; border-bottom: 0;
} }
table#contents thead th {
font-size: 80%;
}
.row, .row,
.col-xs-1, .col-xs-1,
.col-xs-2, .col-xs-2,

View File

@ -208,7 +208,7 @@ $pagamento = $rs[0]['descrizione'];
echo ' echo '
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th colspan="2" class="text-center"> <th colspan="2" class="text-center" style="font-size:13pt;">
'.tr('Condizioni generali di fornitura', [], ['upper' => true]).' '.tr('Condizioni generali di fornitura', [], ['upper' => true]).'
</th> </th>
</tr> </tr>

View File

@ -9,17 +9,12 @@ $autofill = [
'words' => 70, 'words' => 70,
'rows' => 16, 'rows' => 16,
'additional' => 15, 'additional' => 15,
'columns' => $mostra_prezzi ? 6 : 2, 'columns' => $mostra_prezzi ? 5 : 2,
]; ];
$v_iva = []; $imponibile = [];
$v_totale = []; $iva = [];
$sconto = [];
$totale_ddt = 0.00;
$totale_imponibile = 0.00;
$totale_iva = 0.00;
$sconto = 0.00;
$sconto_generico = 0.00;
// Intestazione tabella per righe // Intestazione tabella per righe
echo " echo "
@ -27,14 +22,13 @@ echo "
<thead> <thead>
<tr> <tr>
<th class='text-center'>".tr('Descrizione', [], ['upper' => true])."</th> <th class='text-center'>".tr('Descrizione', [], ['upper' => true])."</th>
<th class='text-center' style='width:7%'>".tr('Q.tà', [], ['upper' => true]).'</th>'; <th class='text-center' style='width:10%'>".tr('Q.tà', [], ['upper' => true]).'</th>';
if ($mostra_prezzi) { if ($mostra_prezzi) {
echo " echo "
<th class='text-center' style='width:15%'>".tr('Prezzo unitario', [], ['upper' => true])."</th> <th class='text-center' style='width:15%'>".tr('Prezzo unitario', [], ['upper' => true])."</th>
<th class='text-center' style='width:15%'>".tr('Importo', [], ['upper' => true])."</th> <th class='text-center' style='width:15%'>".tr('Importo', [], ['upper' => true])."</th>
<th class='text-center' style='width:10%'>".tr('Sconto', [], ['upper' => true])."</th> <th class='text-center' style='width:10%'>".tr('IVA', [], ['upper' => true]).' (%)</th>';
<th class='text-center' style='width:7%'>".tr('IVA', [], ['upper' => true]).' (%)</th>';
} }
echo ' echo '
@ -44,81 +38,77 @@ if ($mostra_prezzi) {
<tbody>'; <tbody>';
// Righe // Righe
$rs_gen = $dbo->fetchArray("SELECT *, (SELECT percentuale FROM co_iva WHERE id=idiva) AS perc_iva FROM `dt_righe_ddt` WHERE idddt='$idddt'"); $rs_gen = $dbo->fetchArray('SELECT *, (SELECT percentuale FROM co_iva WHERE id=idiva) AS perc_iva, IFNULL((SELECT peso_lordo FROM mg_articoli WHERE id=idarticolo),0) AS peso_lordo, IFNULL((SELECT volume FROM mg_articoli WHERE id=idarticolo),0) AS volume FROM `dt_righe_ddt` WHERE idddt='.prepare($idddt));
$imponibile_gen = 0.0;
$iva_gen = 0.0;
foreach ($rs_gen as $r) { foreach ($rs_gen as $r) {
$autofill['count'] += ceil(strlen($r['descrizione']) / $autofill['words']); $count = 0;
$autofill['count'] += substr_count($r['descrizione'], PHP_EOL); $count += ceil(strlen($r['descrizione']) / $autofill['words']);
$count += substr_count($r['descrizione'], PHP_EOL);
$descrizione = $r['descrizione']; echo '
$qta = $r['qta']; <tr>
$subtot = $r['subtotale'] / $r['qta']; <td>
$subtotale = $r['subtotale']; '.nl2br($r['descrizione']);
$sconto = $r['sconto'];
$iva = $r['iva']; // Aggiunta riferimento a ordine
if (!empty($r['idordine'])) {
$rso = $dbo->fetchArray('SELECT numero, numero_esterno, data FROM or_ordini WHERE id='.prepare($r['idordine']));
$numero = !empty($rso[0]['numero_esterno']) ? $rso[0]['numero_esterno'] : $rso[0]['numero'];
if (empty($r['sconto_globale'])) {
$sconto_generico = $r['subtotale'];
$iva_gen += $r['iva'];
} else {
echo ' echo '
<tr> <br/><small>'.tr('Rif. ordine n<sup>o</sup>_NUM_ del _DATE_', [
<td> '_NUM_' => $numero,
'.nl2br($descrizione); '_DATE_' => Translator::dateToLocale($rso[0]['data']),
]).'</small>';
// Aggiunta riferimento a ordine if ($count <= 1) {
if (!empty($r['idordine'])) { $count += 0.4;
$rso = $dbo->fetchArray('SELECT numero, numero_esterno, data FROM or_ordini WHERE id='.prepare($r['idordine']));
$numero = !empty($rso[0]['numero_esterno']) ? $rso[0]['numero_esterno'] : $rso[0]['numero'];
echo '
<br/><small>'.tr('Rif. ordine n<sup>o</sup>_NUM_ del _DATE_', [
'_NUM_' => $numero,
'_DATE_' => Translator::dateToLocale($rso[0]['data']),
]).'</small>';
$autofill['count'] += 0.4;
} }
echo '
</td>';
echo "
<td class='center' valign='top'>
".Translator::numberToLocale($qta, 2).'
</td>';
if ($mostra_prezzi) {
echo "
<td align='right' class='' valign='top'>
".Translator::numberToLocale($subtot, 2).' &euro;
</td>';
// Imponibile
echo "
<td align='right' class='' valign='top'>
".Translator::numberToLocale($subtotale, 2).' &euro;
</td>';
// Sconto
echo "
<td align='right' class='' valign='top'>
".Translator::numberToLocale($r['sconto_unitario'], 2).($r['tipo_sconto'] == 'PRC' ? '%' : ' &euro;').'
</td>';
// Iva
echo "
<td align='center' valign='top'>
".Translator::numberToLocale($r['perc_iva'], 2).'
</td>';
}
echo '
</tr>';
$imponibile_gen += $subtotale;
$iva_gen += $iva;
$sconto += $sconto;
} }
echo '
</td>';
echo "
<td class='text-center'>
".Translator::numberToLocale($r['qta'], 2).' '.$r['um'].'
</td>';
if ($mostra_prezzi) {
echo "
<td class='text-right'>
".Translator::numberToLocale($r['subtotale'] / $r['qta'], 2).' &euro;
</td>';
// Imponibile
echo "
<td class='text-right'>
".Translator::numberToLocale($r['subtotale'], 2).' &euro;';
if ($r['sconto'] > 0) {
if ($count <= 1) {
$count += 0.4;
}
echo "
<br><small class='help-block'>- sconto ".Translator::numberToLocale($r['sconto_unitario']).($r['tipo_sconto'] == 'PRC' ? '%' : ' &euro;').'</small>';
}
echo '
</td>';
// Iva
echo "
<td class='text-center'>
".Translator::numberToLocale($r['perc_iva'], 2).'
</td>';
}
echo '
</tr>';
$autofill['count'] += $count;
$imponibile[] = $r['subtotale'];
$iva[] = $r['iva'];
$sconto[] = $r['sconto'];
} }
echo ' echo '
@ -127,6 +117,10 @@ echo '
</table>'; </table>';
// Info per il footer // Info per il footer
$imponibile_ddt = $imponibile_gen; $imponibile = sum($imponibile) - sum($sconto);
$totale_iva = $iva_gen; $iva = sum($iva);
$totale_ddt = $imponibile_gen;
$totale = $imponibile + $iva;
$volume = sum(array_column($rs_gen, 'volume'));
$peso_lordo = sum(array_column($rs_gen, 'peso_lordo'));

View File

@ -21,7 +21,7 @@ if ($mostra_prezzi) {
echo " echo "
<tr> <tr>
<td class='cell-padded text-right'> <td class='cell-padded text-right'>
".Translator::numberToLocale($imponibile_ddt, 2).' &euro; ".Translator::numberToLocale($imponibile, 2).' &euro;
</td> </td>
</tr>'; </tr>';
@ -35,7 +35,7 @@ if ($mostra_prezzi) {
<tr> <tr>
<td class='cell-padded text-right'> <td class='cell-padded text-right'>
".Translator::numberToLocale($totale_iva, 2).' &euro; ".Translator::numberToLocale($iva, 2).' &euro;
</td> </td>
</tr>'; </tr>';
@ -49,7 +49,7 @@ if ($mostra_prezzi) {
<tr> <tr>
<td class='cell-padded text-right'> <td class='cell-padded text-right'>
".Translator::numberToLocale($totale_ddt, 2).' &euro; ".Translator::numberToLocale($totale, 2).' &euro;
</td> </td>
</tr>'; </tr>';
} else { } else {
@ -66,84 +66,103 @@ if ($mostra_prezzi) {
echo ' echo '
</table>'; </table>';
// Informazioni aggiuntive
echo ' echo '
<table class="table-bordered"> <table class="table-bordered">
<tr> <tr>
<th class="border-bottom border-right" style="width:33%"> <th class="small" class style="width:25%">
'.tr('Aspetto beni', [], ['upper' => true]).' '.tr('Aspetto beni', [], ['upper' => true]).'
</th> </th>
<th class="border-bottom border-right" style="width:33%"> <th class="small" class style="width:20%">
'.tr('N<sup>o</sup> colli', [], ['upper' => true]).'
</th>
<th class="small" style="width:30%">
'.tr('Causale trasporto', [], ['upper' => true]).' '.tr('Causale trasporto', [], ['upper' => true]).'
</th> </th>
<th class="border-bottom" style="width:33%"> <th class="small" style="width:25%">
'.tr('Porto', [], ['upper' => true]).' '.tr('Porto', [], ['upper' => true]).'
</th> </th>
</tr> </tr>
<tr> <tr>
<td class="cell-padded border-right"> <td class="cell-padded">
$aspettobeni$ &nbsp; $aspettobeni$ &nbsp;
</td> </td>
<td class="cell-padded border-right">
<td class="cell-padded">
$n_colli$ &nbsp;
</td>
<td class="cell-padded">
$causalet$ &nbsp; $causalet$ &nbsp;
</td> </td>
<td class="cell-padded"> <td class="cell-padded">
$porto$ &nbsp; $porto$ &nbsp;
</td> </td>
</tr> </tr>
<tr> <tr>
<th class="border-bottom border-right"> <th class="small">
'.tr('N<sup>o</sup> colli', [], ['upper' => true]).' '.tr('Peso lordo', [], ['upper' => true]).'
</th> </th>
<th class="border-bottom border-right"> <th class="small">
'.tr('Tipo di spedizione', [], ['upper' => true]).' '.tr('Volume', [], ['upper' => true]).'
</th> </th>
<th class="border-bottom"> <th class="small">
'.tr('Vettore', [], ['upper' => true]).' '.tr('Vettore', [], ['upper' => true]).'
</th> </th>
<th class="small">
'.tr('Tipo di spedizione', [], ['upper' => true]).'
</th>
</tr> </tr>
<tr> <tr>
<td class="cell-padded border-right"> <td class="cell-padded">
$n_colli$ &nbsp; '.(!empty($peso_lordo) ? Translator::numberToLocale($peso_lordo) : '').' &nbsp;
</td> </td>
<td class="cell-padded border-right">
$spedizione$ &nbsp; <td class="cell-padded">
'.(!empty($volume) ? Translator::numberToLocale($volume) : '').' &nbsp;
</td> </td>
<td class="cell-padded"> <td class="cell-padded">
$vettore$ &nbsp; $vettore$ &nbsp;
</td> </td>
</tr>
<td class="cell-padded">
$spedizione$ &nbsp;
</td>
</tr>
</table>';
// Firme
echo '
<table class="table-bordered">
<tr> <tr>
<th class="border-bottom border-right"> <th class="small" style="width:33%">
'.tr('Firma conducente', [], ['upper' => true]).' '.tr('Firma conducente', [], ['upper' => true]).'
</th> </th>
<th class="border-bottom border-right"> <th class="small" style="width:33%">
'.tr('Firma vettore', [], ['upper' => true]).' '.tr('Firma vettore', [], ['upper' => true]).'
</th> </th>
<th class="border-bottom"> <th class="small" style="width:33%">
'.tr('Firma destinatario', [], ['upper' => true]).' '.tr('Firma destinatario', [], ['upper' => true]).'
</th> </th>
</tr> </tr>
<tr> <tr>
<td class="cell-padded border-right"> <td style="height: 10mm"></td>
&nbsp;<br>&nbsp; <td style="height: 10mm"></td>
</td> <td style="height: 10mm"></td>
<td class="cell-padded border-right">
&nbsp;<br>&nbsp;
</td>
<td class="cell-padded">
&nbsp;<br>&nbsp;
</td>
</tr> </tr>
</table>'; </table>';

View File

@ -71,7 +71,7 @@ echo '
<div class="col-xs-5 col-xs-offset-1"> <div class="col-xs-5 col-xs-offset-1">
<table class="table" style="width:100%;margin-top:5mm;"> <table class="table" style="width:100%;margin-top:5mm;">
<tr> <tr>
<td class="border-full" style="height:16mm;"> <td class="border-full" style="height:20mm;">
<p class="small-bold">'.tr('Spett.le', [], ['upper' => true]).'</p> <p class="small-bold">'.tr('Spett.le', [], ['upper' => true]).'</p>
<p>$c_ragionesociale$</p> <p>$c_ragionesociale$</p>
<p>$c_indirizzo$ $c_citta_full$</p> <p>$c_indirizzo$ $c_citta_full$</p>

View File

@ -9,15 +9,15 @@ $autofill = [
'words' => 70, // Numero di parolo dopo cui contare una riga nuova 'words' => 70, // Numero di parolo dopo cui contare una riga nuova
'rows' => 20, // Numero di righe massimo presente nella pagina 'rows' => 20, // Numero di righe massimo presente nella pagina
'additional' => 15, // Numero di righe massimo da aggiungere 'additional' => 15, // Numero di righe massimo da aggiungere
'columns' => 6, // Numero di colonne della tabella 'columns' => 5, // Numero di colonne della tabella
]; ];
$v_iva = []; $v_iva = [];
$v_totale = []; $v_totale = [];
$sconto = 0; $sconto = [];
$imponibile = 0; $imponibile = [];
$iva = 0; $iva = [];
// Intestazione tabella per righe // Intestazione tabella per righe
echo " echo "
@ -25,11 +25,10 @@ echo "
<thead> <thead>
<tr> <tr>
<th class='text-center' style='width:50%'>".tr('Descrizione', [], ['upper' => true])."</th> <th class='text-center' style='width:50%'>".tr('Descrizione', [], ['upper' => true])."</th>
<th class='text-center' style='width:10%'>".tr('Q.tà', [], ['upper' => true])."</th> <th class='text-center' style='width:14%'>".tr('Q.tà', [], ['upper' => true])."</th>
<th class='text-center' style='width:7%'>".tr('Um', [], ['upper' => true])."</th>
<th class='text-center' style='width:16%'>".tr('Prezzo unitario', [], ['upper' => true])."</th> <th class='text-center' style='width:16%'>".tr('Prezzo unitario', [], ['upper' => true])."</th>
<th class='text-center' style='width:20%'>".tr('Importo', [], ['upper' => true])."</th> <th class='text-center' style='width:20%'>".tr('Importo', [], ['upper' => true])."</th>
<th class='text-center' style='width:7%'>".tr('IVA', [], ['upper' => true]).' (%)</th> <th class='text-center' style='width:10%'>".tr('IVA', [], ['upper' => true]).' (%)</th>
</tr> </tr>
</thead> </thead>
@ -38,8 +37,9 @@ echo "
// RIGHE FATTURA CON ORDINAMENTO UNICO // RIGHE FATTURA CON ORDINAMENTO UNICO
$righe = $dbo->fetchArray("SELECT *, IFNULL((SELECT codice FROM mg_articoli WHERE id=idarticolo),'') AS codice_articolo, (SELECT percentuale FROM co_iva WHERE id=idiva) AS perc_iva FROM `co_righe_documenti` WHERE iddocumento=".prepare($iddocumento).' ORDER BY `order`'); $righe = $dbo->fetchArray("SELECT *, IFNULL((SELECT codice FROM mg_articoli WHERE id=idarticolo),'') AS codice_articolo, (SELECT percentuale FROM co_iva WHERE id=idiva) AS perc_iva FROM `co_righe_documenti` WHERE iddocumento=".prepare($iddocumento).' ORDER BY `order`');
foreach ($righe as $r) { foreach ($righe as $r) {
$autofill['count'] += ceil(strlen($r['descrizione']) / $autofill['words']); $count = 0;
$autofill['count'] += substr_count($r['descrizione'], PHP_EOL); $count += ceil(strlen($r['descrizione']) / $autofill['words']);
$count += substr_count($r['descrizione'], PHP_EOL);
echo ' echo '
<tr> <tr>
@ -51,7 +51,6 @@ foreach ($righe as $r) {
<br><small>'.tr('COD. _COD_', [ <br><small>'.tr('COD. _COD_', [
'_COD_' => $r['codice_articolo'], '_COD_' => $r['codice_articolo'],
]).'</small>'; ]).'</small>';
$autofill['count'] += 0.4;
} }
// Aggiunta riferimento a ordine // Aggiunta riferimento a ordine
@ -64,7 +63,6 @@ foreach ($righe as $r) {
'_NUM_' => $numero, '_NUM_' => $numero,
'_DATE_' => Translator::dateToLocale($rso[0]['data']), '_DATE_' => Translator::dateToLocale($rso[0]['data']),
]).'</small>'; ]).'</small>';
$autofill['count'] += 0.4;
} }
// Aggiunta riferimento a ddt // Aggiunta riferimento a ddt
@ -77,20 +75,19 @@ foreach ($righe as $r) {
'_NUM_' => $numero, '_NUM_' => $numero,
'_DATE_' => Translator::dateToLocale($rso[0]['data']), '_DATE_' => Translator::dateToLocale($rso[0]['data']),
]).'</small>'; ]).'</small>';
$autofill['count'] += 0.4;
} }
// Aumento del conteggio
if ((!empty($r['codice_articolo']) || !empty($r['idordine']) || !empty($r['idddt'])) && $count <= 1) {
$count += 0.4;
}
echo ' echo '
</td>'; </td>';
echo " echo "
<td class='text-center'> <td class='text-center'>
".(empty($r['qta']) ? '' : Translator::numberToLocale($r['qta'], 2)).' ".Translator::numberToLocale($r['qta'], 2).' '.$r['um'].'
</td>';
// Unità di miusura
echo "
<td class='text-center'>
".nl2br(strtoupper($r['um'])).'
</td>'; </td>';
// Prezzo unitario // Prezzo unitario
@ -105,7 +102,9 @@ foreach ($righe as $r) {
".(empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'], 2)).' &euro;'; ".(empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'], 2)).' &euro;';
if ($r['sconto'] > 0) { if ($r['sconto'] > 0) {
$autofill['count'] += 0.4; if ($count <= 1) {
$count += 0.4;
}
echo " echo "
<br><small class='help-block'>- sconto ".Translator::numberToLocale($r['sconto_unitario']).($r['tipo_sconto'] == 'PRC' ? '%' : ' &euro;').'</small>'; <br><small class='help-block'>- sconto ".Translator::numberToLocale($r['sconto_unitario']).($r['tipo_sconto'] == 'PRC' ? '%' : ' &euro;').'</small>';
} }
@ -120,9 +119,11 @@ foreach ($righe as $r) {
</td> </td>
</tr>'; </tr>';
$imponibile += $r['subtotale']; $autofill['count'] += $count;
$iva += $r['iva'];
$sconto += $r['sconto']; $imponibile[] = $r['subtotale'];
$iva[] = $r['iva'];
$sconto[] = $r['sconto'];
$v_iva[$r['desc_iva']] += $r['iva']; $v_iva[$r['desc_iva']] += $r['iva'];
$v_totale[$r['desc_iva']] += $r['subtotale'] - $r['sconto']; $v_totale[$r['desc_iva']] += $r['subtotale'] - $r['sconto'];
@ -133,7 +134,6 @@ echo '
</tbody> </tbody>
</table>'; </table>';
// Aggiungo diciture per condizioni iva particolari // Aggiungo diciture per condizioni iva particolari
foreach ($v_iva as $key => $value) { foreach ($v_iva as $key => $value) {
$dicitura = $dbo->fetchArray('SELECT dicitura FROM co_iva WHERE descrizione = '.prepare($key)); $dicitura = $dbo->fetchArray('SELECT dicitura FROM co_iva WHERE descrizione = '.prepare($key));
@ -143,8 +143,8 @@ foreach ($v_iva as $key => $value) {
echo " echo "
<p class='text-center'> <p class='text-center'>
<b>".nl2br($testo)."</b> <b>".nl2br($testo).'</b>
</p>"; </p>';
} }
} }
@ -156,6 +156,8 @@ if (!empty($records[0]['note'])) {
} }
// Info per il footer // Info per il footer
$totale_iva = $iva; $imponibile = sum($imponibile);
$imponibile_documento = $imponibile - $sconto; $iva = sum($iva);
$totale_documento = $imponibile - $sconto + $totale_iva; $sconto = sum($sconto);
$totale = $imponibile + $iva - $sconto;

View File

@ -3,24 +3,20 @@
// SCADENZE | TOTALI // SCADENZE | TOTALI
// TABELLA PRINCIPALE // TABELLA PRINCIPALE
echo " echo "
<table> <table class='table-bordered'>
<tr> <tr>
<td style='width:158.6mm;' class='border-top border-left'></td> <td colspan=".(!empty($sconto) ? 5 : 3)." class='cell-padded' style='height:".(!empty($records[0]['ritenutaacconto']) ? 20 : 30)."mm'>";
<td style='width:33mm;' class='border-full'>
<p class='small-bold'>".tr('Totale imponibile', [], ['upper' => true])."</p>
</td>
</tr>
<tr>
<td rowspan=10 class='border-right border-bottom border-left cell-padded'>";
// Tabella (scadenze + iva) // Tabella (scadenze + iva)
echo " echo "
<table> <table class='table-normal'>
<tr> <tr>
<td style='width:10mm;'>&nbsp;</td>
<td style='width:45mm;'> <td style='width:45mm;'>
<table> <table class='border-bottom'>
<tr> <tr>
<td colspan='2' class='border-bottom'> <td colspan='2'>
<p class='small-bold'>".tr('Scadenze pagamenti', [], ['upper' => true]).'</p> <p class='small-bold'>".tr('Scadenze pagamenti', [], ['upper' => true]).'</p>
</td> </td>
</tr>'; </tr>';
@ -31,25 +27,16 @@ if (!empty($rs2)) {
for ($i = 0; $i < sizeof($rs2); ++$i) { for ($i = 0; $i < sizeof($rs2); ++$i) {
echo " echo "
<tr> <tr>
<td style='width:50%;' class='border-bottom'> <td style='width:50%;'>
<small>".Translator::dateToLocale($rs2[$i]['scadenza'])."</small> <small>".Translator::dateToLocale($rs2[$i]['scadenza'])."</small>
</td> </td>
<td style='width:50%;' align='right' class='border-bottom'> <td style='width:50%;' class='text-right'>
<small>".Translator::numberToLocale($rs2[$i]['da_pagare'], 2).' &euro;</small> <small>".Translator::numberToLocale($rs2[$i]['da_pagare'], 2).' &euro;</small>
</td> </td>
</tr>'; </tr>';
} }
} else {
echo "
<tr>
<td style='width:50%;'>
&nbsp;
</td>
<td style='width:50%;' align='right'>
&nbsp;
</td>
</tr>";
} }
echo ' echo '
</table> </table>
</td>'; </td>';
@ -64,34 +51,34 @@ echo "
<td style='width:75mm;'>"; <td style='width:75mm;'>";
if (!empty($v_iva)) { if (!empty($v_iva)) {
echo " echo "
<table> <table class='border-bottom'>
<tr> <tr>
<td style='width:40mm;' class='border-bottom'> <td style='width:40mm;'>
<p class='small-bold'>".tr('Aliquota IVA', [], ['upper' => true])."</p> <p class='small-bold'>".tr('Aliquota IVA', [], ['upper' => true])."</p>
</td> </td>
<td style='width:20mm;' class='border-bottom text-center'> <td style='width:20mm;' class='text-center'>
<p class='small-bold'>".tr('Importo', [], ['upper' => true])."</p> <p class='small-bold'>".tr('Importo', [], ['upper' => true])."</p>
</td> </td>
<td style='width:20mm;' class='border-bottom text-center'> <td style='width:20mm;' class='text-center'>
<p class='small-bold'>".tr('Importo IVA', [], ['upper' => true]).'</p> <p class='small-bold'>".tr('Importo IVA', [], ['upper' => true]).'</p>
</td> </td>
</tr>'; </tr>';
foreach ($v_iva as $desc_iva => $tot_iva) { foreach ($v_iva as $desc_iva => $tot_iva) {
if (!empty($desc_iva)) { if (!empty($desc_iva)) {
echo " echo '
<tr> <tr>
<td style='' class='border-bottom'> <td>
<small>".$desc_iva."</small> <small>'.$desc_iva."</small>
</td> </td>
<td style='' align='right' class='border-bottom'> <td class='text-right'>
<small>".Translator::numberToLocale($v_totale[$desc_iva], 2)." &euro;</small> <small>".Translator::numberToLocale($v_totale[$desc_iva], 2)." &euro;</small>
</td> </td>
<td style='' align='right' class='border-bottom'> <td class='text-right'>
<small>".Translator::numberToLocale($v_iva[$desc_iva], 2).' &euro;</small> <small>".Translator::numberToLocale($v_iva[$desc_iva], 2).' &euro;</small>
</td> </td>
</tr>'; </tr>';
@ -114,67 +101,86 @@ echo '
echo ' echo '
</td>'; </td>';
// TOTALE IMPONIBILE // TOTALI
$width = round(100/(!empty($sconto) ? 5 : 3), 2);
echo " echo "
<td style='text-align:right;' class='border-bottom border-right cell-padded'> <tr>
".Translator::numberToLocale($imponibile_documento, 2).' &euro; <th class='text-center small' style='width:".$width."'>
".tr('Imponibile', [], ['upper' => true])."
</th>";
if (!empty($sconto)) {
echo "
<th class='text-center small' style='width:".$width."'>
".tr('Sconto', [], ['upper' => true])."
</th>
<th class='text-center small' style='width:".$width."'>
".tr('Imponibile scontato', [], ['upper' => true])."
</th>";
}
echo "
<th class='text-center small' style='width:".$width."'>
".tr('Totale IVA', [], ['upper' => true])."
</th>
<th class='text-center small' style='width:".$width."'>
".tr('Totale documento', [], ['upper' => true])."
</th>
</tr>
<tr>
<td class='cell-padded text-center'>
".Translator::numberToLocale($imponibile, 2)." &euro;
</td>";
if (!empty($sconto)) {
echo "
<td class='cell-padded text-center'>
".Translator::numberToLocale($sconto, 2)." &euro;
</td>
<td class='cell-padded text-center'>
".Translator::numberToLocale($imponibile - $sconto, 2)." &euro;
</td>";
}
echo "
<td class='cell-padded text-center'>
".Translator::numberToLocale($iva, 2)." &euro;
</td>
<td class='cell-padded text-center'>
".Translator::numberToLocale($totale, 2).' &euro;
</td> </td>
</tr>'; </tr>';
// Riga 2 // Ritenuta d'acconto
echo "
<tr>
<td style='width:33mm;' class='border-bottom border-right'>
<p class='small-bold'>".tr('Totale IVA', [], ['upper' => true])."</p>
</td>
</tr>
<tr>
<td style='text-align:right;' class='border-bottom border-right cell-padded'>
".Translator::numberToLocale($totale_iva, 2)." &euro;
</td>
</tr>
<tr>
<td class='border-bottom border-right'>
<p class='small-bold'>".tr('Totale documento', [], ['upper' => true])."</p>
</td>
</tr>
<tr>
<td style='text-align:right;' class='border-bottom border-right cell-padded'>
".Translator::numberToLocale($totale_documento, 2).' &euro;
</td>
</tr>';
// Riga 4 (opzionale, solo se c'è la ritenuta d'acconto)
if ($records[0]['ritenutaacconto'] != 0) { if ($records[0]['ritenutaacconto'] != 0) {
$rs2 = $dbo->fetchArray('SELECT percentuale FROM co_ritenutaacconto WHERE id=(SELECT idritenutaacconto FROM co_righe_documenti WHERE iddocumento='.prepare($iddocumento).' AND idritenutaacconto!=0 LIMIT 0,1)'); $rs2 = $dbo->fetchArray('SELECT percentuale FROM co_ritenutaacconto WHERE id=(SELECT idritenutaacconto FROM co_righe_documenti WHERE iddocumento='.prepare($iddocumento).' AND idritenutaacconto!=0 LIMIT 0,1)');
echo " echo "
<tr> <tr>
<td class='border-bottom border-right'> <th class='text-center small' colspan=".(!empty($sconto) ? 3 : 2).">
<p class='small-bold'>".tr("Ritenuta d'acconto _PRC_%", [ ".tr("Ritenuta d'acconto _PRC_%", [
'_PRC_' => $rs2[0]['percentuale'], '_PRC_' => Translator::numberToLocale($rs2[0]['percentuale'], 0),
], ['upper' => true])."</p> ], ['upper' => true])."
</td> </th>
<th class='text-center small' colspan=".(!empty($sconto) ? 2 : 1).">
".tr('Netto a pagare', [], ['upper' => true])."
</th>
</tr> </tr>
<tr> <tr>
<td style='text-align:right;' class='border-bottom border-right cell-padded'> <td class='cell-padded text-center' colspan=".(!empty($sconto) ? 3 : 2).">
".Translator::numberToLocale($records[0]['ritenutaacconto'], 2)." &euro; ".Translator::numberToLocale($records[0]['ritenutaacconto'], 2)." &euro;
</td> </td>
</tr>
<tr> <td class='cell-padded text-center' colspan=".(!empty($sconto) ? 2 : 1).">
<td class='border-bottom border-right'> ".Translator::numberToLocale($totale - $records[0]['ritenutaacconto'], 2).' &euro;
<p class='small-bold'>".tr('Netto a pagare', [], ['upper' => true])."</p>
</td>
</tr>
<tr>
<td style='text-align:right;' class='border-bottom border-right cell-padded'>
".Translator::numberToLocale($totale_documento - $records[0]['ritenutaacconto'], 2).' &euro;
</td> </td>
</tr>'; </tr>';
} }
@ -183,13 +189,12 @@ echo '
</table>'; </table>';
echo ' echo '
<br>
<table style="font-size:7pt; color:#999;"> <table style="font-size:7pt; color:#999;">
<tr><td style="text-align:center;"> <tr>
$dicitura_fissa_fattura$ <td style="text-align:center;">
</td></tr> $dicitura_fissa_fattura$
</td>
</tr>
</table> </table>
<br>
$pagination$'; $pagination$';

View File

@ -75,7 +75,7 @@ echo '
<div class="col-xs-5 col-xs-offset-1"> <div class="col-xs-5 col-xs-offset-1">
<table class="table" style="width:100%;margin-top:5mm;"> <table class="table" style="width:100%;margin-top:5mm;">
<tr> <tr>
<td colspan=2 class="border-full" style="height:16mm;"> <td colspan=2 class="border-full" style="height:20mm;">
<p class="small-bold">'.tr('Spett.le', [], ['upper' => true]).'</p> <p class="small-bold">'.tr('Spett.le', [], ['upper' => true]).'</p>
<p>$c_ragionesociale$</p> <p>$c_ragionesociale$</p>
<p>$c_indirizzo$ $c_citta_full$</p> <p>$c_indirizzo$ $c_citta_full$</p>

View File

@ -1,6 +1,6 @@
<?php <?php
return [ return [
'header-height' => 80, 'header-height' => 75,
'footer-height' => 60, 'footer-height' => 60,
]; ];

View File

@ -12,7 +12,7 @@ $report_name = 'intervento_'.$idintervento.'.pdf';
echo ' echo '
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th colspan="4" style="font-size:14pt;" class="text-center">'.tr('Rapporto operazioni e interventi', [], ['upper' => true]).'</th> <th colspan="4" style="font-size:13pt;" class="text-center">'.tr('Rapporto operazioni e interventi', [], ['upper' => true]).'</th>
</tr> </tr>
<tr> <tr>

View File

@ -246,7 +246,7 @@ $resa_materiale = $rs[0]['descrizione'];
echo ' echo '
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th colspan="2" class="text-center"> <th colspan="2" class="text-center" style="font-size:13pt;">
'.tr('Condizioni generali di fornitura', [], ['upper' => true]).' '.tr('Condizioni generali di fornitura', [], ['upper' => true]).'
</th> </th>
</tr> </tr>