First experimental report generator / choice thing.

This commit is contained in:
James Cole
2015-12-03 14:52:10 +01:00
parent 1cbbf9baa4
commit 0b382426e9
3 changed files with 90 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ class ReportController extends Controller
} }
return view('reports.index', compact('months', 'hasShared')); return view('reports.index', compact('months','accounts', 'hasShared','start'));
} }
/** /**

View File

@@ -3,6 +3,21 @@
$(function () { $(function () {
"use strict"; "use strict";
drawChart(); drawChart();
$('#inputDateRange').daterangepicker(
{
minDate: minDate,
drops: 'up',
}
);
$('.openModal').on('click', openModal);
// click open the top X income list:
$('#showIncomes').click(showIncomes);
// click open the top X expense list:
$('#showExpenses').click(showExpenses);
}); });
@@ -79,15 +94,4 @@ function showExpenses() {
} }
return false; return false;
} }
$(function () {
"use strict";
$('.openModal').on('click', openModal);
// click open the top X income list:
$('#showIncomes').click(showIncomes);
// click open the top X expense list:
$('#showExpenses').click(showExpenses);
});

View File

@@ -17,7 +17,9 @@
<h4><a href="{{ route('reports.year',year) }}">{{ year }}</a></h4> <h4><a href="{{ route('reports.year',year) }}">{{ year }}</a></h4>
<ul class="list-inline"> <ul class="list-inline">
{% for month in entries %} {% for month in entries %}
<li><a href="{{ route('reports.month',[month.year, month.month]) }}">{{ month.formatted }}</a></li> <li>
<a href="{{ route('reports.month',[month.year, month.month]) }}">{{ month.formatted }}</a>
</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endfor %} {% endfor %}
@@ -35,7 +37,9 @@
<h4><a href="{{ route('reports.year',[year, 'shared']) }}">{{ year }}</a></h4> <h4><a href="{{ route('reports.year',[year, 'shared']) }}">{{ year }}</a></h4>
<ul class="list-inline"> <ul class="list-inline">
{% for month in entries %} {% for month in entries %}
<li><a href="{{ route('reports.month',[month.year, month.month,'shared']) }}">{{ month.formatted }}</a></li> <li>
<a href="{{ route('reports.month',[month.year, month.month,'shared']) }}">{{ month.formatted }}</a>
</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endfor %} {% endfor %}
@@ -43,8 +47,75 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Some new reports.</h3>
</div>
<div class="box-body">
<form class="form-horizontal">
<div class="form-group">
<label for="inputReportType" class="col-sm-3 control-label">Report type</label>
<div class="col-sm-9">
<select name="report_type" class="form-control" id="inputReportType">
<option label="Default financial report" value="default">Default financial report</option>
</select>
</div>
</div>
<div class="form-group">
<label for="inputAccounts" class="col-sm-3 control-label">Included accounts</label>
<div class="col-sm-9">
{% for account in accounts %}
<div class="checkbox">
<label>
<input type="checkbox" name="accounts[]" value="{{ account.id }}">
{{ account.name }}
{% if account.getMeta('accountRole') == 'sharedAsset' %}
(shared)
{% endif %}
</label>
</div>
{% endfor %}
<p class="help-block">
In all cases, transfers to shared accounts count as expenses, and transfers
from shared accounts count as income.
</p>
</div>
</div>
<div class="form-group">
<label for="inputDateRange" class="col-sm-3 control-label">Report date range</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputDateRange" name="daterange"
value="{{ Session.get('start').format('m/d/Y') }} - {{ Session.get('end').format('m/d/Y') }}">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-9">
<button type="submit" class="btn btn-default">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script type="text/javascript">
var minDate = "{{ start.format('m/d/Y') }}";
</script>
<script type="text/javascript" src="js/reports.js"></script> <script type="text/javascript" src="js/reports.js"></script>
{% endblock %} {% endblock %}