diff --git a/india_compliance/gst_india/utils/e_invoice.py b/india_compliance/gst_india/utils/e_invoice.py index c99c21a5d..223cf48d1 100644 --- a/india_compliance/gst_india/utils/e_invoice.py +++ b/india_compliance/gst_india/utils/e_invoice.py @@ -304,7 +304,8 @@ def log_and_process_e_invoice_generation(doc, result, sandbox_mode=False, messag doc, { "irn": doc.irn, - "sales_invoice": doc.name, + "reference_doctype": doc.doctype, + "reference_name": doc.name, "acknowledgement_number": result.AckNo, "acknowledged_on": parse_datetime(result.AckDt), "signed_invoice": result.SignedInvoice, diff --git a/india_compliance/gst_india/utils/test_e_invoice.py b/india_compliance/gst_india/utils/test_e_invoice.py index 030a1a9ea..2bcc816fa 100644 --- a/india_compliance/gst_india/utils/test_e_invoice.py +++ b/india_compliance/gst_india/utils/test_e_invoice.py @@ -251,7 +251,7 @@ def test_generate_e_invoice_with_goods_item(self): self.assertDocumentEqual( {"name": test_data.get("response_data").get("result").get("Irn")}, - frappe.get_doc("e-Invoice Log", {"sales_invoice": si.name}), + frappe.get_doc("e-Invoice Log", {"reference_name": si.name}), ) self.assertDocumentEqual( {"name": test_data.get("response_data").get("result").get("EwbNo")}, @@ -297,7 +297,7 @@ def test_generate_e_invoice_with_service_item(self): self.assertDocumentEqual( {"name": test_data.get("response_data").get("result").get("Irn")}, - frappe.get_doc("e-Invoice Log", {"sales_invoice": si.name}), + frappe.get_doc("e-Invoice Log", {"reference_name": si.name}), ) self.assertFalse( @@ -356,7 +356,7 @@ def test_generate_e_invoice_with_nil_exempted_item(self): self.assertDocumentEqual( {"name": test_data.get("response_data").get("result").get("Irn")}, - frappe.get_doc("e-Invoice Log", {"sales_invoice": si.name}), + frappe.get_doc("e-Invoice Log", {"reference_name": si.name}), ) self.assertFalse( @@ -430,7 +430,7 @@ def test_credit_note_e_invoice_with_goods_item(self): self.assertDocumentEqual( {"name": test_data.get("response_data").get("result").get("Irn")}, - frappe.get_doc("e-Invoice Log", {"sales_invoice": credit_note.name}), + frappe.get_doc("e-Invoice Log", {"reference_name": credit_note.name}), ) self.assertFalse( @@ -495,7 +495,7 @@ def test_debit_note_e_invoice_with_goods_item(self): self.assertDocumentEqual( {"name": test_data.get("response_data").get("result").get("Irn")}, - frappe.get_doc("e-Invoice Log", {"sales_invoice": debit_note.name}), + frappe.get_doc("e-Invoice Log", {"reference_name": debit_note.name}), ) self.assertFalse(