Finance overview page added to admin with monthly breakdown #130
This commit is contained in:
24
resources/views/admin/finances/index.blade.php
Normal file
24
resources/views/admin/finances/index.blade.php
Normal file
@@ -0,0 +1,24 @@
|
||||
@extends('admin.app')
|
||||
|
||||
@section('title', 'Financial Reports')
|
||||
@section('actions')
|
||||
<li><a href="{!! route('admin.finances.index') !!}"><i class="ti-menu-alt"></i>Overview</a></li>
|
||||
@endsection
|
||||
@section('content')
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<div style="float:right;">
|
||||
{!! Form::select(
|
||||
'month_select',
|
||||
$months_list,
|
||||
$current_month,
|
||||
['id' => 'month_select']
|
||||
) !!}
|
||||
</div>
|
||||
|
||||
@include('admin.finances.table')
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.finances.scripts')
|
||||
12
resources/views/admin/finances/scripts.blade.php
Normal file
12
resources/views/admin/finances/scripts.blade.php
Normal file
@@ -0,0 +1,12 @@
|
||||
@section('scripts')
|
||||
<script>
|
||||
$(document).ready(() => {
|
||||
const select_id = "select#month_select";
|
||||
$(select_id).change((e) => {
|
||||
const date = $(select_id + " option:selected").val();
|
||||
const location = window.location.toString().split('?')[0];
|
||||
window.location = location + '?month='+date;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
61
resources/views/admin/finances/table.blade.php
Normal file
61
resources/views/admin/finances/table.blade.php
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
@foreach($transaction_groups as $group)
|
||||
|
||||
<h4>{!! $group['airline']->icao !!} - {!! $group['airline']->name !!}</h4>
|
||||
|
||||
<table class="table table-hover table-responsive" id="finances-table">
|
||||
<thead>
|
||||
<th>Expenses</th>
|
||||
<th>Credit</th>
|
||||
<th>Debit</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($group['transactions'] as $ta)
|
||||
<tr>
|
||||
<td>
|
||||
{!! $ta->transaction_group !!}
|
||||
</td>
|
||||
<td>
|
||||
@if($ta->sum_credits)
|
||||
{!! money($ta->sum_credits, $ta->currency) !!}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($ta->sum_debits)
|
||||
<i>{!! money($ta->sum_debits, $ta->currency) !!}</i>
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
{{-- show sums --}}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
{!! $group['credits'] !!}
|
||||
</td>
|
||||
<td>
|
||||
({!! $group['debits'] !!})
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{{-- final total --}}
|
||||
<tr style="border-top: 3px; border-top-style: double;">
|
||||
<td></td>
|
||||
<td><b>Total</b></td>
|
||||
<td>
|
||||
{!! $group['credits']->subtract($group['debits']) !!}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@if(!$loop->last)
|
||||
<hr>
|
||||
@endif
|
||||
@endforeach
|
||||
@@ -30,7 +30,7 @@
|
||||
</tr>
|
||||
|
||||
{{-- final total --}}
|
||||
<tr>
|
||||
<tr style="border-top: 3px; border-top-style: double;">
|
||||
<td></td>
|
||||
<td><b>Total</b></td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user