{% extends 'base.html' %} {% block title %}{{ title }} - 3ncount2026{% endblock %} {% block content %}

{{ title }}

{% if invoice %} Back to Invoice {% elif bill %} Back to Bill {% endif %}
{% if invoice %} Invoice Details {% else %} Bill Details {% endif %}

Document No: {% if invoice %}{{ invoice.invoice_number }}{% else %}{{ bill.bill_number }}{% endif %}

{% if invoice %}Customer:{% else %}Vendor:{% endif %} {% if invoice %}{{ invoice.customer.name }}{% else %}{{ bill.vendor.name }}{% endif %}

Date: {% if invoice %}{{ invoice.invoice_date }}{% else %}{{ bill.bill_date }}{% endif %}

Total Amount: RM{% if invoice %}{{ invoice.total|floatformat:2 }}{% else %}{{ bill.total|floatformat:2 }}{% endif %}

Amount Paid: RM{% if invoice %}{{ invoice.get_amount_paid|floatformat:2 }}{% else %}{{ bill.get_amount_paid|floatformat:2 }}{% endif %}

Outstanding Balance: RM{% if invoice %}{{ invoice.get_balance_due|floatformat:2 }}{% else %}{{ bill.get_balance_due|floatformat:2 }}{% endif %}

Record Payment
{% if form.non_field_errors %}
{{ form.non_field_errors }}
{% endif %}
{% csrf_token %}
{{ form.payment_date }} {% if form.payment_date.errors %}
{{ form.payment_date.errors }}
{% endif %} Date when payment was received/made
RM {{ form.amount }}
{% if form.amount.errors %}
{{ form.amount.errors }}
{% endif %} Cannot exceed outstanding balance
{{ form.bank_account }} {% if form.bank_account.errors %}
{{ form.bank_account.errors }}
{% endif %} Select which bank account {% if invoice %}received{% else %}made{% endif %} this payment
{{ form.payment_method }} {% if form.payment_method.errors %}
{{ form.payment_method.errors }}
{% endif %}
{{ form.reference_number }} {% if form.reference_number.errors %}
{{ form.reference_number.errors }}
{% endif %} Bank transfer ID, Cheque No., Transaction ID, etc.
{{ form.notes }} {% if form.notes.errors %}
{{ form.notes.errors }}
{% endif %} Optional payment notes
{% if invoice %} Cancel {% elif bill %} Cancel {% endif %}
Recording Payment
  • Payment will be automatically allocated to this {% if invoice %}invoice{% else %}bill{% endif %}
  • A receipt will be automatically generated with a unique receipt number
  • {% if invoice %}Invoice{% else %}Bill{% endif %} status will be updated automatically (Unpaid → Partial → Paid)
  • You can record multiple partial payments until fully paid
  • Transaction will be linked to the selected bank account for accurate balance tracking
{% endblock %}