Amazon Store Card module: handle transactions w/o post date properly. Fixes #1701
This commit is contained in:
parent
747adc1251
commit
8b66f74dd0
1 changed files with 4 additions and 4 deletions
|
|
@ -71,11 +71,11 @@ class RecentPage(XMLPage):
|
||||||
for ntrans in reversed(self.doc.xpath('//TRANSACTION')):
|
for ntrans in reversed(self.doc.xpath('//TRANSACTION')):
|
||||||
desc = u' '.join(ntrans.xpath(
|
desc = u' '.join(ntrans.xpath(
|
||||||
'TRANSDESCRIPTION/text()')[0].split())
|
'TRANSDESCRIPTION/text()')[0].split())
|
||||||
|
tdate = u''.join(ntrans.xpath('TRANSACTIONDATE/text()'))
|
||||||
|
pdate = u''.join(ntrans.xpath('POSTDATE/text()'))
|
||||||
t = Transaction()
|
t = Transaction()
|
||||||
t.date = datetime.strptime(ntrans.xpath(
|
t.date = datetime.strptime(tdate, '%m/%d/%Y')
|
||||||
'TRANSACTIONDATE/text()')[0], '%m/%d/%Y')
|
t.rdate = datetime.strptime(pdate or tdate, '%m/%d/%Y')
|
||||||
t.rdate = datetime.strptime(ntrans.xpath(
|
|
||||||
'POSTDATE/text()')[0], '%m/%d/%Y')
|
|
||||||
t.type = Transaction.TYPE_UNKNOWN
|
t.type = Transaction.TYPE_UNKNOWN
|
||||||
t.raw = desc
|
t.raw = desc
|
||||||
t.label = desc
|
t.label = desc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue