transaktion: import korrigiert
This commit is contained in:
parent
833f49c9a6
commit
35a31cff69
4 changed files with 13 additions and 8 deletions
|
@ -11,8 +11,8 @@ msgid "The following categories are now imported:\n%(categories)s"
|
||||||
msgstr "Die folgenden Kategorien werden nun importiert:\n%(categories)s"
|
msgstr "Die folgenden Kategorien werden nun importiert:\n%(categories)s"
|
||||||
|
|
||||||
msgctxt "model:ir.message,text:msg_wiz_transactions_found"
|
msgctxt "model:ir.message,text:msg_wiz_transactions_found"
|
||||||
msgid "The following transactionen are now imported:\nBalance: %(balance)s\nNumber of transactions: %(quantity)s"
|
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:\nSaldo: %(balance)s\nAnzahl Transactionen: %(quantity)s"
|
msgstr "Die folgenden Transaktionen werden nun importiert:\nEinnahmen: %(credit)s\Ausgaben: %(debit)s\nSaldo: %(balance)s\nAnzahl Transactionen: %(quantity)s"
|
||||||
|
|
||||||
msgctxt "model:ir.message,text:msg_wiz_parties_found"
|
msgctxt "model:ir.message,text:msg_wiz_parties_found"
|
||||||
msgid "The following %(numparties)s parties are now imported:"
|
msgid "The following %(numparties)s parties are now imported:"
|
||||||
|
@ -88,7 +88,7 @@ msgstr "Abbruch"
|
||||||
|
|
||||||
msgctxt "wizard_button:cashbook_dataexchange.qif_imp_wiz,showinfo,importf:"
|
msgctxt "wizard_button:cashbook_dataexchange.qif_imp_wiz,showinfo,importf:"
|
||||||
msgid "Import Data"
|
msgid "Import Data"
|
||||||
msgstr "Daten Kategorien"
|
msgstr "Daten importieren"
|
||||||
|
|
||||||
|
|
||||||
###########################################
|
###########################################
|
||||||
|
|
|
@ -18,7 +18,7 @@ full copyright notices and license terms. -->
|
||||||
<field name="text">The following %(numparties)s parties are now imported:</field>
|
<field name="text">The following %(numparties)s parties are now imported:</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.message" id="msg_wiz_transactions_found">
|
<record model="ir.message" id="msg_wiz_transactions_found">
|
||||||
<field name="text">The following transactionen are now imported:\nBalance: %(balance)s\nNumber of transactions: %(quantity)s</field>
|
<field name="text">The following transactionen are now imported:\nCredit: %(credit)s\nDebit: %(debit)s\nBalance: %(balance)s\nNumber of transactions: %(quantity)s</field>
|
||||||
</record>
|
</record>
|
||||||
<record model="ir.message" id="msg_wiz_transactions_error">
|
<record model="ir.message" id="msg_wiz_transactions_error">
|
||||||
<field name="text">When reading the QIF file, there were the following problems:</field>
|
<field name="text">When reading the QIF file, there were the following problems:</field>
|
||||||
|
|
|
@ -203,16 +203,18 @@ class ImportQifWizard(Wizard):
|
||||||
|
|
||||||
# count
|
# count
|
||||||
if fail_cnt == 0:
|
if fail_cnt == 0:
|
||||||
balance = sum([
|
debit = sum([x['amount'] for x in to_create if x['bookingtype']=='out'])
|
||||||
x['amount'] \
|
credit = sum([x['amount'] for x in to_create if x['bookingtype']=='in'])
|
||||||
if x['bookingtype'] in ['in', 'spin'] else x['amount'].copy_sign(Decimal('-1.0')) \
|
balance = credit - debit
|
||||||
for x in to_create])
|
|
||||||
if len(msg_list) > 0:
|
if len(msg_list) > 0:
|
||||||
msg_list.append('')
|
msg_list.append('')
|
||||||
info_lst.append(gettext(
|
info_lst.append(gettext(
|
||||||
'cashbook_dataexchange.msg_wiz_transactions_found',
|
'cashbook_dataexchange.msg_wiz_transactions_found',
|
||||||
quantity = len(to_create),
|
quantity = len(to_create),
|
||||||
balance = Report.format_currency(balance, None, self.start.book.currency),
|
balance = Report.format_currency(balance, None, self.start.book.currency),
|
||||||
|
credit = Report.format_currency(credit, None, self.start.book.currency),
|
||||||
|
debit = Report.format_currency(debit, None, self.start.book.currency),
|
||||||
))
|
))
|
||||||
self.showinfo.allowimport = True
|
self.showinfo.allowimport = True
|
||||||
else :
|
else :
|
||||||
|
|
|
@ -288,6 +288,7 @@ class QifTool(Model):
|
||||||
(cat_id, msg_txt) = cls.get_category_by_name(cat_name, cat_type)
|
(cat_id, msg_txt) = cls.get_category_by_name(cat_name, cat_type)
|
||||||
if cat_id is None:
|
if cat_id is None:
|
||||||
msg_list.append(msg_txt)
|
msg_list.append(msg_txt)
|
||||||
|
fail_cnt += 1
|
||||||
continue
|
continue
|
||||||
else :
|
else :
|
||||||
line['category'] = cat_id
|
line['category'] = cat_id
|
||||||
|
@ -317,6 +318,8 @@ class QifTool(Model):
|
||||||
'description': sp_line.get('description', None),
|
'description': sp_line.get('description', None),
|
||||||
'category': cat_id,
|
'category': cat_id,
|
||||||
})
|
})
|
||||||
|
else :
|
||||||
|
fail_cnt += 1
|
||||||
if len(split_lines) > 0:
|
if len(split_lines) > 0:
|
||||||
line['splitlines'] = [('create', split_lines)]
|
line['splitlines'] = [('create', split_lines)]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue