From a1eea6a098a069da701b6be448b876067c68bff8 Mon Sep 17 00:00:00 2001 From: Oleg Plakhotniuk Date: Fri, 6 Mar 2015 06:28:32 -0600 Subject: [PATCH] [amazonstorecard] Show only posted transactions. Closes #1749 --- modules/amazonstorecard/pages.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/amazonstorecard/pages.py b/modules/amazonstorecard/pages.py index f9c308bc..f59995f0 100644 --- a/modules/amazonstorecard/pages.py +++ b/modules/amazonstorecard/pages.py @@ -82,9 +82,13 @@ class RecentPage(XMLPage): 'TRANSDESCRIPTION/text()')[0].split()) tdate = u''.join(ntrans.xpath('TRANSACTIONDATE/text()')) pdate = u''.join(ntrans.xpath('POSTDATE/text()')) + # Skip transactions which are not posted, + # because they are not accounted for in balance calculation. + if not pdate: + continue t = Transaction() t.date = datetime.strptime(tdate, '%m/%d/%Y') - t.rdate = datetime.strptime(pdate or tdate, '%m/%d/%Y') + t.rdate = datetime.strptime(pdate, '%m/%d/%Y') t.type = Transaction.TYPE_UNKNOWN t.raw = desc t.label = desc