diff --git a/django_ledger/templates/django_ledger/bills/includes/card_bill.html b/django_ledger/templates/django_ledger/bills/includes/card_bill.html index 338d85d1..b95dd892 100644 --- a/django_ledger/templates/django_ledger/bills/includes/card_bill.html +++ b/django_ledger/templates/django_ledger/bills/includes/card_bill.html @@ -18,26 +18,19 @@
Past Due: {{ bill.date_due | timesince }} ago
{% endif %} - {% if bill.accrue %} -Is Accrued: {% icon 'ant-design:check-circle-filled' 24 %} - {% else %} -
Accrue: - {% icon 'maki:roadblock-11' 24 %} - {% endif %} -
You Still Owe: +
{% trans 'Is Accrued' %}: + {% include 'django_ledger/components/accrual_icon.html' with is_accrued=bill.accrue %} +
+{% trans 'You Still Owe' %}: {% currency_symbol %}{{ bill.get_amount_open | currency_format }}
-Amount Paid: {% currency_symbol %}{{ bill.amount_paid | currency_format }}
-Progressed: {{ bill.get_progress | percentage }}
{% trans 'Amount Paid' %}: {% currency_symbol %}{{ bill.amount_paid | currency_format }}
+{% trans 'Progressed' %}: {{ bill.get_progress | percentage }}
{% trans 'Amount Due' %}: - - {% currency_symbol %}{{ bill.amount_due | currency_format }} - -
-{% trans 'Due Date' %}: - {{ bill.date_due | timeuntil }} + + {# Status heading — colour varies by state #} + {% if bill.is_paid %} +
{% trans 'Amount Paid' %}: + {% currency_symbol %}{{ bill.amount_paid | currency_format }}
-{% trans 'Is Accrued' %}: - {% if bill.accrue %} - {% icon 'ant-design:check-circle-filled' 24 %} - {% else %} - {% icon 'maki:roadblock-11' 24 %} - {% endif %} +
{% trans 'Paid Date' %}: + {{ bill.date_paid | date }}
- {% elif bill.is_review %} -{% trans 'Amount Due' %}: - - {% currency_symbol %}{{ bill.amount_due | currency_format }} - + {% currency_symbol %}{{ bill.amount_due | currency_format }}
{% trans 'Due Date' %}: {{ bill.date_due | timeuntil }}
{% trans 'Is Accrued' %}: - {% if bill.accrue %} - {% icon 'ant-design:check-circle-filled' 24 %} - {% else %} - {% icon 'maki:roadblock-11' 24 %} - {% endif %} + {% include 'django_ledger/components/accrual_icon.html' with is_accrued=bill.accrue %}
- {% if bill.xref %} -{% trans 'External Ref' %}: {{ bill.xref }}
- {% endif %} - - {% elif bill.is_approved %} -{% trans 'Amount Due' %}: - - {% currency_symbol %}{{ bill.amount_due | currency_format }} - -
-{% trans 'Due Date' %}: - {{ bill.date_due | timeuntil }} -
-{% trans 'Is Accrued' %}: - {% if bill.accrue %} - {% icon 'ant-design:check-circle-filled' 24 %} - {% else %} - {% icon 'maki:roadblock-11' 24 %} - {% endif %} + {% else %} +
{% trans 'Bill Amount' %}: + {% currency_symbol %}{{ bill.amount_due | currency_format }}
+ {% endif %} + + {# Progress bar — only for approved bills with partial payment #} + {% if bill.is_approved %}{% trans 'Amount Paid' %}: {% currency_symbol %}{{ bill.amount_paid | currency_format }}
{% trans 'Progressed' %}: {{ bill.get_progress | percentage }}
{% trans 'External Ref' %}: {{ bill.xref }}
- {% endif %} - {% elif bill.is_paid %} -{% trans 'Amount Paid' %}: - - {% currency_symbol %}{{ bill.amount_paid | currency_format }} - -
-{% trans 'Paid Date' %}: - {{ bill.date_paid | date }} - {% if bill.xref %} -
{% trans 'External Ref' %}: {{ bill.xref }}
- {% endif %} - {% else %} -Bill Amount: - {% currency_symbol %}{{ bill.amount_due | currency_format }} -
-{{ bill.get_bill_status_display | upper }}
{% endif %} + + {# External reference — shown for review and approved states #} + {% if bill.xref and not bill.is_draft %} +{% trans 'External Ref' %}: {{ bill.xref }}
+ {% endif %} +{% icon "bi:cash-stack" 16 %} - {% trans 'Invoice' %}
+ {% trans 'Invoice' %} +Past Due: {{ invoice.date_due | timesince }} ago
{% endif %} - {% if invoice.accrue %} -Accrue: {% icon 'ant-design:check-circle-filled' 24 %} - {% else %} -
Accrue: - {% icon 'maki:roadblock-11' 24 %} - {% endif %} -
Owed to You: +
{% trans 'Is Accrued' %}: + {% include 'django_ledger/components/accrual_icon.html' with is_accrued=invoice.accrue %} +
+{% trans 'Owed to You' %}: {% currency_symbol %}{{ invoice.get_amount_open | currency_format }}
-Amount Paid: {% currency_symbol %}{{ invoice.amount_paid | currency_format }}
-Progressed: {{ invoice.get_progress | percentage }}
{% trans 'Amount Paid' %}: {% currency_symbol %}{{ invoice.amount_paid | currency_format }}
+{% trans 'Progressed' %}: {{ invoice.get_progress | percentage }}
{% trans 'Amount Due' %}: - - {% currency_symbol %}{{ invoice.amount_due | currency_format }} - -
-{% trans 'Due Date' %}: - {{ invoice.date_due | timeuntil }} + + {# Status heading — colour varies by state #} + {% if invoice.is_paid %} +
{% trans 'Amount Paid' %}: + {% currency_symbol %}{{ invoice.amount_paid | currency_format }}
-{% trans 'Is Accrued' %}: - {% if invoice.accrue %} - {% icon 'ant-design:check-circle-filled' 24 %} - {% else %} - {% icon 'maki:roadblock-11' 24 %} - {% endif %} +
{% trans 'Paid Date' %}: + {{ invoice.date_paid | date }}
- {% elif invoice.is_review %} -{% trans 'Amount Due' %}: - - {% currency_symbol %}{{ invoice.amount_due | currency_format }} - + {% currency_symbol %}{{ invoice.amount_due | currency_format }}
{% trans 'Due Date' %}: {{ invoice.date_due | timeuntil }}
{% trans 'Is Accrued' %}: - {% if invoice.accrue %} - {% icon 'ant-design:check-circle-filled' 24 %} - {% else %} - {% icon 'maki:roadblock-11' 24 %} - {% endif %} + {% include 'django_ledger/components/accrual_icon.html' with is_accrued=invoice.accrue %}
- {% if invoice.xref %} -{% trans 'External Ref' %}: {{ invoice.xref }}
- {% endif %} - - {% elif invoice.is_approved %} -{% trans 'Amount Due' %}: - - {% currency_symbol %}{{ invoice.amount_due | currency_format }} - -
-{% trans 'Due Date' %}: - {{ invoice.date_due | timeuntil }} -
-{% trans 'Is Accrued' %}: - {% if invoice.accrue %} - {% icon 'ant-design:check-circle-filled' 24 %} - {% else %} - {% icon 'maki:roadblock-11' 24 %} - {% endif %} + {% else %} +
{% trans 'Invoice Amount' %}: + {% currency_symbol %}{{ invoice.amount_due | currency_format }}
+ {% endif %} + + {# Progress bar — only for approved invoices with partial payment #} + {% if invoice.is_approved %}{% trans 'Amount Paid' %}: {% currency_symbol %}{{ invoice.amount_paid | currency_format }}
{% trans 'Progressed' %}: {{ invoice.get_progress | percentage }}
{% trans 'Amount Paid' %}: - - {% currency_symbol %}{{ invoice.amount_paid | currency_format }} - -
-{% trans 'Paid Date' %}: - {{ invoice.date_paid | date }} - {% else %} -
Invoice Amount: - {% currency_symbol %}{{ invoice.amount_due | currency_format }} -
-{{ invoice.get_invoice_status_display | upper }}
{% endif %} + + {# External reference — shown for review and approved states #} + {% if invoice.xref and not invoice.is_draft %} +{% trans 'External Ref' %}: {{ invoice.xref }}
+ {% endif %} +