{# templates/payroll/salary_range.html #} {% extends "pos/base.html" %} {% load static %} {% block title %}Salary Range Preview & Finalize{% endblock %} {% block stylesheets %} {% endblock %} {% block heading %}Salary Range Preview & Finalize{% endblock %} {% block content %}
{# ──────────────────────────────────────────────────────────────────────── #} {# COMPLETE MONTH ATTENDANCE SECTION (NEW) #} {# ──────────────────────────────────────────────────────────────────────── #}
Complete Month Attendance (Mark all active staff as present for entire month)
{% csrf_token %}
Note: Only Active staff will be marked. Inactive staff will be skipped.

{# ──────────────────────────────────────────────────────────────────────── #} {# 1) MAIN FORM: selects Start Date, End Date, Weekdays, and Staff table #} {# When you hit "Preview", this same view reloads and shows the preview below. #} {# ──────────────────────────────────────────────────────────────────────── #}
{% csrf_token %}

{% for staff in all_staff %} {% empty %} {% endfor %}
# Name Status
{{ forloop.counter }} {{ staff.name }} Active
No active staff found.
{# ──────────────────────────────────────────────────────────────────────── #} {# 4) HTML "Preview" Results (only if show_preview=True) #} {# ──────────────────────────────────────────────────────────────────────── #} {% if show_preview %}

Preview Results ({{ range_start }} – {{ range_end }})

{% for row in preview_data %} {% endfor %}
# Staff Name Att. Days Att. Pay Commission Overtime Bonus Deduction Net Salary
{{ forloop.counter }} {{ row.staff_name }} {{ row.attendance_days }} {{ row.attendance_amount|floatformat:2 }} {{ row.commission_amount|floatformat:2 }} {{ row.overtime_amount|floatformat:2 }} {{ row.bonus_amount|floatformat:2 }} {{ row.deduction_amount|floatformat:2 }} {{ row.net_amount|floatformat:2 }}
Totals: {{ totals.attendance|floatformat:2 }} {{ totals.attendance|floatformat:2 }} {{ totals.commission|floatformat:2 }} {{ totals.overtime|floatformat:2 }} {{ totals.bonus|floatformat:2 }} {{ totals.deduction|floatformat:2 }} {{ totals.net|floatformat:2 }}
{# ───────────────────────────────────────────────────────────────────── #} {# Hidden forms for "Finalize Selected" and "Download PDF Preview" #} {# We copy start_date, end_date, all checked weekdays, and the staff IDs #} {# from above so that these two forms receive exactly the same POST data. #} {# ───────────────────────────────────────────────────────────────────── #}
{% csrf_token %} {% for wd in weekdays %} {% endfor %} {% for t_id in selected_staff %} {% endfor %}
{% csrf_token %} {% for wd in weekdays %} {% endfor %} {% for t_id in selected_staff %} {% endfor %}
{% endif %}

{% csrf_token %}

Finalize Salary on Daily bases

{% endblock %} {% block javascripts %} {% endblock %}