Browse Source

Remove boring parts of MbankTransaction memos

Alois Mahdal 6 years ago
parent
commit
5559b51e7a
1 changed files with 24 additions and 2 deletions
  1. 24
    2
      gcconv.py

+ 24
- 2
gcconv.py View File

@@ -122,14 +122,36 @@ class MbankTransaction(BaseTransaction):
122 122
         return '-'.join([year, month, day])
123 123
 
124 124
     def _description(self):
125
+        def type_interesting(T):
126
+            boring_types = [
127
+                u'PŘÍCHOZÍ PLATBA Z MBANK',
128
+                u'ODCHOZÍ PLATBA DO MBANK',
129
+                u'PŘÍCHOZÍ PLATBA Z JINÉ BANKY',
130
+                u'ODCHOZÍ PLATBA DO JINÉ BANKY',
131
+                u'PLATBA KARTOU',
132
+            ]
133
+            if not T:
134
+                return False
135
+            if T in boring_types:
136
+                return False
137
+            return True
138
+        def message_interesting(M):
139
+            boring_messages = [
140
+                u'PŘEVOD PROSTŘEDKŮ',
141
+            ]
142
+            if not M:
143
+                return False
144
+            if M in boring_messages:
145
+                return False
146
+            return True
125 147
         type_, message, party, number, ks, vs, ss = self._scrap
126 148
         dpt = u' DATUM PROVEDENÍ TRANSAKCE: '
127 149
         if dpt in message:
128 150
             message, __ = message.split(dpt)
129 151
         out = []
130
-        if type_:
152
+        if type_interesting(type_):
131 153
             out.append(type_)
132
-        if message:
154
+        if message_interesting(message):
133 155
             out.append(message)
134 156
         if party:
135 157
             out.append(party)