firefly-iii/app/views/reports/year.blade.php

171 lines
5.6 KiB
PHP
Raw Normal View History

2014-11-02 11:46:01 -06:00
@extends('layouts.default')
@section('content')
2014-11-28 09:35:11 -06:00
{{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $date) }}
2014-11-02 11:46:01 -06:00
<div class="row">
<div class="col-lg-10 col-md-8 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
Income vs. expenses
</div>
<div class="panel-body">
<div id="income-expenses-chart"></div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
Income vs. expenses
</div>
<div class="panel-body">
<div id="income-expenses-sum-chart"></div>
</div>
</div>
</div>
</div>
<div class="row">
2014-12-07 08:37:53 -06:00
<div class="col-lg-6 col-md-6 col-sm-6">
2014-11-07 15:06:30 -06:00
<div class="panel panel-default">
2014-11-02 11:46:01 -06:00
<div class="panel-heading">
2014-12-07 08:37:53 -06:00
Account balance
2014-11-02 11:46:01 -06:00
</div>
<table class="table table-bordered table-striped">
2014-12-07 08:37:53 -06:00
<?php
$start = 0;
$end = 0;
$diff = 0;
?>
@foreach($balances as $balance)
<?php
$start += $balance['start'];
$end += $balance['end'];
$diff += ($balance['end']-$balance['start']);
?>
<tr>
<td>
<a href="{{route('accounts.show',$balance['account']->id)}}">{{{$balance['account']->name}}}</a>
@if($balance['shared'])
<small><em>shared</em></small>
@endif
</td>
2015-01-02 02:06:44 -06:00
<td>{{Amount::format($balance['start'])}}</td>
<td>{{Amount::format($balance['end'])}}</td>
<td>{{Amount::format($balance['end']-$balance['start'])}}</td>
2014-12-07 08:37:53 -06:00
</tr>
@endforeach
<tr>
<td><em>Sum of sums</em></td>
2015-01-02 02:06:44 -06:00
<td>{{Amount::format($start)}}</td>
<td>{{Amount::format($end)}}</td>
<td>{{Amount::format($diff)}}</td>
2014-12-07 08:37:53 -06:00
</tr>
</table>
2014-11-02 11:46:01 -06:00
</div>
<div class="panel panel-default">
<div class="panel-heading">
Income vs. expense
</div>
<?php
$incomeSum = 0;
$expenseSum = 0;
foreach($groupedIncomes as $income) {
$incomeSum += floatval($income->amount);
}
foreach($groupedExpenses as $exp) {
$expenseSum += floatval($exp['amount']);
}
$incomeSum = floatval($incomeSum*-1);
?>
<table class="table table-bordered table-striped">
<tr>
<td>In</td>
2015-01-02 02:06:44 -06:00
<td>{{Amount::format($incomeSum)}}</td>
</tr>
<tr>
<td>Out</td>
2015-01-02 02:06:44 -06:00
<td>{{Amount::format($expenseSum*-1)}}</td>
</tr>
<tr>
<td>Difference</td>
2015-01-02 02:06:44 -06:00
<td>{{Amount::format($incomeSum - $expenseSum)}}</td>
</tr>
</table>
</div>
2014-11-02 11:46:01 -06:00
</div>
2014-12-07 08:37:53 -06:00
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="panel panel-default">
<div class="panel-heading">
Income
</div>
<table class="table">
<?php $sum = 0;?>
2014-12-07 08:37:53 -06:00
@foreach($groupedIncomes as $income)
<?php $sum += floatval($income->amount)*-1;?>
2014-12-07 08:37:53 -06:00
<tr>
<td><a href="{{route('accounts.show',$income->account_id)}}">{{{$income->name}}}</a></td>
<td>{{Amount::format(floatval($income->amount)*-1)}}</td>
2014-12-07 08:37:53 -06:00
</tr>
@endforeach
<tr>
<td><em>Sum</em></td>
2015-01-02 02:06:44 -06:00
<td>{{Amount::format($sum)}}</td>
</tr>
2014-12-07 08:37:53 -06:00
</table>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="panel panel-default">
<div class="panel-heading">
2014-12-07 08:37:53 -06:00
Expenses
</div>
2014-12-07 08:37:53 -06:00
<table class="table">
2015-01-27 12:22:54 -06:00
<?php $sum = 0;?>
2014-12-28 01:54:53 -06:00
@foreach($groupedExpenses as $id => $expense)
2014-12-07 08:37:53 -06:00
<tr>
2014-12-28 01:54:53 -06:00
<td><a href="{{route('accounts.show',$id)}}">{{{$expense['name']}}}</a></td>
2015-01-02 02:06:44 -06:00
<td>{{Amount::format(floatval($expense['amount'])*-1)}}</td>
2014-12-07 08:37:53 -06:00
</tr>
2015-01-27 12:22:54 -06:00
<?php $sum += floatval($expense['amount'])*-1;?>
2014-12-07 08:37:53 -06:00
@endforeach
2015-01-27 12:22:54 -06:00
<tr>
<td><em>Sum</em></td>
<td>{{Amount::format($sum)}}</td>
</tr>
2014-12-07 08:37:53 -06:00
</table>
</div>
</div>
</div>
2014-11-07 15:06:30 -06:00
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
2015-01-25 01:28:59 -06:00
Budgets
2014-11-07 15:06:30 -06:00
</div>
<div class="panel-body">
2015-01-25 01:28:59 -06:00
<div id="budgets"></div>
2014-11-07 15:06:30 -06:00
</div>
</div>
</div>
</div>
2015-01-24 01:54:33 -06:00
2014-11-07 15:06:30 -06:00
2014-11-02 11:46:01 -06:00
@stop
@section('scripts')
<!-- load the libraries and scripts necessary for Google Charts: -->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
{{HTML::script('assets/javascript/firefly/gcharts.options.js')}}
{{HTML::script('assets/javascript/firefly/gcharts.js')}}
<script type="text/javascript">
var year = '{{$year}}';
2015-01-02 02:06:44 -06:00
var currencyCode = '{{Amount::getCurrencyCode()}}';
2014-11-02 11:46:01 -06:00
</script>
{{HTML::script('assets/javascript/firefly/reports.js')}}
2015-01-01 23:16:49 -06:00
@stop