|
100 | 100 | echo ' |
101 | 101 | <tr> |
102 | 102 | <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> |
104 | 104 | </tr> |
105 | 105 | <tr> |
106 | 106 | <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> |
108 | 108 | </tr>'; |
109 | 109 | } |
110 | 110 | echo ' |
|
142 | 142 | <tr> |
143 | 143 | <td>'.$liv3_p['numero'].'</td> |
144 | 144 | <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> |
146 | 146 | </tr>'; |
147 | 147 | } |
148 | 148 | } |
|
156 | 156 | <tr> |
157 | 157 | <td></td> |
158 | 158 | <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> |
160 | 160 | </tr>'; |
161 | 161 | } elseif ($liv2_p['id'] == setting('Conto di secondo livello per i debiti fornitori') && $debiti_fornitori < 0) { |
162 | 162 | $totale_passivita += $debiti_fornitori; |
|
165 | 165 | <tr> |
166 | 166 | <td></td> |
167 | 167 | <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> |
169 | 169 | </tr>'; |
170 | 170 | } |
171 | 171 | } |
|
175 | 175 | <tr> |
176 | 176 | <td><b>'.$liv2_p['numero'].'</b></td> |
177 | 177 | <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> |
179 | 179 | </tr>'; |
180 | 180 | echo $livello3; |
181 | 181 | } |
|
189 | 189 | echo ' |
190 | 190 | <tr> |
191 | 191 | <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> |
193 | 193 | </tr> |
194 | 194 | <tr> |
195 | 195 | <td colspan="2"><h6><b>Totale a pareggio</b></h6></td> |
|
245 | 245 | <tr> |
246 | 246 | <td>'.$liv3_e['numero'].'</td> |
247 | 247 | <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> |
250 | 250 | </tr>'; |
251 | 251 | } |
252 | 252 | } |
|
257 | 257 | <tr> |
258 | 258 | <td><b>'.$liv2_e['numero'].'</b></td> |
259 | 259 | <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> |
262 | 262 | </tr>'; |
263 | 263 | echo $livello3; |
264 | 264 | } |
|
274 | 274 | echo ' |
275 | 275 | <tr> |
276 | 276 | <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> |
279 | 279 | </tr> |
280 | 280 | <tr> |
281 | 281 | <td colspan="2"><h6><b>Totale a pareggio</b></h6></td> |
|
320 | 320 | <tr> |
321 | 321 | <td>'.$liv3_e['numero'].'</td> |
322 | 322 | <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> |
325 | 325 | </tr>'; |
326 | 326 | } |
327 | 327 | } |
|
332 | 332 | <tr> |
333 | 333 | <td><b>'.$liv2_e['numero'].'</b></td> |
334 | 334 | <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> |
337 | 337 | </tr>'; |
338 | 338 | echo $livello3; |
339 | 339 | } |
|
348 | 348 | echo ' |
349 | 349 | <tr> |
350 | 350 | <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> |
353 | 353 | </tr> |
354 | 354 | <tr> |
355 | 355 | <td colspan="2"><h6><b>Totale a pareggio</b></td> |
|
0 commit comments