clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00303
[Branch ~banking-addons-team/banking-addons/6.1] Rev 140: [IMP] ing: allow for CSV files in both date formats
------------------------------------------------------------
revno: 140
committer: Stefan Rijnhart <stefan@xxxxxxxx>
branch nick: banking-addons
timestamp: Thu 2012-10-04 10:56:19 +0200
message:
[IMP] ing: allow for CSV files in both date formats
modified:
account_banking_nl_ing/__openerp__.py
account_banking_nl_ing/i18n/nl.po
account_banking_nl_ing/ing.py
--
lp:banking-addons
https://code.launchpad.net/~banking-addons-team/banking-addons/6.1
Your team CLEARCORP development team is subscribed to branch lp:banking-addons.
To unsubscribe from this branch go to https://code.launchpad.net/~banking-addons-team/banking-addons/6.1/+edit-subscription
=== modified file 'account_banking_nl_ing/__openerp__.py'
--- account_banking_nl_ing/__openerp__.py 2012-01-31 15:55:27 +0000
+++ account_banking_nl_ing/__openerp__.py 2012-10-04 08:56:19 +0000
@@ -31,9 +31,9 @@
##############################################################################
{
'name': 'ING (NL) Bank Statements Import',
- 'version': '0.1.105',
+ 'version': '0.1.140',
'license': 'GPL-3',
- 'author': 'Smile / Therp BV / EduSense BV',
+ 'author': ['Smile', 'Therp BV', 'EduSense BV'],
'website': 'https://launchpad.net/banking-addons',
'category': 'Banking addons',
'depends': ['account_banking'],
@@ -43,7 +43,7 @@
'demo_xml': [],
'description': '''
Module to import Dutch ING bank format transaction files. The format covered
-is the CSV format with 'ddmmyy' date syntax.
+is the CSV format with either 'dd-mm-yyyy' or 'yyyymmdd' date syntax.
As the ING bank does not provide detailed specification concerning possible
values and their meaning for the fields in the CSV file format, the statements
=== modified file 'account_banking_nl_ing/i18n/nl.po'
--- account_banking_nl_ing/i18n/nl.po 2012-01-31 15:55:27 +0000
+++ account_banking_nl_ing/i18n/nl.po 2012-10-04 08:56:19 +0000
@@ -24,7 +24,7 @@
#: model:ir.module.module,description:account_banking_nl_ing.module_meta_information
msgid "Module to import Dutch ING bank format transaction files. The format covered is the CSV format with 'ddmmyy' date syntax.As the ING bank does not provide detailed specification concerning possiblevalues and their meaning for the fields in the CSV file format, the statementsare parsed according to an educated guess based on incomplete information.You can contact the banking-addons developers through their launchpad page andhelp improve the performance of this import filter onhttps://launchpad.net/banking-addons.Note that imported bank transfers are organized in statements covering periodsof one week, even if the imported files cover a different period.This modules contains no logic, just an import filter for account_banking. "
msgstr "Module voor het importeren van bankafschriften van de Nederlandse ING bank.\n"
-"Bestanden in het CSV-formaat met datumindeling 'ddmmjj' kunnen worden verwerkt.\n\n"
+"Bestanden in het CSV-formaat met datumindeling 'dd-mm-jjjj' of 'jjjjmmdd' kunnen worden verwerkt.\n\n"
"Gezien het feit dat de ING geen enkele vorm van specificaties\n"
"beschikbaar stelt, is de importroutine samengesteld op basis van \n"
"voorbeeldbestanden, en kan volledige dekking niet worden gegarandeerd. U\n"
=== modified file 'account_banking_nl_ing/ing.py'
--- account_banking_nl_ing/ing.py 2012-01-17 08:48:10 +0000
+++ account_banking_nl_ing/ing.py 2012-10-04 08:56:19 +0000
@@ -67,7 +67,10 @@
re.sub(',', '.', self.transferred_amount))
if self.debcred == 'Af':
self.transferred_amount = -self.transferred_amount
- self.execution_date = self.effective_date = str2date(self.date, '%Y%m%d')
+ try:
+ self.execution_date = self.effective_date = str2date(self.date, '%Y%m%d')
+ except ValueError:
+ self.execution_date = self.effective_date = str2date(self.date, '%d-%m-%Y')
self.statement_id = '' #self.effective_date.strftime('%Yw%W')
self.id = str(subno).zfill(4)
self.reference = ''
@@ -178,7 +181,10 @@
super(statement, self).__init__(*args, **kwargs)
self.id = msg.statement_id
self.local_account = msg.local_account
- self.date = str2date(msg.date, '%Y%m%d')
+ try:
+ self.date = str2date(msg.date, '%Y%m%d')
+ except ValueError:
+ self.date = str2date(msg.date, '%d-%m-%Y')
self.start_balance = self.end_balance = 0 # msg.start_balance
self.import_transaction(msg)