CSV import: Do not skip rows without a reference

This commit is contained in:
Raphael Michel
2019-04-08 17:55:28 +02:00
parent 36e0afc09e
commit 0f58e1c396
2 changed files with 15 additions and 3 deletions

View File

@@ -28,8 +28,7 @@ def parse(data, hint):
resrow['amount'] = re.sub('[^0-9,+.-]', '', resrow['amount'])
if hint.get('date') is not None:
resrow['date'] = row[int(hint.get('date'))].strip()
if len(resrow['amount']) == 0 or 'amount' not in resrow \
or len(resrow['reference']) == 0 or resrow['date'] == '':
if len(resrow['amount']) == 0 or 'amount' not in resrow or resrow['date'] == '':
# This is probably a headline or something other special.
continue
if resrow['reference'] or resrow['payer']: