hoffie / dkb-visa

DKB transaction download and conversion (CSV, QIF)
GNU Affero General Public License v3.0
56 stars 26 forks source link

valuta_date empty for soll/haben #9

Open inktrap opened 8 years ago

inktrap commented 8 years ago

An entry like the following one has an empty COL_VALUTA_DATE, because it does not show a transaction, only the Soll or Haben (that you currently owe or have). So this should not be one of the transactions.

"Nein";"01.01.2015";"";"Soll";"-00,01";"";

However filtering and matching transactions to accounts should happen later, so I used this simple but ugly fix:

if len(line[self.COL_VALUTA_DATE].strip()) == 0:
    return re.sub('.*?(\d{1,2})\.(\d{1,2})\.(\d{2,4}).*?', r'\2/\1/\3',
        line[self.COL_DATE])
else:
    return re.sub('.*?(\d{1,2})\.(\d{1,2})\.(\d{2,4}).*?', r'\2/\1/\3',
        line[self.COL_VALUTA_DATE])

Otherwise the generated qif-file won't be importabable

hoffie commented 8 years ago

Can you try whether my alternative fix from 947b97e helps?