{% extends "pos/base.html" %} {% load humanize %} {% block title %}Cash Counter — Settlement | Job #{{ job.job_no }}{% endblock %} {% block stylesheets %} {% endblock %} {% block content %}
{% for m in messages %}
{{ m }}
{% endfor %} {# Page header #}
Cash Counter Settlement & Invoice — Job #{{ job.job_no }}
{{ job.vehicle.reg_no }} | {{ job.vehicle.make }} {{ job.vehicle.model }} {% if job.pit %}| Pit: {{ job.pit }}{% endif %} | {{ job.get_billing_type_display }} | Status: {{ job.get_status_display }} {% if job.status == "invoiced" %} | Invoice #{{ job.invoice_no }}{% endif %}
{% if job.status == "invoiced" %}
Invoice #{{ job.invoice_no }} generated · Net Amount: Rs. {{ job.net_amount|floatformat:0|intcomma }}
Print Documents
{# Payment receive for credit/corporate/insurance #} {% if job.billing_type in "credit,insurance,corporate" %}
Payment from {{ job.get_billing_type_display }} Account
{% endif %} {% else %} {# Pre-print banner #}
Pre-Print Draft Print a preview copy before generating the final invoice
Print Pre-Invoice
{# ── LEFT: Invoice Summary ─────────────────────────────────────── #}
Invoice Summary
{# Stat row #}
{{ job.services_net|floatformat:0|intcomma }}
Labour Net
{{ job.parts_net|floatformat:0|intcomma }}
Parts Net (Issued)
{# Services breakdown #}
Services Sub-total{{ job.services_subtotal|floatformat:0|intcomma }}
{% if job.services_discount_amt %}
Services Discount- {{ job.services_discount_amt|floatformat:0|intcomma }}
{% endif %} {% if job.services_tax_amt %}
Services Tax+ {{ job.services_tax_amt|floatformat:0|intcomma }}
{% endif %}
Services Net{{ job.services_net|floatformat:0|intcomma }}

Parts Sub-total (Issued){{ job.parts_subtotal|floatformat:0|intcomma }}
{% if job.parts_discount_amt %}
Parts Discount- {{ job.parts_discount_amt|floatformat:0|intcomma }}
{% endif %} {% if job.parts_tax_amt %}
Parts Tax (GST)+ {{ job.parts_tax_amt|floatformat:0|intcomma }}
{% endif %}
Parts Net{{ job.parts_net|floatformat:0|intcomma }}

Subtotal{{ job.grand_total|floatformat:0|intcomma }}
Cash Counter Discount- {{ job.counter_discount_amt|floatformat:0|intcomma }}
GRAND TOTAL Rs. {{ job.net_amount|floatformat:0|intcomma }}
{# Insurance depreciation / under-insurance breakdown #} {% if job.billing_type == "insurance" %}
Insurance Breakdown
Parts Net (incl. GST) Rs. {{ ins.parts_net|floatformat:0|intcomma }}
Depreciation ({{ ins.dep_per|floatformat:1 }}% on Parts) - Rs. {{ ins.dep_amount|floatformat:0|intcomma }}
Under Insurance ({{ ins.under_insurance_per|floatformat:1 }}%) Rs. {{ ins.under_insurance_amt|floatformat:0|intcomma }}

Customer pays now Rs. {{ ins.customer_share|floatformat:0|intcomma }}
Insurance Company billed (pending) Rs. {{ ins.under_insurance_amt|floatformat:0|intcomma }}
Only the Insurance Company's share is posted to their ledger when the invoice is generated. The customer's share is collected now, below.
{% endif %}
{# ── CENTER: Payment Entry ──────────────────────────────────────── #}
{% csrf_token %} {# Cash Counter flat discount #}
Cash Counter Discount
Optional extra discount given at the counter, applied on top of services/parts discounts already set earlier.
Payment Details
{# Billing type info #}
{% if job.billing_type == "cash" %} {# Cash: collect payment now #}
Mode / Bank Amount
Balance / Change Rs. 0
{% elif job.billing_type == "insurance" %} {# Insurance: collect ONLY the customer's share now — the Under Insurance Amount is posted to the insurance company's ledger. #}
Collect Rs. {{ ins.customer_share|floatformat:0|intcomma }} from the customer now. Rs. {{ ins.under_insurance_amt|floatformat:0|intcomma }} will be posted to the insurance company's ledger as pending.
Mode / Bank Amount
Balance / Change Rs. 0
{% elif job.billing_type == "complimentary" %}
Complimentary — No payment required. Invoice will be posted as complimentary.
{% else %}
{{ job.get_billing_type_display }} Account — Invoice will be posted to the billing account ledger. Collect payment separately via the company ledger.
{% endif %}
{# Cheque entry (optional) #}
Cheque Details (Optional)
{# Confirm + Generate #}
This will post the invoice, deduct stock, and record payment. Cannot be undone.  |  Ctrl+S = generate
{# ── RIGHT: Services + Parts Preview ──────────────────────────── #}
Services ({{ services.count }})
{% for s in services %}
{{ s.service_name|default:s.description|truncatechars:32 }} {{ s.price|floatformat:0|intcomma }}
{% if s.tax_per %} PST {{ s.tax_per|floatformat:0 }}% = {{ s.tax_amount|floatformat:0|intcomma }} {% endif %}
{% empty %}
No services
{% endfor %}
Parts Issued ({{ parts.count }})
{% for p in parts %} {% if p.issued_qty %}
{{ p.product_name|truncatechars:28 }} {{ p.line_total|floatformat:0|intcomma }}
Issued {{ p.issued_qty }} × {{ p.rate|floatformat:0 }} {% if p.qty != p.issued_qty %}(req. {{ p.qty }}){% endif %} {% if p.tax_per %} | GST {{ p.tax_per|floatformat:0 }}%{% endif %}
{% endif %} {% empty %}
No parts
{% endfor %}
{# /row #} {% endif %}{# invoiced check #}
{% endblock %} {% block javascripts %} {% endblock %}