fix: exclude intra company transactions

This commit is contained in:
Saqib Ansari
2020-11-24 13:52:54 +05:30
parent c82c955bc2
commit ee0b08ae9c

View File

@@ -21,8 +21,9 @@ def validate_einvoice_fields(doc):
einvoicing_enabled = frappe.db.get_value('E Invoice Settings', 'E Invoice Settings', 'enable')
invalid_doctype = doc.doctype not in ['Sales Invoice']
invalid_supply_type = doc.get('gst_category') not in ['Registered Regular', 'SEZ', 'Overseas', 'Deemed Export']
company_transaction = doc.get('billing_address_gstin') == doc.get('company_gstin')
if invalid_doctype or invalid_supply_type or not einvoicing_enabled: return
if invalid_doctype or invalid_supply_type or company_transaction or not einvoicing_enabled: return
if doc.docstatus == 0 and doc._action == 'save':
if doc.irn: