Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
"fieldname": "validate_sales_invoice_tax_id",
"fieldtype": "Select",
"label": "Validate Customer Tax ID for Sales Tax Invoice",
"options": "\nMandatory\nMandatory for Company"
"options": "\nMandatory\nMandatory for Company\nMandatory for Company and Annual Turnover"
},
{
"default": "0",
Expand All @@ -325,7 +325,7 @@
"idx": 1,
"issingle": 1,
"links": [],
"modified": "2025-08-28 14:27:21.809120",
"modified": "2026-04-21 18:35:17.448972",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Accounts Settings",
Expand Down
5 changes: 5 additions & 0 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ def validate_tax_id_mandatory(self):
if validation == "Mandatory for Company":
if frappe.get_cached_value("Customer", self.bill_to or self.customer, "customer_type") == "Individual":
return
if validation == "Mandatory for Company and Annual Turnover":
if frappe.get_cached_value("Customer", self.bill_to or self.customer, "customer_type") == "Individual" or \
(frappe.get_cached_value("Customer", self.bill_to or self.customer, "customer_type") == "Company" and \
frappe.get_cached_value("Customer", self.bill_to or self.customer, "vat_registration_decider") == "Annual Turnover <= 375,000 AED"):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot add into core because vat_registration_decider is not a core field

Copy link
Copy Markdown
Author

@kunhimohamed kunhimohamed Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is we need to override the method by custom application?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend a hidden checkbox in Customer master for the core something like "Tax ID Non Mandatory" tax_id_non_mandatory, this checkbox will be 0 by default, and 1 only if vat_registration_decider meets the criteria. The core will only check tax_id_non_mandatory to override the validation

return

if validation:
frappe.throw(_("Customer {0} or Identification Number is mandatory for Sales Tax Invoice").format(_("Tax ID")))
Expand Down