diff --git a/locale/de.po b/locale/de.po index 27cc0d6..a0e184b 100644 --- a/locale/de.po +++ b/locale/de.po @@ -12,7 +12,7 @@ msgstr "Die folgenden Kategorien werden nun importiert:\n%(categories)s" msgctxt "model:ir.message,text:msg_wiz_transactions_found" msgid "The following transactionen are now imported:\nCredit: %(credit)s\nDebit: %(debit)s\nBalance: %(balance)s\nNumber of transactions: %(quantity)s" -msgstr "Die folgenden Transaktionen werden nun importiert:\nEinnahmen: %(credit)s\Ausgaben: %(debit)s\nSaldo: %(balance)s\nAnzahl Transactionen: %(quantity)s" +msgstr "Die folgenden Transaktionen werden nun importiert:\nEinnahmen: %(credit)s\nAusgaben: %(debit)s\nSaldo: %(balance)s\nAnzahl Transactionen: %(quantity)s" msgctxt "model:ir.message,text:msg_wiz_parties_found" msgid "The following %(numparties)s parties are now imported:" @@ -70,6 +70,14 @@ msgctxt "model:ir.message,text:mds_import_book_notfound" msgid "The cashbook '%(bookname)s' was not found." msgstr "Das Kassenbuch '%(bookname)s' wurde nicht gefunden." +msgctxt "model:ir.message,text:mds_import_category_not_match" +msgid "The category '%(catname)s' of the split booking does not match the bookingtype '%(bktype)s' (data: '%(data)s')" +msgstr "Die Kategorie '%(catname)s' der Splitbuchung paßt nicht zum Buchungstyp '%(bktype)s' (Daten: '%(data)s')" + +msgctxt "model:ir.message,text:msg_ignore_null_booking" +msgid "Ignore empty booking, no category, amount zero: %(trinfo)s" +msgstr "Ignoriere leere Buchung, keine Kategorie, Betrag Null: %(trinfo)s" + ############# # ir.action # diff --git a/message.xml b/message.xml index d2d7b3f..217c4ae 100644 --- a/message.xml +++ b/message.xml @@ -53,6 +53,13 @@ full copyright notices and license terms. --> No cashbook has been assigned for transaction '%(trdata)s'. + + The category '%(catname)s' of the split booking does not match the bookingtype '%(bktype)s' (data: '%(data)s') + + + Ignore empty booking, no category, amount zero: %(trinfo)s + + diff --git a/qiftool.py b/qiftool.py index af26f75..a31507a 100644 --- a/qiftool.py +++ b/qiftool.py @@ -441,6 +441,24 @@ class QifTool(Model): if cls.check_counter_transaction(transaction, line) == True: # counter-transaction already exists continue + else : + # transaction: no category, no account - ignore? + if line.get('amount', Decimal('0.0')) == Decimal('0.0'): + # no amount --> ignore! + tr_info = {'trdate': '-', 'amount':'-'} + if 'date' in transaction.keys(): + tr_info['trdate'] = Report.format_date(transaction['date'], None) + if 'amount' in transaction.keys(): + tr_info['amount'] = Report.format_currency( + transaction['amount'], + None, + book.currency) + tr_info['descr'] = transaction.get('description', '-') + msg_list.append(gettext( + 'cashbook_dataexchange.msg_ignore_null_booking', + trinfo = '%(trdate)s, %(amount)s, %(descr)s' % tr_info, + )) + continue # party if 'party' in transaction.keys(): @@ -470,6 +488,17 @@ class QifTool(Model): msg_list.append(msg_txt) if cat_obj is not None: + # category match to bookingtype? + if ((cat_obj.cattype == 'in') and line['bookingtype'].endswith('out')) or\ + ((cat_obj.cattype == 'out') and line['bookingtype'].endswith('in')): + msg_list.append(gettext( + 'cashbook_dataexchange.mds_import_category_not_match', + catname = '%s [%s]' % (cat_obj.rec_name, cat_obj.cattype), + bktype = line['bookingtype'], + data = str(transaction), + )) + fail_cnt += 1 + split_lines.append({ 'amount': sp_line['amount'] \ if line['bookingtype'] in ['in', 'spin'] else sp_line['amount'].copy_negate(),