Add support for a new Adyen transaction string
authorMagnus Hagander <magnus@hagander.net>
Sun, 16 Sep 2018 19:43:39 +0000 (21:43 +0200)
committerMagnus Hagander <magnus@hagander.net>
Sun, 16 Sep 2018 19:43:39 +0000 (21:43 +0200)
postgresqleu/cmutuel/management/commands/cmscrape.py

index 59878f6ebc5d3264af2bb5c64a1c92742133e3f3..1f074fad77e3d96fd0771e699b9c0e793444ef46 100755 (executable)
@@ -191,7 +191,8 @@ class Command(BaseCommand):
                with transaction.atomic():
                        if CMutuelTransaction.objects.filter(sent=False).exclude(
                                        Q(description__startswith='VIR STG ADYEN ') |
-                                       Q(description__startswith='VIR ADYEN BV ')
+                                       Q(description__startswith='VIR ADYEN BV ') |
+                                       Q(description__startswith='VIR ADYEN NV ')
                        ).exists():
                                sio = cStringIO.StringIO()
                                sio.write("One or more new transactions have been recorded in the Credit Mutuel account:\n\n")
@@ -202,7 +203,7 @@ class Command(BaseCommand):
                                        # Maybe this shouldn't be hardcoded, but for now it is.
                                        # Exclude Adyen transactions, since they are already reported separately.
                                        # Still flag them as sent though, so they don't queue up forever.
-                                       if not (cmt.description.startswith('VIR STG ADYEN ') or cmt.description.startswith('VIR ADYEN BV ')):
+                                       if not (cmt.description.startswith('VIR STG ADYEN ') or cmt.description.startswith('VIR ADYEN BV ') or cmt.description.startswith('VIR ADYEN NV ')):
                                                sio.write("%10s  %15s  %s\n" % (cmt.opdate, cmt.amount, cmt.description))
 
                                        cmt.sent = True