correctly set amount and currency on bills
This commit is contained in:
parent
30f32bea60
commit
5ffa7d19c0
1 changed files with 11 additions and 13 deletions
|
|
@ -22,8 +22,10 @@ from datetime import datetime
|
||||||
import re
|
import re
|
||||||
import urllib
|
import urllib
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
from weboob.deprecated.browser import Page
|
from weboob.deprecated.browser import Page
|
||||||
from weboob.capabilities.bill import Subscription, Detail, Bill
|
from weboob.capabilities.bill import Subscription, Detail, Bill
|
||||||
|
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
|
||||||
|
|
||||||
base_url = "http://particuliers.edf.com/"
|
base_url = "http://particuliers.edf.com/"
|
||||||
|
|
||||||
|
|
@ -109,19 +111,15 @@ class BillsPage(EdfBasePage):
|
||||||
if amount is None:
|
if amount is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Remove SPACE character
|
bill = Bill()
|
||||||
amount = re.sub(u'\xa0', '', amount)
|
bill.id = sub._id + "." + date.strftime("%Y%m%d")
|
||||||
|
bill.price = Decimal(FrenchTransaction.clean_amount(amount))
|
||||||
# Remove euro character
|
bill.currency = bill.get_currency(amount)
|
||||||
amount = re.sub(u'\u20ac', '', amount)
|
bill.date = date
|
||||||
|
bill.label = self.parser.tocleanstring(list_tds[0])
|
||||||
bil = Bill()
|
bill.format = u'pdf'
|
||||||
bil.id = sub._id + "." + date.strftime("%Y%m%d")
|
bill._url = url
|
||||||
bil.date = date
|
yield bill
|
||||||
bil.label = u''+amount.strip()
|
|
||||||
bil.format = u'pdf'
|
|
||||||
bil._url = url
|
|
||||||
yield bil
|
|
||||||
|
|
||||||
def get_bill(self, bill):
|
def get_bill(self, bill):
|
||||||
self.location(bill._url)
|
self.location(bill._url)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue