first commit
This commit is contained in:
2
modules/account_statement_mt940/__init__.py
Normal file
2
modules/account_statement_mt940/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
Binary file not shown.
Binary file not shown.
131
modules/account_statement_mt940/account.py
Normal file
131
modules/account_statement_mt940/account.py
Normal file
@@ -0,0 +1,131 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from io import BytesIO, TextIOWrapper
|
||||
|
||||
from mt940 import (
|
||||
MT940, abn_amro_description, ing_description, regiobank_description)
|
||||
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import fields
|
||||
from trytond.modules.account_statement.exceptions import ImportStatementError
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
|
||||
|
||||
class StatementImportStart(metaclass=PoolMeta):
|
||||
__name__ = 'account.statement.import.start'
|
||||
|
||||
mt940_bank = fields.Selection([
|
||||
(None, ""),
|
||||
('rabo', "Rabo"),
|
||||
('abn_amro', "ABN AMRO"),
|
||||
('ing', "ING"),
|
||||
('regiobank', "RegioBank"),
|
||||
], "Bank",
|
||||
states={
|
||||
'invisible': Eval('file_format') != 'mt940',
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super().__setup__()
|
||||
cls.file_format.selection.append(('mt940', "MT940"))
|
||||
|
||||
|
||||
class StatementImport(metaclass=PoolMeta):
|
||||
__name__ = 'account.statement.import'
|
||||
|
||||
def parse_mt940(self, encoding=None):
|
||||
file_ = TextIOWrapper(BytesIO(self.start.file_), encoding=encoding)
|
||||
mt940 = MT940(file_)
|
||||
for mt940_statement in mt940.statements:
|
||||
statement = self.mt940_statement(mt940_statement)
|
||||
origins = []
|
||||
for transaction in mt940_statement.transactions:
|
||||
origins.extend(self.mt940_origin(mt940_statement, transaction))
|
||||
statement.origins = origins
|
||||
yield statement
|
||||
|
||||
def mt940_statement(self, mt940_statement):
|
||||
pool = Pool()
|
||||
Statement = pool.get('account.statement')
|
||||
Journal = pool.get('account.statement.journal')
|
||||
|
||||
statement = Statement()
|
||||
statement.name = mt940_statement.information
|
||||
statement.company = self.start.company
|
||||
account, currency = (
|
||||
self.mt940_statement_account_currency(mt940_statement))
|
||||
start_balance = mt940_statement.start_balance
|
||||
end_balance = mt940_statement.end_balance
|
||||
statement.journal = Journal.get_by_bank_account(
|
||||
statement.company, account,
|
||||
currency=currency or start_balance.currency)
|
||||
if not statement.journal:
|
||||
raise ImportStatementError(
|
||||
gettext('account_statement.msg_import_no_journal',
|
||||
account=mt940_statement.account))
|
||||
statement.date = end_balance.date
|
||||
statement.start_balance = start_balance.amount
|
||||
statement.end_balance = end_balance.amount
|
||||
statement.total_amount = (
|
||||
end_balance.amount - start_balance.amount)
|
||||
statement.number_of_lines = len(mt940_statement.transactions)
|
||||
return statement
|
||||
|
||||
def mt940_statement_account_currency(self, mt940_statement):
|
||||
if self.start.mt940_bank == 'rabo':
|
||||
return mt940_statement.account.split(' ', 1)
|
||||
return mt940_statement.account, None
|
||||
|
||||
def mt940_origin(self, mt940_statement, transaction):
|
||||
pool = Pool()
|
||||
Origin = pool.get('account.statement.origin')
|
||||
|
||||
origin = Origin()
|
||||
origin.number = transaction.id
|
||||
origin.date = transaction.date
|
||||
origin.amount = transaction.amount
|
||||
origin.party = self.mt940_party(mt940_statement, transaction)
|
||||
origin.description = ''.join(transaction.description.splitlines())
|
||||
origin.information = self.mt940_information(
|
||||
mt940_statement, transaction)
|
||||
return [origin]
|
||||
|
||||
def mt940_party(self, mt940_statement, transaction):
|
||||
pool = Pool()
|
||||
AccountNumber = pool.get('bank.account.number')
|
||||
|
||||
account = self.mt940_account(mt940_statement, transaction)
|
||||
if account:
|
||||
numbers = AccountNumber.search(['OR',
|
||||
('number', '=', account),
|
||||
('number_compact', '=', account),
|
||||
])
|
||||
if len(numbers) == 1:
|
||||
number, = numbers
|
||||
if number.account.owners:
|
||||
return number.account.owners[0]
|
||||
|
||||
def mt940_account(self, mt940_statement, transaction):
|
||||
if self.start.mt940_bank == 'abn_amro':
|
||||
description = abn_amro_description(transaction.description)
|
||||
return description.get('account')
|
||||
elif self.start.mt940_bank == 'ing':
|
||||
description = ing_description(transaction.description)
|
||||
return description.get('cntp', {}).get('account_number')
|
||||
elif self.start.mt940_bank == 'regiobank':
|
||||
description = regiobank_description(transaction.description)
|
||||
return description.get('account')
|
||||
|
||||
def mt940_information(self, mt940_statement, transaction):
|
||||
information = {}
|
||||
for name in [
|
||||
'reference',
|
||||
'institution_reference',
|
||||
'additional_data']:
|
||||
value = getattr(transaction, name)
|
||||
if value:
|
||||
information['mt940_' + name] = value
|
||||
return information
|
||||
28
modules/account_statement_mt940/account.xml
Normal file
28
modules/account_statement_mt940/account.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="statement_import_start_view_form">
|
||||
<field name="model">account.statement.import.start</field>
|
||||
<field name="inherit" ref="account_statement.statement_import_start_view_form"/>
|
||||
<field name="name">statement_import_start_form</field>
|
||||
</record>
|
||||
|
||||
<record model="account.statement.origin.information" id="information_reference">
|
||||
<field name="name">mt940_reference</field>
|
||||
<field name="string">Reference</field>
|
||||
<field name="type_">char</field>
|
||||
</record>
|
||||
<record model="account.statement.origin.information" id="information_institution_reference">
|
||||
<field name="name">mt940_institution_reference</field>
|
||||
<field name="string">Institution Reference</field>
|
||||
<field name="type_">char</field>
|
||||
</record>
|
||||
<record model="account.statement.origin.information" id="information_additional_data">
|
||||
<field name="name">mt940_additional_data</field>
|
||||
<field name="string">Additional Data</field>
|
||||
<field name="type_">char</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
38
modules/account_statement_mt940/locale/bg.po
Normal file
38
modules/account_statement_mt940/locale/bg.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
39
modules/account_statement_mt940/locale/ca.po
Normal file
39
modules/account_statement_mt940/locale/ca.po
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr "Banc"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr "Informació adicional"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr "Referencia institucional"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr "Referència"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr "ABN AMRO"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr "ING"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr "Rabo"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr "RegioBank"
|
||||
38
modules/account_statement_mt940/locale/cs.po
Normal file
38
modules/account_statement_mt940/locale/cs.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/de.po
Normal file
38
modules/account_statement_mt940/locale/de.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr "Bank"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr "Zusatzinformationen"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr "Referenz Kontoführendes Institut"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr "Referenz"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr "ABN AMRO"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr "ING"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr "Rabo"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr "RegioBank"
|
||||
39
modules/account_statement_mt940/locale/es.po
Normal file
39
modules/account_statement_mt940/locale/es.po
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr "Banco"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr "Información adicional"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr "Referencia institucional"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr "Referencia"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr "ABN AMRO"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr "ING"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr "Rabo"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr "RegioBank"
|
||||
38
modules/account_statement_mt940/locale/es_419.po
Normal file
38
modules/account_statement_mt940/locale/es_419.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/et.po
Normal file
38
modules/account_statement_mt940/locale/et.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/fa.po
Normal file
38
modules/account_statement_mt940/locale/fa.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/fi.po
Normal file
38
modules/account_statement_mt940/locale/fi.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
39
modules/account_statement_mt940/locale/fr.po
Normal file
39
modules/account_statement_mt940/locale/fr.po
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr "Banque"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr "Donnée supplémentaire"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr "Référence de l'institution"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr "Référence"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr "ABN AMRO"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr "ING"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr "Rabo"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr "RegioBank"
|
||||
38
modules/account_statement_mt940/locale/hu.po
Normal file
38
modules/account_statement_mt940/locale/hu.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/id.po
Normal file
38
modules/account_statement_mt940/locale/id.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/it.po
Normal file
38
modules/account_statement_mt940/locale/it.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/lo.po
Normal file
38
modules/account_statement_mt940/locale/lo.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/lt.po
Normal file
38
modules/account_statement_mt940/locale/lt.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
39
modules/account_statement_mt940/locale/nl.po
Normal file
39
modules/account_statement_mt940/locale/nl.po
Normal file
@@ -0,0 +1,39 @@
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr "Bank"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr "Aanvullende gegevens"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr "Instellingsreferentie"
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr "Referentie"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr "ABN AMRO"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr "ING"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr "Rabo"
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr "RegioBank"
|
||||
38
modules/account_statement_mt940/locale/pl.po
Normal file
38
modules/account_statement_mt940/locale/pl.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/pt.po
Normal file
38
modules/account_statement_mt940/locale/pt.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/ro.po
Normal file
38
modules/account_statement_mt940/locale/ro.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/ru.po
Normal file
38
modules/account_statement_mt940/locale/ru.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/sl.po
Normal file
38
modules/account_statement_mt940/locale/sl.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/tr.po
Normal file
38
modules/account_statement_mt940/locale/tr.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/uk.po
Normal file
38
modules/account_statement_mt940/locale/uk.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
38
modules/account_statement_mt940/locale/zh_CN.po
Normal file
38
modules/account_statement_mt940/locale/zh_CN.po
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||
|
||||
msgctxt "field:account.statement.import.start,mt940_bank:"
|
||||
msgid "Bank"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_additional_data"
|
||||
msgid "Additional Data"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_institution_reference"
|
||||
msgid "Institution Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt ""
|
||||
"model:account.statement.origin.information,string:information_reference"
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ABN AMRO"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "ING"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "Rabo"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "selection:account.statement.import.start,mt940_bank:"
|
||||
msgid "RegioBank"
|
||||
msgstr ""
|
||||
8
modules/account_statement_mt940/tests/MT940.txt
Normal file
8
modules/account_statement_mt940/tests/MT940.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
:20:20190731
|
||||
:25:1234567890
|
||||
:28C:001
|
||||
:60F:D190731EUR0,00
|
||||
:61:1907310731CP100,00FFPC913000381
|
||||
:86:98.76.54.321 John Doe
|
||||
:62F:C190731EUR100,00
|
||||
:64:C190731EUR100,00
|
||||
2
modules/account_statement_mt940/tests/__init__.py
Normal file
2
modules/account_statement_mt940/tests/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,116 @@
|
||||
================================
|
||||
Account Statement MT940 Scenario
|
||||
================================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> from functools import partial
|
||||
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.modules.account.tests.tools import create_chart, get_accounts
|
||||
>>> from trytond.modules.company.tests.tools import create_company, get_company
|
||||
>>> from trytond.tests.tools import activate_modules, assertEqual
|
||||
>>> from trytond.tools import file_open
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules(
|
||||
... 'account_statement_mt940',
|
||||
... partial(create_company, currency='EUR'), create_chart)
|
||||
|
||||
>>> AccountJournal = Model.get('account.journal')
|
||||
>>> Bank = Model.get('bank')
|
||||
>>> BankAccount = Model.get('bank.account')
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> Statement = Model.get('account.statement')
|
||||
>>> StatementJournal = Model.get('account.statement.journal')
|
||||
|
||||
Get company::
|
||||
|
||||
>>> company = get_company()
|
||||
|
||||
Get accounts::
|
||||
|
||||
>>> accounts = get_accounts(company)
|
||||
|
||||
Create parties::
|
||||
|
||||
>>> customer = Party(name="Customer")
|
||||
>>> customer.save()
|
||||
>>> bank_party = Party(name="Bank")
|
||||
>>> bank_party.save()
|
||||
|
||||
Create Bank Accounts::
|
||||
|
||||
>>> bank = Bank()
|
||||
>>> bank.party = bank_party
|
||||
>>> bank.save()
|
||||
|
||||
>>> bank_account = BankAccount()
|
||||
>>> bank_account.bank = bank
|
||||
>>> bank_account.owners.append(Party(customer.id))
|
||||
>>> bank_account.currency = company.currency
|
||||
>>> bank_account_number = bank_account.numbers.new()
|
||||
>>> bank_account_number.type = 'other'
|
||||
>>> bank_account_number.number = '987654321'
|
||||
>>> bank_account.save()
|
||||
|
||||
>>> bank_account = BankAccount()
|
||||
>>> bank_account.bank = bank
|
||||
>>> bank_account.owners.append(Party(company.party.id))
|
||||
>>> bank_account.currency = company.currency
|
||||
>>> bank_account_number = bank_account.numbers.new()
|
||||
>>> bank_account_number.type = 'other'
|
||||
>>> bank_account_number.number = '1234567890'
|
||||
>>> bank_account.save()
|
||||
|
||||
Create Statement Journal::
|
||||
|
||||
>>> account_journal, = AccountJournal.find([('code', '=', 'STA')], limit=1)
|
||||
>>> journal = StatementJournal(
|
||||
... name="Bank",
|
||||
... journal=account_journal,
|
||||
... account=accounts['cash'],
|
||||
... bank_account=bank_account,
|
||||
... )
|
||||
>>> journal.save()
|
||||
|
||||
Import MT940 file::
|
||||
|
||||
>>> statement_import = Wizard('account.statement.import')
|
||||
>>> with file_open('account_statement_mt940/tests/MT940.txt', mode='rb') as fp:
|
||||
... mt940 = fp.read()
|
||||
>>> statement_import.form.file_ = mt940
|
||||
>>> statement_import.form.file_format = 'mt940'
|
||||
>>> statement_import.form.mt940_bank = 'abn_amro'
|
||||
>>> statement_import.execute('import_')
|
||||
|
||||
Check Statement::
|
||||
|
||||
>>> statement, = Statement.find([])
|
||||
>>> statement.name
|
||||
'001'
|
||||
>>> statement.date
|
||||
datetime.date(2019, 7, 31)
|
||||
>>> statement.start_balance
|
||||
Decimal('0.00')
|
||||
>>> statement.end_balance
|
||||
Decimal('100.00')
|
||||
>>> statement.total_amount
|
||||
Decimal('100.00')
|
||||
>>> statement.number_of_lines
|
||||
1
|
||||
>>> len(statement.origins)
|
||||
1
|
||||
>>> origin, = statement.origins
|
||||
>>> origin.number
|
||||
'FFPC'
|
||||
>>> origin.date
|
||||
datetime.date(2019, 7, 31)
|
||||
>>> origin.amount
|
||||
Decimal('100.00')
|
||||
>>> assertEqual(origin.party, customer)
|
||||
>>> origin.description
|
||||
'98.76.54.321 John Doe'
|
||||
>>> origin.information['mt940_reference']
|
||||
'913000381'
|
||||
11
modules/account_statement_mt940/tests/test_module.py
Normal file
11
modules/account_statement_mt940/tests/test_module.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class AccountStatementMt940TestCase(ModuleTestCase):
|
||||
"Test Account Statement Mt940 module"
|
||||
module = 'account_statement_mt940'
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
8
modules/account_statement_mt940/tests/test_scenario.py
Normal file
8
modules/account_statement_mt940/tests/test_scenario.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import load_doc_tests
|
||||
|
||||
|
||||
def load_tests(*args, **kwargs):
|
||||
return load_doc_tests(__name__, __file__, *args, **kwargs)
|
||||
14
modules/account_statement_mt940/tryton.cfg
Normal file
14
modules/account_statement_mt940/tryton.cfg
Normal file
@@ -0,0 +1,14 @@
|
||||
[tryton]
|
||||
version=7.8.0
|
||||
depends:
|
||||
account_statement
|
||||
bank
|
||||
ir
|
||||
xml:
|
||||
account.xml
|
||||
|
||||
[register]
|
||||
model:
|
||||
account.StatementImportStart
|
||||
wizard:
|
||||
account.StatementImport
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="//field[@name='file_format']" position="after">
|
||||
<label name="mt940_bank"/>
|
||||
<field name="mt940_bank"/>
|
||||
<newline/>
|
||||
</xpath>
|
||||
</data>
|
||||
Reference in New Issue
Block a user