Dashboard #10
@ -179,6 +179,34 @@
|
|||||||
<canvas id="categoryChart"></canvas>
|
<canvas id="categoryChart"></canvas>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h3>Gastos Recientes</h3>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Fecha</th>
|
||||||
|
<th>cuenta</th>
|
||||||
|
<th>Categoría</th>
|
||||||
|
<th>Concepto</th>
|
||||||
|
<th>Importe</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for exp in recent_expenses %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ exp.date|date:"d/m/Y" }}</td>
|
||||||
|
<td>{{ exp.account.name }}</td>
|
||||||
|
<td>{{ exp.category.name }}</td>
|
||||||
|
<td>{{ exp.description|default:"-" }}</td>
|
||||||
|
<td style="color: #d9534f; font-weight: bold;">{{ exp.amount|floatformat:2 }}</td>
|
||||||
|
</tr>
|
||||||
|
{% empty %}
|
||||||
|
<tr><td colspan="7">No hay gastos recientes registrados</td></tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="clear: both; margin-top: 2rem;"></div>
|
<div style="clear: both; margin-top: 2rem;"></div>
|
||||||
|
|||||||
@ -460,6 +460,9 @@ def dashboard(request):
|
|||||||
# Goals
|
# Goals
|
||||||
goals = Goal.objects.filter(owner=request.user)
|
goals = Goal.objects.filter(owner=request.user)
|
||||||
|
|
||||||
|
# Recent expenses
|
||||||
|
recent_expenses = Expense.objects.filter(owner=request.user).order_by('-date', '-id')[:7]
|
||||||
|
|
||||||
# Send the data to the dashboard
|
# Send the data to the dashboard
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
@ -491,6 +494,7 @@ def dashboard(request):
|
|||||||
"accounts_charts": accounts_charts,
|
"accounts_charts": accounts_charts,
|
||||||
"period": period,
|
"period": period,
|
||||||
"goals": goals,
|
"goals": goals,
|
||||||
|
"recent_expenses": recent_expenses,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user