|
62 | 62 | $sconto_finale = $documento->sconto_finale_percentuale ? $documento->totale*$documento->sconto_finale_percentuale/100 : $documento->sconto_finale; |
63 | 63 | $has_sconto_finale = !empty($sconto_finale); |
64 | 64 |
|
| 65 | +// Determina quale è l'ultima riga dei totali da visualizzare |
| 66 | +$is_last_total_sconto_finale = $has_sconto_finale; |
| 67 | +$is_last_total_split_payment = !$has_sconto_finale && $has_split_payment; |
| 68 | +$is_last_total_ritenuta = !$has_sconto_finale && !$has_split_payment && $has_ritenuta; |
| 69 | +$is_last_total_basic = !$has_sconto_finale && !$has_split_payment && !$has_ritenuta; |
| 70 | + |
65 | 71 | $etichette = [ |
66 | 72 | 'totale' => tr('Totale imponibile', [], ['upper' => true]), |
67 | 73 | 'totale_parziale' => tr('Totale documento', [], ['upper' => true]), |
|
112 | 118 | } |
113 | 119 | } |
114 | 120 |
|
115 | | -echo ' |
116 | | - |
| 121 | +echo ' |
| 122 | +
|
117 | 123 | </table> |
118 | 124 | </td>'; |
119 | 125 | // Fine elenco scadenze |
|
333 | 339 | '.moneyFormat($totale_iva, $d_totali).' |
334 | 340 | </td>'; |
335 | 341 | if ($has_ritenuta || $has_rivalsa || $has_split_payment || $has_sconto_finale) { |
336 | | - echo '<td class="cell-padded text-center" colspan="'.$second_colspan.'"> |
| 342 | + echo '<td class="cell-padded text-center" colspan="'.$second_colspan.'" style="background-color:'.($is_last_total_basic ? '#90EE90' : 'transparent').';"> |
337 | 343 | '.moneyFormat($totale, $d_totali); |
338 | 344 | } else { |
339 | 345 | echo ' |
340 | | - <td class="cell-padded text-center" colspan="'.$second_colspan.'" > |
| 346 | + <td class="cell-padded text-center" colspan="'.$second_colspan.'" style="background-color:'.($is_last_total_basic ? '#90EE90' : 'transparent').';"> |
341 | 347 | <b>'.moneyFormat($totale, $d_totali).'</b>'; |
342 | 348 | } |
343 | 349 | echo ' |
|
420 | 426 | $totale = $totale - ($ritenuta_acconto_totale + $ritenuta_contributi_totale); |
421 | 427 | echo ' |
422 | 428 |
|
423 | | - <td class="cell-padded text-center" colspan="'.$second_colspan.'" > |
| 429 | + <td class="cell-padded text-center" colspan="'.$second_colspan.'" style="background-color:'.($is_last_total_ritenuta ? '#90EE90' : 'transparent').';"> |
424 | 430 | <b>'.moneyFormat($totale, 2).'</b> |
425 | 431 | </td> |
426 | 432 | </tr>'; |
|
452 | 458 | '.moneyFormat($totale_iva, 2).' |
453 | 459 | </td> |
454 | 460 |
|
455 | | - <td class="cell-padded text-center" colspan="'.$second_colspan.'" > |
| 461 | + <td class="cell-padded text-center" colspan="'.$second_colspan.'" style="background-color:'.($is_last_total_split_payment ? '#90EE90' : 'transparent').';"> |
456 | 462 | <b>'.moneyFormat($totale, 2).'</b> |
457 | 463 | </td> |
458 | 464 | </tr>'; |
|
477 | 483 | echo' |
478 | 484 | </th> |
479 | 485 |
|
480 | | - <th class="text-center small" colspan="'.$second_colspan.'"> |
| 486 | + <th class="text-center small" colspan="'.$second_colspan.'" style="background-color:#C0C0C0;"> |
481 | 487 | '.tr('Netto a pagare', [], ['upper' => true]).' |
482 | 488 | </th> |
483 | 489 | </tr>'; |
|
488 | 494 | <td class="cell-padded text-center" colspan="'.$first_colspan.'"> |
489 | 495 | '.moneyFormat($sconto_finale, 2).' |
490 | 496 | </td> |
491 | | - <td class="cell-padded text-center" colspan="'.$second_colspan.'"> |
| 497 | + <td class="cell-padded text-center" colspan="'.$second_colspan.'" style="background-color:'.($is_last_total_sconto_finale ? '#90EE90' : 'transparent').';"> |
492 | 498 | '.moneyFormat($totale, 2).' |
493 | 499 | </td> |
494 | 500 | </tr>'; |
|
0 commit comments