Skip to content

Commit 86f7cec

Browse files
committed
fix: stampa bilancio
1 parent 333b9b3 commit 86f7cec

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

templates/bilancio/body.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@
100100
echo '
101101
<tr>
102102
<td colspan="2"><h6><b>Perdita</b></h6></td>
103-
<td class="text-right" style="font-size:8pt;"><b>'.numberFormat(abs($utile_perdita), 2).'</b></td>
103+
<td class="text-right" style="font-size:8pt;"><b>'.($utile_perdita ? numberFormat(abs($utile_perdita), 2) : '').'</b></td>
104104
</tr>
105105
<tr>
106106
<td colspan="2"><h6><b>Totale a pareggio</b></h6></td>
107-
<td class="text-right" style="font-size:8pt;"><b>'.numberFormat(abs($totale_attivita) + abs($utile_perdita), 2).'</b></td>
107+
<td class="text-right" style="font-size:8pt;"><b>'.numberFormat(($totale_attivita ? abs($totale_attivita) : 0) + ($utile_perdita ? abs($utile_perdita) : 0), 2).'</b></td>
108108
</tr>';
109109
}
110110
echo '
@@ -142,7 +142,7 @@
142142
<tr>
143143
<td>'.$liv3_p['numero'].'</td>
144144
<td>'.$liv3_p['descrizione'].'</td>
145-
<td class="text-right">'.numberFormat(abs($liv3_p['totale']), 2).'</td>
145+
<td class="text-right">'.($liv3_p['totale'] ? numberFormat(abs($liv3_p['totale']), 2) : '').'</td>
146146
</tr>';
147147
}
148148
}
@@ -156,7 +156,7 @@
156156
<tr>
157157
<td></td>
158158
<td>Clienti</td>
159-
<td class="text-right">'.numberFormat(abs($crediti_clienti), 2).'</td>
159+
<td class="text-right">'.($crediti_clienti ? numberFormat(abs($crediti_clienti), 2) : '').'</td>
160160
</tr>';
161161
} elseif ($liv2_p['id'] == setting('Conto di secondo livello per i debiti fornitori') && $debiti_fornitori < 0) {
162162
$totale_passivita += $debiti_fornitori;
@@ -165,7 +165,7 @@
165165
<tr>
166166
<td></td>
167167
<td>Fornitori</td>
168-
<td class="text-right">'.numberFormat(abs($debiti_fornitori), 2).'</td>
168+
<td class="text-right">'.($debiti_fornitori ? numberFormat(abs($debiti_fornitori), 2) : '').'</td>
169169
</tr>';
170170
}
171171
}
@@ -175,7 +175,7 @@
175175
<tr>
176176
<td><b>'.$liv2_p['numero'].'</b></td>
177177
<td><b>'.$liv2_p['descrizione'].'</b></td>
178-
<td class="text-right"><b>'.numberFormat(abs($totale_livello3), 2).'</b></td>
178+
<td class="text-right"><b>'.($totale_livello3 ? numberFormat(abs($totale_livello3), 2) : '').'</b></td>
179179
</tr>';
180180
echo $livello3;
181181
}
@@ -189,7 +189,7 @@
189189
echo '
190190
<tr>
191191
<td colspan="2"><h6><b>Utile</b></h6></td>
192-
<td class="text-right" style="font-size:8pt;"><b>'.numberFormat(abs($utile_perdita), 2).'</b></td>
192+
<td class="text-right" style="font-size:8pt;"><b>'.($utile_perdita ? numberFormat(abs($utile_perdita), 2) : '').'</b></td>
193193
</tr>
194194
<tr>
195195
<td colspan="2"><h6><b>Totale a pareggio</b></h6></td>
@@ -245,8 +245,8 @@
245245
<tr>
246246
<td>'.$liv3_e['numero'].'</td>
247247
<td>'.$liv3_e['descrizione'].'</td>
248-
<td class="text-right">'.numberFormat(abs($liv3_e['totale']), 2).'</td>
249-
<td class="text-right">'.numberFormat(abs($liv3_e['totale_reddito']), 2).'</td>
248+
<td class="text-right">'.($liv3_e['totale'] ? numberFormat(abs($liv3_e['totale']), 2) : '').'</td>
249+
<td class="text-right">'.($liv3_e['totale_reddito'] ? numberFormat(abs($liv3_e['totale_reddito']), 2) : '').'</td>
250250
</tr>';
251251
}
252252
}
@@ -257,8 +257,8 @@
257257
<tr>
258258
<td><b>'.$liv2_e['numero'].'</b></td>
259259
<td><b>'.$liv2_e['descrizione'].'</b></td>
260-
<td class="text-right"><b>'.numberFormat(abs($totale_livello3), 2).'</b></td>
261-
<td class="text-right"><b>'.numberFormat(abs($totale_reddito_livello3), 2).'</b></td>
260+
<td class="text-right"><b>'.($totale_livello3 ? numberFormat(abs($totale_livello3), 2) : '').'</b></td>
261+
<td class="text-right"><b>'.($totale_reddito_livello3 ? numberFormat(abs($totale_reddito_livello3), 2) : '').'</b></td>
262262
</tr>';
263263
echo $livello3;
264264
}
@@ -274,8 +274,8 @@
274274
echo '
275275
<tr>
276276
<td colspan="2"><h6><b>Utile</b></h6></td>
277-
<td class="text-right" style="font-size:8pt;"><b>'.numberFormat(abs($utile_perdita), 2).'</b></td>
278-
<td class="text-right" style="font-size:8pt;"><b>'.numberFormat(abs($utile_perdita_reddito), 2).'</b></td>
277+
<td class="text-right" style="font-size:8pt;"><b>'.($utile_perdita ? numberFormat(abs($utile_perdita), 2) : '').'</b></td>
278+
<td class="text-right" style="font-size:8pt;"><b>'.($utile_perdita_reddito ? numberFormat(abs($utile_perdita_reddito), 2) : '').'</b></td>
279279
</tr>
280280
<tr>
281281
<td colspan="2"><h6><b>Totale a pareggio</b></h6></td>
@@ -320,8 +320,8 @@
320320
<tr>
321321
<td>'.$liv3_e['numero'].'</td>
322322
<td>'.$liv3_e['descrizione'].'</td>
323-
<td class="text-right">'.numberFormat(abs($liv3_e['totale']), 2).'</td>
324-
<td class="text-right">'.numberFormat(abs($liv3_e['totale_reddito']), 2).'</td>
323+
<td class="text-right">'.($liv3_e['totale'] ? numberFormat(abs($liv3_e['totale']), 2) : '').'</td>
324+
<td class="text-right">'.($liv3_e['totale_reddito'] ? numberFormat(abs($liv3_e['totale_reddito']), 2) : '').'</td>
325325
</tr>';
326326
}
327327
}
@@ -332,8 +332,8 @@
332332
<tr>
333333
<td><b>'.$liv2_e['numero'].'</b></td>
334334
<td><b>'.$liv2_e['descrizione'].'</b></td>
335-
<td class="text-right"><b>'.numberFormat(abs($totale_livello3), 2).'</b></td>
336-
<td class="text-right"><b>'.numberFormat(abs($totale_reddito_livello3), 2).'</b></td>
335+
<td class="text-right"><b>'.($totale_livello3 ? numberFormat(abs($totale_livello3), 2) : '').'</b></td>
336+
<td class="text-right"><b>'.($totale_reddito_livello3 ? numberFormat(abs($totale_reddito_livello3), 2) : '').'</b></td>
337337
</tr>';
338338
echo $livello3;
339339
}
@@ -348,8 +348,8 @@
348348
echo '
349349
<tr>
350350
<td colspan="2"><h6><b>Perdita</b></h6></td>
351-
<td class="text-right" style="font-size:8pt;"><b>'.numberFormat(abs($utile_perdita), 2).'</b></td>
352-
<td class="text-right" style="font-size:8pt;"><b>'.numberFormat(abs($utile_perdita_reddito), 2).'</b></td>
351+
<td class="text-right" style="font-size:8pt;"><b>'.($utile_perdita ? numberFormat(abs($utile_perdita), 2) : '').'</b></td>
352+
<td class="text-right" style="font-size:8pt;"><b>'.($utile_perdita_reddito ? numberFormat(abs($utile_perdita_reddito), 2) : '').'</b></td>
353353
</tr>
354354
<tr>
355355
<td colspan="2"><h6><b>Totale a pareggio</b></td>

0 commit comments

Comments
 (0)