- New Features - Add delete buttons with confirmation modals for users, expenses, invoices, and tickets - Introduce a priority column with styled badges in the ticket list - Refactor form fields to a shared partial for cleaner markup - Enhancements - Rename “Creator” to “Assignee” and improve status/priority badge rendering - Fix empty‑state colspan and correct broken delete‑modal label closing tag - Initialize Quill editor on the ticket detail page - Bug Fixes - Resolve typo in button class name and mismatched table header count
57 lines
4.1 KiB
HTML
57 lines
4.1 KiB
HTML
{% extends "base_authenticated.html" %}
|
|
{% block title %}Invoice #{{ invoice.id }}{% endblock %}
|
|
{% block content_inner %}
|
|
<div class="max-w-3xl mx-auto">
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden mb-6">
|
|
<div class="p-6">
|
|
<div class="flex items-start justify-between mb-6">
|
|
<div>
|
|
<div class="flex items-center gap-2 text-sm text-gray-500 mb-1">
|
|
<a href="{% url 'invoice_list' %}" class="hover:text-blue-600">Invoices</a>
|
|
<span>/</span>
|
|
</div>
|
|
<h1 class="text-2xl font-bold text-gray-900">Invoice #{{ invoice.id }}</h1>
|
|
</div>
|
|
<div class="flex items-center gap-2">
|
|
<span class="text-xs px-3 py-1.5 rounded-full font-medium {% if invoice.status == 'paid' %}bg-green-100 text-green-700{% elif invoice.status == 'overdue' %}bg-red-100 text-red-700{% else %}bg-amber-100 text-amber-700{% endif %}">
|
|
{{ invoice.get_status_display }}
|
|
</span>
|
|
{% if user.is_admin %}
|
|
<a href="{% url 'invoice_edit' invoice.pk %}" class="btn btn-sm bg-blue-50 text-blue-700 hover:bg-blue-100 border-0">Edit</a>
|
|
<label for="delete-modal-invoice" class="btn btn-sm text-red-600 hover:bg-red-50 border-0 cursor-pointer">Delete</label>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-6">
|
|
<div class="p-4 bg-gray-50 rounded-xl"><p class="text-xs text-gray-500 uppercase font-medium">Project</p><p class="text-sm font-semibold text-gray-900 mt-1">{{ invoice.project.name }}</p></div>
|
|
<div class="p-4 bg-gray-50 rounded-xl"><p class="text-xs text-gray-500 uppercase font-medium">Client</p><p class="text-sm font-semibold text-gray-900 mt-1">{{ invoice.client.username }}</p></div>
|
|
<div class="p-4 bg-gray-50 rounded-xl"><p class="text-xs text-gray-500 uppercase font-medium">Amount</p><p class="text-lg font-bold text-gray-900 mt-1">${{ invoice.amount }}</p></div>
|
|
<div class="p-4 bg-gray-50 rounded-xl"><p class="text-xs text-gray-500 uppercase font-medium">Due Date</p><p class="text-sm font-semibold text-gray-900 mt-1">{{ invoice.due_date }}</p></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden">
|
|
<div class="px-6 py-4 border-b border-gray-100 flex items-center justify-between">
|
|
<h2 class="font-semibold text-gray-900">Payments</h2>
|
|
{% if user.is_admin %}
|
|
<a href="{% url 'payment_create' %}?invoice={{ invoice.pk }}" class="btn btn-sm bg-blue-50 text-blue-700 hover:bg-blue-100 border-0">Record Payment</a>
|
|
{% endif %}
|
|
</div>
|
|
<div class="overflow-x-auto p-6">
|
|
<table class="table w-full">
|
|
<thead><tr class="bg-gray-50"><th class="text-xs font-semibold text-gray-500 uppercase">Date</th><th class="text-xs font-semibold text-gray-500 uppercase">Method</th><th class="text-xs font-semibold text-gray-500 uppercase">Amount</th><th class="text-xs font-semibold text-gray-500 uppercase">Reference</th></tr></thead>
|
|
<tbody>
|
|
{% for payment in payments %}
|
|
<tr><td class="text-sm">{{ payment.paid_at|date:"M d, Y H:i" }}</td><td class="text-sm">{{ payment.method }}</td><td class="text-sm font-semibold">${{ payment.amount }}</td><td class="text-sm text-gray-500">{{ payment.reference|default:"-" }}</td></tr>
|
|
{% empty %}
|
|
<tr><td colspan="4" class="text-center py-8 text-gray-400">No payments recorded yet.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% url 'invoice_delete' invoice.pk as delete_url %}
|
|
{% include "components/delete_modal.html" with modal_id="delete-modal-invoice" delete_url=delete_url %}
|
|
{% endblock %}
|