forked from jjlopez/descargar-cfdi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFiltrosRecibidos.py
79 lines (72 loc) · 3.33 KB
/
FiltrosRecibidos.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import datetime
class FiltrosRecibidos:
def __init__(self):
self.annio = str(datetime.date.today().year)
self.mes = '1'
self.dia = '0'
self.horaInicial='0'
self.minutoInicial='0'
self.segundoInicial='0'
self.horaFinal='23'
self.minutoFinal='59'
self.segundoFinal='59'
self.rfcEmisor=''
self.__estado='1' #1.-Vigente,0.-Cancelado
self.tipo = '-1'
self.folioFiscal = ''
def __formateaDia(self):
if int(self.dia) < 10:
self.dia = '0' + self.dia
return self.dia
def obtenerPOST(self):
post={}
post['__ASYNCPOST'] = 'true'
post['__EVENTARGUMENT'] = ''
post['__EVENTTARGET'] = ''
post['__LASTFOCUS'] = ''
post['ctl00$MainContent$BtnBusqueda'] = 'Buscar CFDI'
post['ctl00$MainContent$CldFecha$DdlAnio'] = self.annio
post['ctl00$MainContent$CldFecha$DdlDia'] = self.__formateaDia()
post['ctl00$MainContent$CldFecha$DdlHora'] = self.horaInicial
post['ctl00$MainContent$CldFecha$DdlHoraFin'] = self.horaFinal
post['ctl00$MainContent$CldFecha$DdlMes'] = self.mes
post['ctl00$MainContent$CldFecha$DdlMinuto'] = self.minutoInicial
post['ctl00$MainContent$CldFecha$DdlMinutoFin'] = self.minutoFinal
post['ctl00$MainContent$CldFecha$DdlSegundo'] = self.segundoInicial
post['ctl00$MainContent$CldFecha$DdlSegundoFin'] = self.segundoFinal
post['ctl00$MainContent$DdlEstadoComprobante'] = self.__estado
post['ctl00$MainContent$FiltroCentral'] = self.__obtenFiltroCentral()
post['ctl00$MainContent$TxtRfcReceptor'] = self.rfcEmisor
post['ctl00$MainContent$TxtUUID'] = self.folioFiscal
post['ctl00$MainContent$ddlComplementos'] = self.tipo
post['ctl00$MainContent$hfInicialBool'] = 'false'
post['ctl00$ScriptManager1'] = 'ctl00$MainContent$UpnlBusqueda|ctl00$MainContent$BtnBusqueda'
return post
def __obtenFiltroCentral(self):
if self.folioFiscal != '':
return 'RdoFolioFiscal'
else:
return 'RdoFechas'
def obtenerPOSTFormularioFechas(self):
post={}
post['__ASYNCPOST'] = 'true'
post['__EVENTARGUMENT'] = ''
post['__EVENTTARGET']='ctl00$MainContent$RdoFechas'
post['__LASTFOCUS'] = ''
post['ctl00$MainContent$CldFecha$DdlAnio'] = str(datetime.date.today().year)
post['ctl00$MainContent$CldFecha$DdlDia'] = '0'
post['ctl00$MainContent$CldFecha$DdlHora'] = '0'
post['ctl00$MainContent$CldFecha$DdlHoraFin'] = '23'
post['ctl00$MainContent$CldFecha$DdlMes'] = '1'
post['ctl00$MainContent$CldFecha$DdlMinuto'] = '0'
post['ctl00$MainContent$CldFecha$DdlMinutoFin'] = '59'
post['ctl00$MainContent$CldFecha$DdlSegundo'] = '0'
post['ctl00$MainContent$CldFecha$DdlSegundoFin'] = '59'
post['ctl00$MainContent$DdlEstadoComprobante'] = '-1'
post['ctl00$MainContent$FiltroCentral'] = 'RdoFechas'
post['ctl00$MainContent$TxtRfcReceptor'] = ''
post['ctl00$MainContent$TxtUUID'] = ''
post['ctl00$MainContent$ddlComplementos'] = '-1'
post['ctl00$MainContent$hfInicialBool']='true'
post['ctl00$ScriptManager1'] = 'ctl00$MainContent$UpnlBusqueda|ctl00$MainContent$RdoFechas'
return post