From 432210d13d9fc0386cf3854530c2d44f2614d9fd Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 14:26:38 +0530 Subject: [PATCH] fix(india): minor e-invoicing fixes (backport #30553) (#31067) --- .../print_format/gst_e_invoice/gst_e_invoice.html | 11 +++++++++-- erpnext/regional/india/e_invoice/utils.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/print_format/gst_e_invoice/gst_e_invoice.html b/erpnext/accounts/print_format/gst_e_invoice/gst_e_invoice.html index 66981763c12..4379795ce6d 100644 --- a/erpnext/accounts/print_format/gst_e_invoice/gst_e_invoice.html +++ b/erpnext/accounts/print_format/gst_e_invoice/gst_e_invoice.html @@ -1,7 +1,8 @@ {%- from "templates/print_formats/standard_macros.html" import add_header, render_field, print_value -%} -{%- set einvoice = json.loads(doc.signed_einvoice) -%}
+ {% if doc.signed_einvoice %} + {%- set einvoice = json.loads(doc.signed_einvoice) -%}
{% if letter_head and not no_letterhead %}
{{ letter_head }}
@@ -163,4 +164,10 @@
-
\ No newline at end of file + {% else %} +
+ You must generate IRN before you can preview GST E-Invoice. +
+ {% endif %} + + diff --git a/erpnext/regional/india/e_invoice/utils.py b/erpnext/regional/india/e_invoice/utils.py index d5d4a526383..7892a5003a8 100644 --- a/erpnext/regional/india/e_invoice/utils.py +++ b/erpnext/regional/india/e_invoice/utils.py @@ -306,7 +306,7 @@ def update_other_charges(tax_row, invoice_value_details, gst_accounts_list, invo def get_payment_details(invoice): payee_name = invoice.company - mode_of_payment = ', '.join([d.mode_of_payment for d in invoice.payments]) + mode_of_payment = "" paid_amount = invoice.base_paid_amount outstanding_amount = invoice.outstanding_amount