{% load django_ledger %} {% load i18n %}
{% if not create_bill %} {% if style == 'dashboard' %}

{% icon "ri:bill-line" 16 %} {% trans 'Bill' %}

{{ bill.vendor.vendor_name }}

{{ bill.vendor.address_1 }}

{% if not bill.is_past_due %}

{% trans 'Due in' %}: {{ bill.date_due | timeuntil }}

{% else %}

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: {% currency_symbol %}{{ bill.get_amount_open | currency_format }}

Amount Paid: {% currency_symbol %}{{ bill.amount_paid | currency_format }}

Progressed: {{ bill.get_progress | percentage }}


{{ bill.get_progress | percentage }} {# MARK AS PAID MODAL #} {% modal_action bill 'get' entity_slug %}
{% elif style == 'bill-detail' %}

{% icon 'uil:bill' 36 %}{% trans 'Bill' %} {{ bill.bill_number }}

{% if bill.is_draft %}

{% trans 'This bill is' %} {{ bill.get_bill_status_display }}

{% 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 %}

{% elif bill.is_review %}

{% trans 'This bill is' %} {{ bill.get_bill_status_display }}

{% 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 %}

{% if bill.xref %}

{% trans 'External Ref' %}: {{ bill.xref }}

{% endif %} {% elif bill.is_approved %}

{% trans 'This bill is' %} {{ bill.get_bill_status_display }}

{% 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 %}

{% trans 'Amount Paid' %}: {% currency_symbol %}{{ bill.amount_paid | currency_format }}

{% trans 'Progressed' %}: {{ bill.get_progress | percentage }}


{{ bill.get_progress | percentage }} {% if bill.xref %}

{% trans 'External Ref' %}: {{ bill.xref }}

{% endif %} {% elif bill.is_paid %}

{% trans 'This bill is' %} {{ bill.get_bill_status_display }}

{% 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 %}
{# UPDATE BUTTON #} {% trans 'Update' %} {# MARK DRAFT #} {% if bill.can_draft %} {% trans 'Mark as Draft' %} {# MARK AS DRAFT MODAL #} {% modal_action_v2 bill bill.get_mark_as_draft_url bill.get_mark_as_draft_message bill.get_mark_as_draft_html_id %} {% endif %} {# MARK REVIEW #} {% if bill.can_review %} {% trans 'Mark as Review' %} {# MARK AS REVIEW MODAL #} {% modal_action_v2 bill bill.get_mark_as_review_url bill.get_mark_as_review_message bill.get_mark_as_review_html_id %} {% endif %} {# MARK APPROVED #} {% if bill.can_approve %} {% trans 'Mark as Approved' %} {# MARK AS APPROVED MODAL #} {% modal_action_v2 bill bill.get_mark_as_approved_url bill.get_mark_as_approved_message bill.get_mark_as_approved_html_id %} {% endif %} {# MARK PAID #} {% if bill.can_pay %} {% trans 'Mark as Paid' %} {# MARK AS PAID MODAL #} {% modal_action_v2 bill bill.get_mark_as_paid_url bill.get_mark_as_paid_message bill.get_mark_as_paid_html_id %} {% endif %} {# VOID BUTTON #} {% if bill.can_void %} {% trans 'Void' %} {# MARK AS VOID MODAL #} {% modal_action_v2 bill bill.get_mark_as_void_url bill.get_mark_as_void_message bill.get_mark_as_void_html_id %} {% endif %} {# CANCEL BUTTON #} {% if bill.can_cancel %} {% trans 'Cancel' %} {# MARK AS VOID MODAL #} {% modal_action_v2 bill bill.get_mark_as_canceled_url bill.get_mark_as_canceled_message bill.get_mark_as_canceled_html_id %} {% endif %}
{% endif %} {% else %} {# CREATE BILL CARD #}
{% icon "ic:baseline-add-circle-outline" 48 %}

{% trans 'New Bill' %}

{% endif %}