little fixes
- logger might be a private attribute - compare rdate to date, not to today
This commit is contained in:
parent
c1bec2e388
commit
06b314de48
1 changed files with 4 additions and 4 deletions
|
|
@ -39,7 +39,7 @@ class FrenchTransaction(Transaction):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
Transaction.__init__(self, *args, **kwargs)
|
Transaction.__init__(self, *args, **kwargs)
|
||||||
self.logger = getLogger('FrenchTransaction')
|
self._logger = getLogger('FrenchTransaction')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def clean_amount(klass, text):
|
def clean_amount(klass, text):
|
||||||
|
|
@ -93,7 +93,7 @@ class FrenchTransaction(Transaction):
|
||||||
elif '/' in date:
|
elif '/' in date:
|
||||||
date = datetime.date(*reversed([int(x) for x in date.split('/')]))
|
date = datetime.date(*reversed([int(x) for x in date.split('/')]))
|
||||||
if not isinstance(date, (datetime.date, datetime.datetime)):
|
if not isinstance(date, (datetime.date, datetime.datetime)):
|
||||||
self.logger.warning('Unable to parse date %r' % date)
|
self._logger.warning('Unable to parse date %r' % date)
|
||||||
date = NotAvailable
|
date = NotAvailable
|
||||||
elif date.year < 100:
|
elif date.year < 100:
|
||||||
date = date.replace(year=2000 + date.year)
|
date = date.replace(year=2000 + date.year)
|
||||||
|
|
@ -134,14 +134,14 @@ class FrenchTransaction(Transaction):
|
||||||
if inargs('yy'):
|
if inargs('yy'):
|
||||||
yy = int(args['yy'])
|
yy = int(args['yy'])
|
||||||
else:
|
else:
|
||||||
d = datetime.date.today()
|
d = self.date
|
||||||
try:
|
try:
|
||||||
d = d.replace(month=mm, day=dd)
|
d = d.replace(month=mm, day=dd)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
d = d.replace(year=d.year-1, month=mm, day=dd)
|
d = d.replace(year=d.year-1, month=mm, day=dd)
|
||||||
|
|
||||||
yy = d.year
|
yy = d.year
|
||||||
if d > datetime.date.today():
|
if d > self.date:
|
||||||
yy -= 1
|
yy -= 1
|
||||||
|
|
||||||
if yy < 100:
|
if yy < 100:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue