File size: 1,571 Bytes
622387b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dd4e67c..043c5f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -89,6 +89,13 @@ parser tuned to their template family.
   positive-units branch of `get_transaction_type`. Acts as a
   self-validating safety net for the entire transaction stream,
   not just the Franklin case.
+- **Failed-SIP `Payment not received` rows** are now classified as
+  `REVERSAL` instead of `REDEMPTION`. These carry negative units (the
+  provisional purchase is being undone) with a correct sign, so the
+  running-balance validator leaves them untouched — only the
+  description keyword distinguishes them, and it was missing from the
+  reversal pattern. Misclassifying them as redemptions injected a
+  phantom capital-gains event into the gains analysis.
 - **Stamp-duty allocation on split lots.** When a single purchase
   lot is consumed across N disposals the `FIFOUnits.sell` re-queue
   carried the *full* original stamp duty on every remaining slice,
diff --git a/casparser/parsers/_classify.py b/casparser/parsers/_classify.py
index 972e11c..c9046ee 100644
--- a/casparser/parsers/_classify.py
+++ b/casparser/parsers/_classify.py
@@ -75,7 +75,8 @@ def get_transaction_type(
             txn_type = TransactionType.PURCHASE
     elif units < 0:
         if re.search(
-            r"reversal|rejection|dishonoured|mismatch|insufficient\s+balance",
+            r"reversal|rejection|dishonoured|mismatch|insufficient\s+balance|"
+            r"payment\s+not\s+received",
             description,
             re.I,
         ):