diff --git a/core/templates/core/work_log_payroll.html b/core/templates/core/work_log_payroll.html new file mode 100644 index 0000000..602cac8 --- /dev/null +++ b/core/templates/core/work_log_payroll.html @@ -0,0 +1,156 @@ +{# === WORK LOG PAYROLL — FULL PAGE === #} +{# Shareable, bookmark-able view for one work log's payroll status. #} +{# Same data source as the modal; different presentation. #} + +{% extends "base.html" %} +{% load format_tags %} + +{% block title %}Work Log {{ log.date|date:"d M Y" }} | FoxFitt{% endblock %} + +{% block content %} +
Who was paid for this day's work and who is still outstanding.
+| Worker | +Status | +Earned | +Payslip | +Paid on | +
|---|---|---|---|---|
| + + {{ row.worker.name }} + + {% if not row.worker.active %}Inactive{% endif %} + | ++ {% if row.status == 'Paid' %} + Paid + {% elif row.status == 'Priced, not paid' %} + Priced, not paid + {% else %} + Unpaid + {% endif %} + | +R {{ row.earned|money }} | ++ {% if row.payroll_record %} + #{{ row.payroll_record.pk }} + {% else %}—{% endif %} + | +{{ row.paid_date|date:"d M Y"|default:"—" }} | +
| Type | Worker | Amount | Payslip |
|---|---|---|---|
| {{ adj.type }} | +{{ adj.worker.name }} | +R {{ adj.amount|money }} | ++ {% if adj.payroll_record %} + #{{ adj.payroll_record.pk }} + {% else %}unpaid{% endif %} + | +
stub for log {log.id}
") + + # Fetch the log with related objects pre-loaded to avoid extra queries. + log = get_object_or_404( + WorkLog.objects.select_related('project', 'team', 'supervisor'), + id=log_id, + ) + context = _build_work_log_payroll_context(log) + return render(request, 'core/work_log_payroll.html', context) # === CSV EXPORT ===