fix: Validation for single threshold in Tax With Holding Category (#30382)

This commit is contained in:
Sherin KR
2022-04-04 06:37:51 -07:00
committed by GitHub
parent 012cab80bf
commit 0a2c72c594

View File

@@ -25,7 +25,9 @@ class TaxWithholdingCategory(Document):
def validate_thresholds(self):
for d in self.get("rates"):
if d.cumulative_threshold and d.cumulative_threshold < d.single_threshold:
if (
d.cumulative_threshold and d.single_threshold and d.cumulative_threshold < d.single_threshold
):
frappe.throw(
_("Row #{0}: Cumulative threshold cannot be less than Single Transaction threshold").format(
d.idx