Skip to content

Commit 132386e

Browse files
Abhishek Jaincodereverser
authored andcommitted
Added separate transaction types for Stamp Duty & STT.
Handled Segregation of Folio transactions
1 parent 5e5b4a5 commit 132386e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

casparser/enums.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class TransactionType(Enum):
2727
SWITCH_IN_MERGER = auto()
2828
SWITCH_OUT = auto()
2929
SWITCH_OUT_MERGER = auto()
30-
TAX = auto()
30+
STT_TAX = auto()
31+
STAMP_DUTY_TAX = auto()
32+
SEGREGATION = auto()
3133
MISC = auto()
3234
UNKNOWN = auto()

casparser/process/cas_detailed.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ def get_transaction_type(
3636
)
3737
elif units is None:
3838
if "stt" in description:
39-
txn_type = TransactionType.TAX
39+
txn_type = TransactionType.STT_TAX
40+
elif "stamp" in description:
41+
txn_type = TransactionType.STAMP_DUTY_TAX
42+
elif ("segregate" in description.lower()) or ("segregation" in description.lower()):
43+
txn_type = TransactionType.SEGREGATION
4044
else:
4145
txn_type = TransactionType.MISC
4246
elif units > 0:
@@ -167,6 +171,11 @@ def process_detailed_text(text):
167171
nav = Decimal(m.group(5).replace(",", "_"))
168172
balance = Decimal(m.group(6).replace(",", "_").replace("(", "-"))
169173
txn_type, dividend_rate = get_transaction_type(desc, units)
174+
if txn_type == TransactionType.SEGREGATION:
175+
units = amt
176+
balance = amt
177+
amt = 0
178+
nav = 0
170179
if units is not None:
171180
curr_scheme_data["close_calculated"] += units
172181
curr_scheme_data["transactions"].append(

0 commit comments

Comments
 (0)