Commit 167bc777 authored by Théo Dorée's avatar Théo Dorée Committed by Romain Bignon

[orange] Added price to ID to prevent bills doublons

parent 8b900310
......@@ -44,8 +44,7 @@ class BillsPage(LoggedPage, HTMLPage):
class item(ItemElement):
klass = Bill
def obj_id(self):
return '%s_%s' % (Env('subid')(self), Field('date')(self).strftime('%d%m%Y'))
obj_url = Link('.//td[@headers="ec-downloadCol"]/a', default=NotAvailable)
obj_date = Date(Regexp(CleanText('.//td[@headers="ec-downloadCol"]//span[@class="ec_visually_hidden"]'), 'du (.*) \(PDF\)'), parse_func=parse_french_date, dayfirst=True)
......@@ -62,6 +61,9 @@ class BillsPage(LoggedPage, HTMLPage):
obj_currency = Currency('.//td[@headers="ec-amountCol"]')
def obj_id(self):
return '%s_%s%s' % (Env('subid')(self), Field('date')(self).strftime('%d%m%Y'), Field('price')(self))
def obj_vat(self):
ht = CleanDecimal(CleanText('.//td[@headers="ec-amountCol"]/strong[contains(text(),"HT")]', children=False), replace_dots=True, default=NotAvailable)(self)
if ht is NotAvailable:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment