예제 #1
0
파일: browser.py 프로젝트: linura/weboob
 def payments(self):
     method = self.doc.xpath('//div[@class="creditCard"]/text()')[0]
     pmt = Payment()
     pmt.date = self.order_date()
     pmt.method = cleanup(method)
     pmt.amount = self.total()
     yield pmt
예제 #2
0
파일: browser.py 프로젝트: laurentb/weboob
 def payments(self):
     # There's no payment information on Ideel, so we'll make one up.
     p = Payment()
     p.date = self.order_date()
     p.method = u'DEFAULT PAYMENT'
     p.amount = self.total()
     yield p
예제 #3
0
파일: browser.py 프로젝트: linura/weboob
 def payments(self):
     # There's no payment information on Ideel, so we'll make one up.
     p = Payment()
     p.date = self.order_date()
     p.method = u'DEFAULT PAYMENT'
     p.amount = self.total()
     yield p
예제 #4
0
 def payments(self):
     for tr in self.doc.xpath(
             '//tbody[@class="payment-summary"]'
             '//th[text()="Payment Summary"]/../../../tbody/tr'):
         method = tr.xpath('td[1]/text()')[0]
         amnode = tr.xpath('td[2]')[0]
         amsign = -1 if amnode.xpath('em') else 1
         amount = amnode.text_content().strip()
         pmt = Payment()
         pmt.date = self.order_date()
         pmt.method = unicode(method)
         pmt.amount = amsign * AmTr.decimal_amount(amount)
         yield pmt
예제 #5
0
파일: browser.py 프로젝트: P4ncake/weboob
 def payments(self):
     for tr in self.doc.xpath('//tbody[@class="payment-summary"]'
                     '//th[text()="Payment Summary"]/../../../tbody/tr'):
         method = tr.xpath('td[1]/text()')[0]
         amnode = tr.xpath('td[2]')[0]
         amsign = -1 if amnode.xpath('em') else 1
         amount = amnode.text_content().strip()
         pmt = Payment()
         pmt.date = self.order_date()
         pmt.method = unicode(method)
         pmt.amount = amsign * AmTr.decimal_amount(amount)
         if pmt.method not in [u'Funds to be applied on backorder']:
             yield pmt
예제 #6
0
 def transactions(self):
     # TODO : French translation
     for tr in self.doc.xpath(u'//div[contains(b,"Credit Card transactions")]' u"/following-sibling::table[1]/tr"):
         label, date = tr.xpath("td[1]/text()")[0].strip().split(u"\xa0")
         amount = tr.xpath("td[2]/text()")[0].strip()
         date = datetime.strptime(date, "%B %d, %Y:")
         method = label.replace(u"ending in ", u"")[:-1].upper()
         amount = self.decimal_amount(amount)
         pmt = Payment()
         pmt.date = date
         pmt.method = method
         pmt.amount = amount
         yield pmt
예제 #7
0
 def transactions(self):
     for tr in self.doc.xpath(
             u'//div[contains(b,"Credit Card transactions")]'
             u'/following-sibling::table[1]/tr'):
         label, date = tr.xpath('td[1]/text()')[0].strip().split(u'\xa0')
         amount = tr.xpath('td[2]/text()')[0].strip()
         date = datetime.strptime(date, '%B %d, %Y:')
         method = label.replace(u'ending in ', u'')[:-1].upper()
         amount = AmTr.decimal_amount(amount)
         pmt = Payment()
         pmt.date = date
         pmt.method = method
         pmt.amount = amount
         yield pmt
예제 #8
0
파일: pages.py 프로젝트: dermorz/weboob
 def transactions(self):
     for tr in self.doc.xpath(
             u'//div[contains(b,"Credit Card transactions")]'
             u'/following-sibling::table[1]/tr'):
         label, date = tr.xpath('td[1]/text()')[0].strip().split(u'\xa0')
         amount = tr.xpath('td[2]/text()')[0].strip()
         date = datetime.strptime(date, '%B %d, %Y:')
         method = label.replace(u'ending in ', u'')[:-1].upper()
         amount = AmTr.decimal_amount(amount)
         pmt = Payment()
         pmt.date = date
         pmt.method = method
         pmt.amount = amount
         yield pmt
예제 #9
0
 def transactions(self):
     for row in self.doc.xpath('//span[contains(text(),"Transactions")]' "/../../div/div"):
         text = row.text_content().strip().replace("\n", " ")
         if u"Expédition" not in text:
             continue
         date, method, amount = re.match(
             ".* " "([0-9]+ [^ ]+ [0-9]+)" "[ -]+" "([A-z][^:]+)" ": +" "(EUR [^ ]+)", text
         ).groups()
         date = datetime.strptime(self.month_to_int(date), "%d %m %Y")
         method = method.replace(u"finissant par ", u"").upper()
         amount = self.decimal_amount(amount)
         pmt = Payment()
         pmt.date = date
         pmt.method = method
         pmt.amount = amount
         yield pmt
예제 #10
0
파일: pages.py 프로젝트: ngrislain/weboob
 def transactions(self):
     for row in self.doc.xpath('//span[contains(text(),"Transactions")]'
                               '/../../div/div'):
         text = row.text_content().strip().replace('\n', ' ')
         if u'Expédition' not in text:
             continue
         date, method, amount = re.match(
             '.* '     '([0-9]+ [^ ]+ [0-9]+)'
             '[ -]+'   '([A-z][^:]+)'
             ': +'     '(EUR [^ ]+)', text).groups()
         date = datetime.strptime(self.month_to_int(date), '%d %m %Y')
         method = method.replace(u'finissant par ', u'').upper()
         amount = self.decimal_amount(amount)
         pmt = Payment()
         pmt.date = date
         pmt.method = method
         pmt.amount = amount
         yield pmt
예제 #11
0
파일: pages.py 프로젝트: h4wkmoon/weboob
 def transactions(self):
     for row in self.doc.xpath('//span[contains(text(),"Transactions")]'
                               '/../../div/div'):
         text = row.text_content().strip().replace('\n', ' ')
         if u'Expédition' not in text:
             continue
         date, method, amount = re.match(
             '.* '     '([0-9]+ [^ ]+ [0-9]+)'
             '[ -]+'   '([A-z][^:]+)'
             ': +'     '(EUR [^ ]+)', text).groups()
         date = datetime.strptime(self.month_to_int(date), '%d %m %Y')
         method = method.replace(u'finissant par ', u'').upper()
         amount = self.decimal_amount(amount)
         pmt = Payment()
         pmt.date = date
         pmt.method = method
         pmt.amount = amount
         yield pmt
예제 #12
0
 def transactions(self):
     for row in self.doc.xpath('//span[contains(text(),"Transactions")]'
                               '/../../div/div'):
         text = row.text_content().strip().replace('\n', ' ')
         if u'Items shipped:' not in text:
             continue
         date, method, amount = re.match(
             '.* '     '([A-z]+ [0-9]+, [0-9]+)'
             '[ -]+'   '([A-z][^:]+)'
             ': +'     '([^ ]+)', text).groups()
         date = datetime.strptime(date, '%B %d, %Y')
         method = method.replace(u'ending in ', u'').upper()
         amount = AmTr.decimal_amount(amount)
         pmt = Payment()
         pmt.date = date
         pmt.method = method
         pmt.amount = amount
         yield pmt
예제 #13
0
 def payments(self):
     if self.gift():
         pmt = Payment()
         pmt.date = self.order_date()
         pmt.method = u'GIFT CARD'
         pmt.amount = -self.gift()
         yield pmt
     transactions = list(self.transactions())
     if transactions:
         yield from transactions
     else:
         for method in self.paymethods():
             pmt = Payment()
             pmt.date = self.order_date()
             pmt.method = method
             pmt.amount = self.grand_total()
             yield pmt
             break
예제 #14
0
파일: pages.py 프로젝트: h4wkmoon/weboob
 def payments(self):
     for shmt in self.shipments():
         gift = self.gift(shmt)
         if gift:
             pmt = Payment()
             pmt.date = self.order_date()
             pmt.method = u'CARTE CADEAU'
             pmt.amount = -gift
             yield pmt
     transactions = list(self.transactions())
     if transactions:
         for t in transactions:
             yield t
     else:
         for method in self.paymethods():
             pmt = Payment()
             pmt.date = self.order_date()
             pmt.method = method
             pmt.amount = self.grand_total()
             yield pmt
             break
예제 #15
0
파일: pages.py 프로젝트: dermorz/weboob
 def transactions(self):
     for row in self.doc.xpath('//span[contains(text(),"Transactions")]'
                               '/../../div/div'):
         text = row.text_content().strip().replace('\n', ' ')
         if u'Items shipped:' not in text:
             continue
         date, method, amount = re.match(
             '.* '
             '([A-z]+ [0-9]+, [0-9]+)'
             '[ -]+'
             '([A-z][^:]+)'
             ': +'
             '([^ ]+)', text).groups()
         date = datetime.strptime(date, '%B %d, %Y')
         method = method.replace(u'ending in ', u'').upper()
         amount = AmTr.decimal_amount(amount)
         pmt = Payment()
         pmt.date = date
         pmt.method = method
         pmt.amount = amount
         yield pmt
예제 #16
0
파일: pages.py 프로젝트: ngrislain/weboob
 def payments(self):
     if self.gift():
         pmt = Payment()
         pmt.date = self.order_date()
         pmt.method = u'GIFT CARD'
         pmt.amount = -self.gift()
         yield pmt
     transactions = list(self.transactions())
     if transactions:
         for t in transactions:
             yield t
     else:
         for method in self.paymethods():
             pmt = Payment()
             pmt.date = self.order_date()
             pmt.method = method
             pmt.amount = self.grand_total()
             yield pmt
             break
예제 #17
0
파일: pages.py 프로젝트: ngrislain/weboob
 def payments(self):
     for shmt in self.shipments():
         gift = self.gift(shmt)
         if gift:
             pmt = Payment()
             pmt.date = self.order_date()
             pmt.method = u'CARTE CADEAU'
             pmt.amount = -gift
             yield pmt
     transactions = list(self.transactions())
     if transactions:
         for t in transactions:
             yield t
     else:
         for method in self.paymethods():
             pmt = Payment()
             pmt.date = self.order_date()
             pmt.method = method
             pmt.amount = self.grand_total()
             yield pmt
             break