{% extends "base.html" %} {% block title %}Credit Note{% endblock %} {% block header %}Credit Note{% endblock %} {% block content %}
Credit Note

{{ credit_note.credit_note_no }}

{{ credit_note.status }} {% if replacement_invoice %}
Credit Note Rebilling Linkage
This Credit Note has been mapped to Invoice {{ replacement_invoice.invoice_no }} {% if replacement_invoice.client %}for {{ replacement_invoice.client.name }}{% endif %}. The Credit Note itself has not been altered.
Open Mapped Invoice
{% endif %} {% if credit_note.einvoice_status == "Generated" %} IRN Generated {% elif credit_note.einvoice_status == "Failed" %} IRN Failed {% else %} IRN Pending {% endif %}
{% if credit_note.einvoice_status != "Generated" and credit_note.status != "Cancelled" %}
{% else %} {% if credit_note.einvoice_status == "Generated" %} IRN Generated {% endif %} {% endif %} {% if replacement_invoice %} {% if replacement_invoice.invoice_origin == 'CREDIT_NOTE_REBILL' %} Rebilled Invoice: {{ replacement_invoice.invoice_no }} {% else %} Replacement Invoice Generated {% endif %} {% elif credit_note.einvoice_status == "Generated" and credit_note.status != "Cancelled" %} Prepare Replacement Invoice {% endif %} Back Download PDF {% if credit_note.tally_sync_status != "Synced" %}
{% else %} Synced to Tally {% endif %}
{% if credit_note.einvoice_status == "Generated" %}
E-Invoice Details
Generated On: {{ credit_note.einvoice_generated_at.strftime('%d-%m-%Y %I:%M %p') if credit_note.einvoice_generated_at else '-' }}
{{ credit_note.irn }}
{{ credit_note.ack_no or '-' }}
{{ credit_note.ack_date.strftime('%d-%m-%Y %I:%M %p') if credit_note.ack_date else '-' }}
ACTIVE
{% if credit_note.einvoice_qr_image %} Credit Note E-Invoice QR
Signed E-Invoice QR
{% else %}
QR image is not available.
{% endif %}
{% elif credit_note.einvoice_status == "Failed" %}
Credit Note IRN Generation Failed
{% if credit_note.einvoice_error %}
{{ credit_note.einvoice_error }}
{% endif %}
{% endif %} {% if credit_note.tally_sync_status == "Failed" and credit_note.tally_sync_error %}
Tally Sync Error:
{{ credit_note.tally_sync_error }}
{% elif credit_note.tally_sync_status == "Synced" and credit_note.tally_sync_at %}
Credit Note synced to Tally on {{ credit_note.tally_sync_at.strftime('%d-%b-%Y %I:%M %p') }}
{% endif %} {% set invoice = credit_note.invoice %} {% set doc_title = "Credit Note" %} {% set doc_no = credit_note.credit_note_no %} {% set doc_date = credit_note.credit_note_date %} {% set doc = credit_note %} {% set quote = invoice.quote %} {% set client = credit_note.client %} {% set branch = credit_note.client_branch %} {% set company_branch = credit_note.company_branch %} {% set credit_note_against_invoice = invoice.invoice_no %} {% set credit_note_remarks = credit_note.remarks or credit_note.reason %}
{% include "billing/_doc_layout.html" with context %}
{% endblock %}