This commit is contained in:
MatteoPistorello 2023-05-25 16:57:52 +02:00
commit 4b5b300c1d
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).'" ]} {[ "type": "number", "name": "avere['.$id.']", "id": "avere'.$id.'", "value": "'.($riga['avere'] ?: 0).'" ]}
</td> </td>
</tr>'; </tr>';
$_SESSION['totale_dare'] += ($riga['dare'] ? $riga['dare'] : 0);
$_SESSION['totale_avere'] += ($riga['avere'] ? $riga['avere'] : 0);
} }
function renderTabella($nome, $righe) function renderTabella($nome, $righe)
@ -115,6 +118,8 @@ function renderTabella($nome, $righe)
$counter = 0; $counter = 0;
$movimenti = collect($movimenti); $movimenti = collect($movimenti);
$_SESSION['totale_dare'] = 0;
$_SESSION['totale_avere'] = 0;
// Elenco per documenti // Elenco per documenti
$scadenze = $movimenti $scadenze = $movimenti
@ -169,6 +174,19 @@ echo '
</tbody> </tbody>
</table>'; </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 ' echo '
<script> <script>
var formatted_zero = "'.numberFormat(0).'"; var formatted_zero = "'.numberFormat(0).'";