File size: 1,529 Bytes
559318d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/casparser/parsers/cams_detailed.py b/casparser/parsers/cams_detailed.py
index 2a7077e..1103ca6 100644
--- a/casparser/parsers/cams_detailed.py
+++ b/casparser/parsers/cams_detailed.py
@@ -371,7 +371,7 @@ def _apply_balance_sign_fix(scheme: Scheme) -> None:
             if t.amount is not None:
                 t.amount = -Decimal(str(t.amount))
             new_type, new_div = get_transaction_type(t.description, flipped_units)
-            t.type = new_type.name
+            t.type = new_type
             t.dividend_rate = new_div
         prev_balance = balance
 
@@ -944,7 +944,7 @@ def parse(
                         txn = current_scheme.transactions[-1]
                         txn.description = f"{txn.description} {tail}"
                         txn_type, dividend_rate = get_transaction_type(txn.description, txn.units)
-                        txn.type = txn_type.name
+                        txn.type = txn_type
                         txn.dividend_rate = dividend_rate
                         if txn_type in (TransactionType.GIFT_IN, TransactionType.GIFT_OUT):
                             txn.gift_folio = extract_gift_folio(txn.description)
@@ -993,7 +993,7 @@ def parse(
                         units=units,
                         nav=nav,
                         balance=bal,
-                        type=txn_type.name,
+                        type=txn_type,
                         dividend_rate=dividend_rate,
                         gift_folio=gift_folio,
                     )