Skip to content

Firefly III: a personal finances manager

First experimental report generator / choice thing.

James Cole0b382426e928
diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php
index 4d1ca65470..ed9b003817 100644
--- a/app/Http/Controllers/ReportController.php
+++ b/app/Http/Controllers/ReportController.php
@@ -56,7 +56,7 @@ class ReportController extends Controller
}
- return view('reports.index', compact('months', 'hasShared'));
+ return view('reports.index', compact('months','accounts', 'hasShared','start'));
}
/**
diff --git a/public/js/reports.js b/public/js/reports.js
index b123497481..8de6096c12 100644
--- a/public/js/reports.js
+++ b/public/js/reports.js
@@ -3,6 +3,21 @@
$(function () {
"use strict";
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;
-}
-
-$(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);
-});
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/resources/twig/reports/index.twig b/resources/twig/reports/index.twig
index 064b17ed58..c978055589 100644
--- a/resources/twig/reports/index.twig
+++ b/resources/twig/reports/index.twig
@@ -17,7 +17,9 @@
<h4><a href="{{ route('reports.year',year) }}">{{ year }}</a></h4>
<ul class="list-inline">
{% 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 %}
</ul>
{% endfor %}
@@ -35,7 +37,9 @@
<h4><a href="{{ route('reports.year',[year, 'shared']) }}">{{ year }}</a></h4>
<ul class="list-inline">
{% 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 %}
</ul>
{% endfor %}
@@ -43,8 +47,75 @@
</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 %}
{% block scripts %}
+ <script type="text/javascript">
+ var minDate = "{{ start.format('m/d/Y') }}";
+ </script>
+
<script type="text/javascript" src="js/reports.js"></script>
{% endblock %}