Files
DevSuite/templates/finance/expense_form.html
T
sankalp 2baa947c21 feat(finance): add finance dashboard and CRUD templates
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>
2025-12-18 20:20:48 +05:45

79 lines
3.5 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-3xl mx-auto px-4 sm:px-6 lg:px-8 w-full">
<div class="mb-8">
<h1 class="text-3xl font-bold text-heading">{% if expense %}Edit Expense{% else %}Add Expense{% endif %}
</h1>
</div>
<div class="bg-neutral-secondary-soft rounded-lg shadow-sm border border-default p-6">
<form method="POST" class="space-y-6">
{% csrf_token %}
<!-- Description -->
<div class="form-control w-full">
<label class="label">
<span class="label-text">Description</span>
</label>
<input type="text" name="description" placeholder="Expense description"
class="input input-bordered w-full" value="{{ expense.description|default:'' }}" required />
</div>
<!-- Category -->
<div class="form-control w-full">
<label class="label">
<span class="label-text">Category</span>
</label>
<input type="text" name="category" placeholder="e.g. Server Costs, Office Supplies"
class="input input-bordered w-full" value="{{ expense.category|default:'' }}" />
</div>
<!-- Amount -->
<div class="form-control w-full">
<label class="label">
<span class="label-text">Amount</span>
</label>
<input type="number" step="0.01" name="amount" placeholder="0.00"
class="input input-bordered w-full" value="{{ expense.amount|default:'' }}" required />
</div>
<!-- Date -->
<div class="form-control w-full">
<label class="label">
<span class="label-text">Date</span>
</label>
<input type="date" name="date" class="input input-bordered w-full"
value="{{ expense.date|date:'Y-m-d' }}" required />
</div>
<!-- Service (Optional) -->
<div class="form-control w-full">
<label class="label">
<span class="label-text">Service (Optional)</span>
</label>
<select name="service" class="select select-bordered w-full">
<option value="" {% if not expense or not expense.service %}selected{% endif %}>None</option>
{% for service in services %}
<option value="{{ service.id }}" {% if expense and expense.service.id == service.id %}selected{% endif %}>
{{ service.name }}
</option>
{% endfor %}
</select>
</div>
<!-- Actions -->
<div class="flex justify-end space-x-4 mt-8">
<a href="{% url 'finance_dashboard' %}" class="btn btn-ghost">Cancel</a>
<button type="submit" class="btn btn-secondary">{% if expense %}Update Expense{% else %}Add
Expense{% endif %}</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}