Totale scadenze in pagamento prima nota

This commit is contained in:
Beppe 2023-05-25 16:40:43 +02:00
parent 96fe4a928e
commit 9278e1bcc4
1 changed files with 18 additions and 0 deletions

View File

@ -45,6 +45,9 @@ function renderRiga($id, $riga)
{[ "type": "number", "name": "avere['.$id.']", "id": "avere'.$id.'", "value": "'.($riga['avere'] ?: 0).'" ]}
</td>
</tr>';
$_SESSION['totale_dare'] += ($riga['dare'] ? $riga['dare'] : 0);
$_SESSION['totale_avere'] += ($riga['avere'] ? $riga['avere'] : 0);
}
function renderTabella($nome, $righe)
@ -115,6 +118,8 @@ function renderTabella($nome, $righe)
$counter = 0;
$movimenti = collect($movimenti);
$_SESSION['totale_dare'] = 0;
$_SESSION['totale_avere'] = 0;
// Elenco per documenti
$scadenze = $movimenti
@ -169,6 +174,19 @@ echo '
</tbody>
</table>';
// Nuova riga
echo '
<table class="table table-bordered">
<tr>
<th class="text-right">'.tr('Totale').'</th>
<th class="text-right" width="20%">'.moneyFormat($_SESSION['totale_dare']).'</th>
<th class="text-right" width="20%">'.moneyFormat($_SESSION['totale_avere']).'</th>
</tr>
</table>';
unset($_SESSION['totale_dare']);
unset($_SESSION['totale_avere']);
echo '
<script>
var formatted_zero = "'.numberFormat(0).'";