Add new finance dashboard with key financial metrics and recent transaction overviews. Implement invoice and expense management templates with create, edit, and list views. **New Features** - **Finance Dashboard**: Shows total income, expenses, net profit, and pending income stats - **Recent Transactions**: Displays tables for recent invoices and expenses - **Invoice Management**: - Create/edit invoice form with client, project, amount, status - Invoice list view with filtering and actions - **Expense Tracking**: - Expense creation/editing form - Expense list with category filter and delete action **Enhancements & Refinements** - Responsive grid layouts for dashboard components - Status badges with color coding for invoices - HTMX integration for delete actions in list views - Consistent styling with borders, shadows, and hover states - Quick action buttons for creating new invoices/expenses - Dynamic form titles for create/edit modes </answer>
55 lines
2.6 KiB
HTML
55 lines
2.6 KiB
HTML
{% extends "shared/base.html" %}
|
|
{% load static %}
|
|
{% block content %}
|
|
{% include "shared/navbar.html" %}
|
|
|
|
<div class="pt-20 min-h-screen flex flex-col pb-10">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex justify-between items-center mb-8">
|
|
<h1 class="text-3xl font-bold text-heading">Expenses</h1>
|
|
<a href="{% url 'expense_create' %}" class="btn btn-secondary btn-sm">Add Expense</a>
|
|
</div>
|
|
|
|
<div class="bg-neutral-secondary-soft rounded-lg shadow-sm border border-default p-6">
|
|
<div class="overflow-x-auto">
|
|
<table class="table w-full">
|
|
<thead>
|
|
<tr class="text-body border-b border-default">
|
|
<th>Description</th>
|
|
<th>Category</th>
|
|
<th>Amount</th>
|
|
<th>Date</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for expense in expenses %}
|
|
<tr class="hover:bg-neutral-tertiary border-b border-default last:border-0">
|
|
<td class="font-medium text-heading">{{ expense.description }}</td>
|
|
<td class="text-body">{{ expense.category }}</td>
|
|
<td class="text-body">Rs.{{ expense.amount|floatformat:2 }}</td>
|
|
<td class="text-body-secondary">{{ expense.date }}</td>
|
|
<td>
|
|
<div class="flex space-x-2">
|
|
<a href="{% url 'expense_edit' expense.pk %}" class="btn btn-ghost btn-xs">Edit</a>
|
|
<button hx-delete="{% url 'expense_delete' expense.pk %}"
|
|
hx-confirm="Are you sure you want to delete this expense?"
|
|
hx-target="closest tr" hx-swap="outerHTML"
|
|
class="btn btn-ghost btn-xs text-error">
|
|
Delete
|
|
</button>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr>
|
|
<td colspan="5" class="text-center text-body-secondary py-4">No expenses found</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |