Skip to content

Commit

Permalink
fix: Ignore validation validate_for_invalid_account_type for GST ca…
Browse files Browse the repository at this point in the history
…tegory: SEZ (#2523)

* fix: ignore validate_for_invalid_account_type for SEZ

* fix: fix failing test case

* fix: correctly guess company gst category for all doctypes

---------

Co-authored-by: Smit Vora <smitvora203@gmail.com>
(cherry picked from commit 10cde4a)
  • Loading branch information
vishakhdesai authored and mergify[bot] committed Aug 22, 2024
1 parent 2046c95 commit 18a5e64
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions india_compliance/gst_india/overrides/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,20 @@ def validate_for_invalid_account_type(self):
- Intra-State supplies should not have IGST account
- If Intra-State, ensure both CGST and SGST accounts are used
"""
if self.is_sales_transaction:
company_address_field = "company_address"
elif self.doc.doctype == "Stock Entry":
company_address_field = "bill_from_address"
else:
company_address_field = "billing_address"

company_gst_category = frappe.db.get_value(
"Address", self.doc.get(company_address_field), "gst_category"
)

if company_gst_category == "SEZ":
return

is_inter_state = is_inter_state_supply(self.doc)

for row in self.gst_tax_rows:
Expand Down

0 comments on commit 18a5e64

Please sign in to comment.