From 0dce59175627bdaf90d8d0b8540a14968d6627e1 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 8 Feb 2015 23:17:58 +0100 Subject: [PATCH] add new bank fields --- weboob/capabilities/bank.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/weboob/capabilities/bank.py b/weboob/capabilities/bank.py index b58c151c..2e7c3b90 100644 --- a/weboob/capabilities/bank.py +++ b/weboob/capabilities/bank.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2010-2014 Romain Bignon +# Copyright(C) 2010-2015 Romain Bignon # # This file is part of weboob. # @@ -24,7 +24,7 @@ import re from weboob.tools.compat import basestring, long -from .base import BaseObject, Field, StringField, DecimalField, IntField, UserError, Currency +from .base import BaseObject, Field, StringField, DecimalField, IntField, UserError, Currency, NotAvailable from .date import DateField from .collection import CapCollection @@ -91,10 +91,21 @@ class Account(Recipient): type = IntField('Type of account', default=TYPE_UNKNOWN) balance = DecimalField('Balance on this bank account') coming = DecimalField('Coming balance') + + # card attributes paydate = DateField('For credit cards. When next payment is due.') paymin = DecimalField('For credit cards. Minimal payment due.') cardlimit = DecimalField('For credit cards. Credit limit.') + iban = StringField('International Bank Account Number') + + @property + def ban(self): + """ Bank Account Number part of IBAN""" + if not self.iban: + return NotAvailable + return self.iban[4:] + def __repr__(self): return u"" % (self.id, self.label) @@ -124,6 +135,13 @@ class Transaction(BaseObject): label = StringField('Pretty label') amount = DecimalField('Amount of the transaction') + card = StringField('Card number (if any)') + commission = DecimalField('Commission part on the transaction (in account currency)') + + # International + original_amount = DecimalField('Original amount (in another currency)') + original_currency = StringField('Currency of the original amount') + def __repr__(self): return "" % (self.date, self.label, self.amount)