@foreach($transaction_groups as $group)
<h3>{{ $group['airline']->icao }} - {{ $group['airline']->name }}</h3>
<table
id="finances-table"
style="width: 95%; margin: 0px auto;"
class="table table-hover table-responsive">
<thead>
<th>Expenses</th>
<th>Credit</th>
<th>Debit</th>
</thead>
<tbody>
@foreach($group['transactions'] as $ta)
<tr>
<td>
{{ $ta->transaction_group }}
</td>
@if($ta->sum_credits)
{{ money($ta->sum_credits, $ta->currency) }}
@endif
@if($ta->sum_debits)
<i>{{ money($ta->sum_debits, $ta->currency) }}</i>
</tr>
@endforeach
{{-- show sums --}}
<td></td>
{{ $group['credits'] }}
<i>{{ $group['debits'] }}</i>
{{-- final total --}}
<tr style="border-top: 3px; border-top-style: double;">
<td align="right">
<b>Total</b>
{{ $group['credits']->subtract($group['debits']) }}
</tbody>
</table>
@if(!$loop->last)
<hr>