fix(e-invoicing): cannot generate IRNs for standalone credit notes (#26824) (#26833)

This commit is contained in:
Frappe PR Bot 2021-08-06 12:33:18 +05:30 committed by GitHub
parent ffd7642de2
commit c8e6c07032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,10 +316,6 @@ def get_payment_details(invoice):
))
def get_return_doc_reference(invoice):
if not invoice.return_against:
frappe.throw(_('For generating IRN, reference to the original invoice is mandatory for a credit note. Please set {} field to generate e-invoice.')
.format(frappe.bold('Return Against')), title=_('Missing Field'))
invoice_date = frappe.db.get_value('Sales Invoice', invoice.return_against, 'posting_date')
return frappe._dict(dict(
invoice_name=invoice.return_against, invoice_date=format_date(invoice_date, 'dd/mm/yyyy')
@ -435,7 +431,7 @@ def make_einvoice(invoice):
if invoice.is_pos and invoice.base_paid_amount:
payment_details = get_payment_details(invoice)
if invoice.is_return:
if invoice.is_return and invoice.return_against:
prev_doc_details = get_return_doc_reference(invoice)
if invoice.transporter and not invoice.is_return: