mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
fix(india): e-invoice eligibility if company gstin is not configured (#31276)
This commit is contained in:
@@ -36,6 +36,7 @@ def validate_eligibility(doc):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
invalid_company = not frappe.db.get_value('E Invoice User', { 'company': doc.get('company') })
|
invalid_company = not frappe.db.get_value('E Invoice User', { 'company': doc.get('company') })
|
||||||
|
invalid_company_gstin = not frappe.db.get_value('E Invoice User', {'gstin': doc.get('company_gstin')})
|
||||||
invalid_supply_type = doc.get('gst_category') not in ['Registered Regular', 'SEZ', 'Overseas', 'Deemed Export']
|
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')
|
company_transaction = doc.get('billing_address_gstin') == doc.get('company_gstin')
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ def validate_eligibility(doc):
|
|||||||
no_taxes_applied = not doc.get('taxes') and not doc.get('gst_category') == 'Overseas'
|
no_taxes_applied = not doc.get('taxes') and not doc.get('gst_category') == 'Overseas'
|
||||||
has_non_gst_item = any(d for d in doc.get('items', []) if d.get('is_non_gst'))
|
has_non_gst_item = any(d for d in doc.get('items', []) if d.get('is_non_gst'))
|
||||||
|
|
||||||
if invalid_company or invalid_supply_type or company_transaction or no_taxes_applied or has_non_gst_item:
|
if invalid_company or invalid_company_gstin or invalid_supply_type or company_transaction or no_taxes_applied or has_non_gst_item:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user