Commit 980eda56 authored by Florian Duguet's avatar Florian Duguet Committed by ntome

[societegenerale] replace 'document' for document.type by STATEMENT

'document' is not a valid value
parent 05824e24
......@@ -28,7 +28,7 @@ from weboob.capabilities.bank import (
)
from weboob.capabilities.bill import (
CapDocument, Subscription, SubscriptionNotFound,
Document, DocumentNotFound,
Document, DocumentNotFound, DocumentTypes,
)
from weboob.capabilities.contact import CapContact
from weboob.capabilities.profile import CapProfile
......@@ -57,6 +57,8 @@ class SocieteGeneraleModule(Module, CapBankWealth, CapBankTransferAddRecipient,
Value('website', label='Type de compte', default='par',
choices={'par': 'Particuliers', 'pro': 'Professionnels', 'ent': 'Entreprises'}))
accepted_document_types = (DocumentTypes.STATEMENT,)
def create_default_browser(self):
b = {'par': SocieteGenerale, 'pro': SGProfessionalBrowser, 'ent': SGEnterpriseBrowser}
self.BROWSER = b[self.config['website'].get()]
......
......@@ -22,7 +22,7 @@ from __future__ import unicode_literals
import re
from dateutil.relativedelta import relativedelta
from weboob.capabilities.bill import Document, Subscription
from weboob.capabilities.bill import Document, Subscription, DocumentTypes
from weboob.browser.elements import TableElement, ItemElement, method
from weboob.browser.filters.standard import CleanText, Regexp, Env, Date, Format, Field
from weboob.browser.filters.html import Link, TableCell, Attr
......@@ -111,7 +111,7 @@ class BankStatementPage(LoggedPage, BasePage):
d.url = Regexp(Link('.'), r"= '(.*)';")(a)
d.id = '%s_%s' % (subscription.id, date_filter(a).replace('/', ''))
d.type = 'document'
d.type = DocumentTypes.STATEMENT
yield d
......
......@@ -30,7 +30,7 @@ from weboob.browser.filters.json import Dict
from weboob.capabilities.base import Currency
from weboob.capabilities import NotAvailable
from weboob.capabilities.bank import Account
from weboob.capabilities.bill import Document, Subscription
from weboob.capabilities.bill import Document, Subscription, DocumentTypes
from weboob.exceptions import (
BrowserUnavailable, NoAccountsException, BrowserIncorrectPassword, BrowserPasswordExpired,
AuthMethodNotImplemented,
......@@ -237,7 +237,7 @@ class BankStatementPage(LoggedPage, JsonPage):
d = Document()
d.date = datetime.strptime(document['dateEdition'], '%d/%m/%Y')
d.label = '%s %s' % (account['libelle'], document['dateEdition'])
d.type = 'document'
d.type = DocumentTypes.STATEMENT
d.format = 'pdf'
d.id = '%s_%s' % (account['id'], document['dateEdition'].replace('/', ''))
d.url = '/icd/syd-front/data/syd-rce-telechargerReleve.html?b64e4000_sceau=%s' % quote_plus(document['sceau'])
......
......@@ -33,7 +33,7 @@ from weboob.browser.filters.html import Attr, Link
from weboob.tools.capabilities.bank.investments import is_isin_valid
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
from weboob.capabilities.profile import Profile, Person
from weboob.capabilities.bill import Document, Subscription
from weboob.capabilities.bill import Document, Subscription, DocumentTypes
from weboob.capabilities.bank import Account, Investment
from weboob.exceptions import ActionNeeded, BrowserIncorrectPassword, BrowserUnavailable
from weboob.tools.json import json
......@@ -243,7 +243,7 @@ class SubscriptionPage(LoggedPage, SGPEPage):
obj_date = Date(Regexp(Field('label'), r'au (\d{4}\-\d{2}\-\d{2})'))
obj_id = Format('%s_%s', Env('sub_id'), CleanText(Regexp(Field('label'), r'au (\d{4}\-\d{2}\-\d{2})'), replace=[('-', '')]))
obj_format = 'pdf'
obj_type = 'document'
obj_type = DocumentTypes.STATEMENT
obj_url = Format(
'/Pgn/PrintServlet?PageID=ReleveRIE&MenuID=BANRELRIE&urlTypeTransfert=ipdf&REPORTNAME=ReleveInteretElectronique.sgi&numeroRie=%s',
Regexp(Attr('./td[2]/a', 'onclick'), r"impression\('(.*)'\);")
......
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