Benjamin-eecs's picture
release v1: 65 held-out tasks, 78 bootstrap records, r2e_local adapter, manifest ae94c40b (part 4)
622387b verified
Raw History Blame Contribute Delete
1.57 kB
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,
):