Skip to content

Commit fd9c6b0

Browse files
Ganesh Subramaniancodereverser
authored andcommitted
feat: Added support for categorizing the TDS
1 parent 9b09faf commit fd9c6b0

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Notes:
107107
- `DIVIDEND_REINVESTMENT`
108108
- `SEGREGATION`
109109
- `STAMP_DUTY_TAX`
110+
- `TDS_TAX`
110111
- `STT_TAX`
111112
- `MISC`
112113
- `dividend_rate` is applicable only for `DIVIDEND_PAYOUT` and

casparser/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class TransactionType(str, AutoEnum):
4040
SWITCH_OUT_MERGER = auto()
4141
STT_TAX = auto()
4242
STAMP_DUTY_TAX = auto()
43+
TDS_TAX = auto()
4344
SEGREGATION = auto()
4445
MISC = auto()
4546
UNKNOWN = auto()

casparser/process/cas_detailed.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def get_transaction_type(
4343
txn_type = TransactionType.STAMP_DUTY_TAX
4444
elif "segregat" in description:
4545
txn_type = TransactionType.SEGREGATION
46+
elif "tds" in description:
47+
txn_type = TransactionType.TDS_TAX
4648
else:
4749
txn_type = TransactionType.MISC
4850
elif units > 0:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ target-version = ['py38']
4747

4848
[tool.pytest.ini_options]
4949
minversion = "6.0"
50-
addopts = "--cov=casparser --cov-report=xml --cov-report=html"
50+
#addopts = "--cov=casparser --cov-report=xml --cov-report=html"
5151
testpaths = [
5252
"tests",
5353
]

tests/test_process.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_transaction_type(self):
4646
TransactionType.STAMP_DUTY_TAX,
4747
None,
4848
)
49+
assert get_transaction_type("*** TDS on Above ***", None) == (TransactionType.TDS_TAX, None)
4950
assert get_transaction_type("Creation of units - Segregated portfolio", None) == (
5051
TransactionType.SEGREGATION,
5152
None,

0 commit comments

Comments
 (0)