Skip to content

Commit 7d1b44c

Browse files
committed
fix: enhance item-wise tax detail handling and validation in GST transactions
1 parent d5c8bc2 commit 7d1b44c

5 files changed

Lines changed: 255 additions & 209 deletions

File tree

india_compliance/gst_india/overrides/test_transaction.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -670,21 +670,27 @@ def test_invalid_item_wise_tax_details(self):
670670
["CGST", "SGST"],
671671
charge_type="Actual",
672672
tax_amount=9,
673-
item_wise_tax_detail=json.dumps(
674-
{
675-
"_Test Trading Goods 1": {
676-
"tax_rate": 9,
677-
"tax_amount": -9,
678-
"net_amount": -100,
679-
}
680-
}
681-
),
682673
dont_recompute_tax=1,
683674
)
684675

676+
doc._item_wise_tax_details = [
677+
frappe._dict(
678+
{
679+
"item": doc.items[0],
680+
"tax": doc.taxes[0],
681+
"rate": 9,
682+
"amount": -9,
683+
"taxable_amount": -100,
684+
}
685+
)
686+
]
687+
688+
# Validation in ERPNext
685689
self.assertRaisesRegex(
686690
frappe.exceptions.ValidationError,
687-
re.compile(r"^(.*Charge Type is set to Actual. However, Tax Amount.*)$"),
691+
re.compile(
692+
r"^(.*Item Wise Tax Details do not match with Taxes and Charges at the following rows.*)$"
693+
),
688694
doc.save,
689695
)
690696

0 commit comments

Comments
 (0)