It seems that sometimes cmutuel will show a truncated version of the
transaction in the report for a while, and then later replace it with
the complete text (without any indication that this has been done) in
the reports. When using the manual GUI instead of the reports, these
transactions show up with something like "details are missing", but that
information does not exist in the reports.
Some patterns indicate that this happens when a payment arrives towards
the end of the day, which seems to be common with for example
transferwise transfers. For that reason, attempt to work around it by
delaying processing of all incoming payments until the day after they
arrived, at the hope that this makes the full text appear.
description = row[3]
balance = Decimal(row[4])
+ if opdate.date() == datetime.date.today() and amount > 0 and description.startswith("VIR "):
+ # For incoming transfers we sometimes don't get the full transaction text
+ # right away. Because, reasons unknown. So if the transaction is actually
+ # dated today and it starts with VIR, we ignore it until we get to tomorrow.
+ continue
+
if not CMutuelTransaction.objects.filter(opdate=opdate, valdate=valdate, amount=amount, description=description).exists():
trans = CMutuelTransaction(opdate=opdate,
valdate=valdate,