Skip to content

Commit

Permalink
payments: during bank transaction reference matching, trim structured…
Browse files Browse the repository at this point in the history
… creditor reference prefix + check digits when they appear following a word boundary (this includes '*')
  • Loading branch information
jayaddison committed Dec 18, 2023
1 parent ecd94a9 commit c92613b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ def match_payment(self) -> Optional[BankPayment]:

ref = self.payee.upper()

# Trim any ISO11649 creditor reference prefix and check digits from the payee
ref = re.sub(r"\bRF[0-9][0-9]", "", ref)

found = re.findall("[%s]{4}[- ]?[%s]{4}" % (safechars, safechars), ref)
for f in found:
bankref = f.replace("-", "").replace(" ", "")
Expand Down

0 comments on commit c92613b

Please sign in to comment.