firefly-iii/resources/twig/reports/month.twig

344 lines
15 KiB
Twig
Raw Normal View History

2015-05-02 11:26:55 -05:00
{% extends "./layout/default.twig" %}
{% block content %}
2015-05-15 14:01:24 -05:00
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, date, shared) }}
2015-05-15 13:38:39 -05:00
2015-05-02 11:26:55 -05:00
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-long-arrow-right fa-fw"></i>
Income
</div>
<table class="table table-bordered">
{% set sum = 0 %}
{% for entry in income %}
{% set sum = sum + entry.queryAmount %}
<tr>
<td>
<a href="{{ route('transactions.show',entry.id) }}" title="{{ entry.description }}">{{ entry.description }}</a>
</td>
<td>
{% if entry.type == 'Withdrawal' %}
<span class="text-danger">{{entry.queryAmount|formatAmountPlain}}</span>
{% endif %}
{% if entry.type == 'Deposit' %}
<span class="text-success">{{entry.queryAmount|formatAmountPlain}}</span>
{% endif %}
{% if entry.type == 'Transfer' %}
<span class="text-info">{{entry.queryAmount|formatAmountPlain}}</span>
{% endif %}
</td>
<td>
{{entry.date.format('j F Y')}}
</td>
<td>
<a href="{{route('accounts.show',entry.account_id)}}">{{ entry.name }}</a>
</td>
</tr>
{% endfor %}
{% if displaySum %}
<tr>
<td><em>Sum</em></td>
<td colspan="3">{{ sum|formatAmount }}</td>
</tr>
{% endif %}
</table>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-long-arrow-left fa-fw"></i>
Expenses (top 10)
</div>
<table class="table table-bordered">
{% set sum = 0 %}
{% for id,expense in expenses %}
{% set sum = sum + expense.queryAmount %}
<tr>
{% if id > 0 %}
<td><a href="{{route('accounts.show',id)}}">{{ expense.name }}</a></td>
{% else %}
<td><em>{{ expense.name }}</em></td>
{% endif %}
<td><span class="text-danger">{{ expense.queryAmount|formatAmountPlain }}</span></td>
</tr>
{% endfor %}
<tr>
<td><em>Sum</em></td>
<td><span class="text-danger">{{ sum|formatAmountPlain }}</span></td>
</tr>
</table>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-exchange fa-fw"></i>
Sums
</div>
{% set totalIn = 0 %}
{% for entry in income %}
{% set totalIn = totalIn + entry.queryAmount %}
{% endfor %}
<table class="table table-bordered">
<tr>
<td>In</td>
<td>{{ totalIn|formatAmount }}</td>
</tr>
<tr>
<td>Out</td>
<td><span class="text-danger">{{ sum|formatAmountPlain }}</span></td>
</tr>
<tr>
<td>Difference</td>
<td>{{ (totalIn - sum)|formatAmount }}</td>
</tr>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-tasks fa-fw"></i>
Budgets
</div>
<table class="table table-bordered">
<tr>
<th>Budget</th>
<th>Envelope</th>
<th>Spent</th>
<th>Left</th>
</tr>
{% set sumSpent = 0 %}
{% set sumEnvelope = 0 %}
{% set sumLeft = 0 %}
{% for id,budget in budgets %}
{% set sumSpent = sumSpent + budget.spent %}
{% set sumEnvelope = sumEnvelope + budget.queryAmount %}
{% set sumLeft = sumLeft + budget.queryAmount + budget.spent %}
<!-- only display when relevant: -->
{% if budget.queryAmount != 0 or budget.spent != 0 %}
<tr>
<td>
{% if id > 0 %}
<a href="{{route('budgets.show',id)}}">{{ budget.name }}</a>
{% else %}
<em>{{ budget.name }}</em>
{% endif %}
</td>
<td>{{ budget.queryAmount|formatAmount }}</td>
<td><span class="text-danger">{{ (budget.spent*-1)|formatAmountPlain }}</span></td>
<td>{{ (budget.queryAmount + budget.spent)|formatAmount }}</td>
</tr>
{% endif %}
{% endfor %}
<tr>
<td><em>Sum</em></td>
<td>{{ sumEnvelope|formatAmount }}</td>
<td>{{ sumSpent|formatAmount }}</td>
<td>{{ sumLeft|formatAmount }}</td>
</tr>
</table>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-bar-chart fa-fw"></i>
Categories
</div>
<table class="table table-bordered">
<tr>
<th>Category</th>
<th>Spent</th>
</tr>
{% set sum = 0 %}
{% for id,category in categories %}
{% set sum = sum + category.queryAmount %}
<tr>
<td>
{% if id > 0 %}
<a href="{{route('categories.show',id)}}">{{ category.name }}</a>
{% else %}
<em>{{ category.name }}</em>
{% endif %}
</td>
<td><span class="text-danger">{{ (category.queryAmount * -1)|formatAmountPlain }}</span></td>
</tr>
{% endfor %}
<tr>
<td><em>Sum</em></td>
<td><span class="text-danger">{{ (sum * -1)|formatAmountPlain }}</span></td>
</tr>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-credit-card"></i>
2015-05-02 11:26:55 -05:00
Accounts
</div>
<table class="table table-bordered table-striped">
2015-05-02 11:26:55 -05:00
<tr>
<th>Account</th>
<th>Start of month</th>
<th>Current balance</th>
<th>Spent</th>
<th>Earned</th>
2015-05-02 11:26:55 -05:00
</tr>
{% for account in accounts %}
<tr>
<td><a href="{{route('accounts.show',account.id)}}">{{ account.name }}</a></td>
<td>{{ account.startBalance|formatAmount }}</td>
<td>{{ account.endBalance|formatAmount }}</td>
<td>
{% if account.startBalance - account.endBalance > 0 %}
<span class="text-danger">{{ (account.startBalance - account.endBalance)|formatAmountPlain }}</span>
{% endif %}
</td>
<td>
{% if account.startBalance - account.endBalance < 0 %}
<span class="text-success">{{ ((account.startBalance - account.endBalance)*-1)|formatAmountPlain }}</span>
{% endif %}
</td>
</tr>
{% endfor %}
2015-05-02 11:26:55 -05:00
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-sort-amount-asc fa-fw"></i>
Budgets
2015-05-02 11:26:55 -05:00
</div>
<table class="table table-bordered table-striped">
<tr>
<th colspan="2">Budgets</th>
{% for account in accounts %}
{% if not account.hide %}
<th><a href="{{route('accounts.show',account.id)}}">{{ account.name }}</a></th>
{% endif %}
{% endfor %}
<th colspan="2">
Left in budget
</th>
</tr>
{% for id,budget in budgets %}
<tr>
<td>{{ budget.name }}</td>
<td>{{ budget.queryAmount|formatAmount }}</td>
{% set spent = 0 %}
{% for account in accounts %}
{% if not account.hide %}
{% if account.budgetInformation[id] %}
<td>
{% if id == 0 %}
<a href="{{route('reports.no-budget',[account, year, month])}}" class="openModal">
{{ account.budgetInformation[id].queryAmount|formatAmount }}
</a>
{% else %}
{{ account.budgetInformation[id].queryAmount|formatAmount }}
{% endif %}
</td>
{% set spent = spent + account.budgetInformation[id].queryAmount %}
{% else %}
<td>{{ 0|formatAmount }}</td>
{% endif %}
{% endif %}
{% endfor %}
<td>{{ (budget.queryAmount + budget.spent)|formatAmount }}</td>
<td>{{ (budget.queryAmount + spent)|formatAmount }}</td>
</tr>
{% endfor %}
<tr>
<td colspan="2">Balanced by transfers</td>
{% for account in accounts %}
{% if not account.hide %}
<td>
<a href="{{route('reports.balanced-transfers',[account, year, month])}}" class="openModal">{{ account.balancedAmount|formatAmount }}</a>
</td>
{% endif %}
{% endfor %}
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">Left unbalanced</td>
{% for account in accounts %}
{% if not account.hide %}
{% if account.budgetInformation[0] %}
<td>
{% if account.budgetInformation[0].queryAmount + account.balancedAmount != 0.0 %}
<a href="{{route('reports.left-unbalanced',[account, year, month])}}" class="openModal">{{ (account.budgetInformation[0].queryAmount + account.balancedAmount)|formatAmount }}</a>
{% else %}
{{ (account.budgetInformation[0].queryAmount + account.balancedAmount)|formatAmount }}
{% endif %}
</td>
{% else %}
<td>{{ 0|formatAmount }}</td>
{% endif %}
{% endif %}
{% endfor %}
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><em>Sum</em></td>
{% for account in accounts %}
{% if not account.hide %}
<td>{{ accountAmounts[account.id]|formatAmount }}</td>
{% endif %}
{% endfor %}
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">Expected balance</td>
{% for account in accounts %}
{% if not account.hide %}
<td>{{ (account.startBalance + accountAmounts[account.id])|formatAmount }}</td>
{% endif %}
{% endfor %}
<td colspan="2">&nbsp;</td>
</tr>
</table>
2015-05-02 11:26:55 -05:00
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-calendar-o fa-fw"></i>
Bills
</div>
<div class="panel-body">Body</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-fw fa-folder-o"></i>
Outside of budgets
</div>
<div class="panel-body">Body</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/reports.js"></script>
{% endblock %}