{% extends "base.html" %} {% block title %}Invoice{% endblock %} {% block header %}Invoice{% endblock %} {% block content %}
Tax Invoice

{{ invoice.invoice_no }}

{% if invoice.einvoice_status == "Generated" %} IRN Generated {% elif invoice.einvoice_status == "Failed" %} IRN Failed {% else %} IRN Pending {% endif %}
{% if invoice.invoice_origin == "CREDIT_NOTE_REPLACEMENT" and not invoice.irn and invoice.einvoice_status != "Generated" and invoice.tally_sync_status != "Synced" %}
{% endif %} {% if invoice.einvoice_status != "Generated" %}
{% elif not invoice.signed_qr_code or not invoice.einvoice_qr_image %}
{% endif %} {% if invoice.tally_sync_status == "Synced" %} Synced to Tally {% else %}
{% endif %} {% if invoice.tally_sync_status == "Synced" %} Synced to Tally {% endif %} {% if invoice.status != "Cancelled" %} {% if generated_credit_note %} Credit Note Generated {% elif invoice.credit_note_status == "Requested" %} Credit Note Requested {% elif invoice.credit_note_status == "Approved" %} Credit Note Approved {% elif current_user.has_perm("credit_notes.requests.create") %} Raise Credit Note Request {% endif %} {% endif %} Back to PI Download PDF Payments {% if can_edit_invoice_items %} {% elif current_user.has_perm("invoices.generate") and (invoice.irn or invoice.einvoice_status == "Generated" or invoice.tally_sync_status == "Synced") %} Items Locked {% if can_manual_exception_edit %} Exception Edit {% endif %} {% endif %} {% if current_user.has_perm("invoices.generate") and invoice.status != "Cancelled" %} {% endif %} {% if not invoice.irn and invoice.tally_sync_status != "Synced" and invoice.status != "Cancelled" %} {% endif %}
{% if invoice.manual_item_edit_count %}
Post-Issue Invoice Line Items Edited
This invoice has {{ invoice.manual_item_edit_count }} manual post-issue edit(s). The invoice subtotal remained unchanged. IRN/Tally records are not automatically rewritten.
{% if invoice.manual_item_edit_reason %}
Latest reason: {{ invoice.manual_item_edit_reason }}
{% endif %}
{% if invoice.manual_irn_reconciliation_status == 'Pending' %} Manual IRN Update Pending {% elif invoice.manual_irn_reconciliation_status == 'Completed' %} Manual IRN Updated {% endif %} {% if invoice.manual_tally_reconciliation_status == 'Pending' %} Manual Tally Update Pending {% elif invoice.manual_tally_reconciliation_status == 'Completed' %} Manual Tally Updated {% endif %}
{% endif %} {% if original_invoice or source_credit_note or replacement_invoice %}
{% endif %} {% if invoice.einvoice_status == "Generated" %}
E-Invoice Details
Generated On: {{ invoice.einvoice_generated_at.strftime('%d-%m-%Y %I:%M %p') if invoice.einvoice_generated_at else '-' }}
{{ invoice.irn }}
{{ invoice.ack_no or "-" }}
{{ invoice.ack_date.strftime('%d-%m-%Y %I:%M %p') if invoice.ack_date else "-" }}
ACTIVE
{% if invoice.signed_qr_code %} {% if invoice.einvoice_qr_image %} E-Invoice QR {% else %} E-Invoice QR {% endif %}
Signed E-Invoice QR
{% else %}
QR code not available.
{% endif %}
{% elif invoice.einvoice_status == "Failed" %}
IRN Generation Failed
{% if invoice.einvoice_error %}
{{ invoice.einvoice_error }}
{% endif %}
{% endif %} {% set doc_title = "Tax Invoice" %} {% set doc_no = invoice.invoice_no %} {% set doc_date = invoice.invoice_date %} {% set doc = invoice %} {% set quote = invoice.quote %} {% set client = invoice.client %} {% set branch = invoice.client_branch %} {% set company_branch = invoice.company_branch %} {% set items = items %}
{% include "billing/_doc_layout.html" with context %}
{% endblock %}