Skip to content

Commit 5932bcc

Browse files
committed
Fixed Descarga Masiva
1 parent cf82528 commit 5932bcc

File tree

4 files changed

+63
-60
lines changed

4 files changed

+63
-60
lines changed

docs/pages/getting_started/45_cfdi_descarga_massiva.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ ___________________
5858
import base64
5959
from datetime import date
6060
61-
from satcfdi.create.catalogos import EstadoComprobante
6261
from satcfdi.models import Signer
63-
from satcfdi.pacs.sat import SAT, TipoDescargaMasivaTerceros, EstadoSolicitud
62+
from satcfdi.pacs.sat import SAT, TipoDescargaMasivaTerceros, EstadoSolicitud, EstadoComprobante
6463
6564
# Load Fiel
6665
signer = Signer.load(

satcfdi/create/catalogos.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33

44
class EstadoComprobante(StrEnum):
5-
CANCELADO = 'Cancelado'
6-
VIGENTE = 'Vigente'
7-
TODOS = 'Todos'
5+
CANCELADO = '0'
6+
VIGENTE = '1'

satcfdi/pacs/sat.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from ..exceptions import ResponseError
2929
from ..models import Signer, Certificate
3030
from . import PAC, Environment, TaxpayerStatus
31-
from ..create.catalogos import EstadoComprobante
3231
from ..create.w3.signature import signature_c14n_sha1, _digest, _tobytes
3332
from ..transform import MEXICO_TZ, get_timezone, verify_certificate
3433
from ..utils import iterate, parser
@@ -49,6 +48,12 @@ class EstadoSolicitud(IntEnum):
4948
VENCIDA = 6
5049

5150

51+
class EstadoComprobante(StrEnum):
52+
CANCELADO = 'Cancelado'
53+
VIGENTE = 'Vigente'
54+
TODOS = 'Todos'
55+
56+
5257
class CodigoEstadoSolicitud(StrEnum):
5358
# 5000 Solicitud recibida con éxito
5459
# Indica que la solicitud de descarga que se está

tests/test_pac_sat/pac_sat_rfc.pretty.py

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,60 @@
33
b'<des:SolicitaDescargaEmitidos><des:solicitud FechaFinal="2021-01-01T'
44
b'00:00:00" FechaInicial="2021-01-01T00:00:00" RfcEmisor="ABC123456ABC'
55
b'" RfcSolicitante="XIQB891116QE4" TipoSolicitud="CFDI" TipoComprobant'
6-
b'e="I" EstadoComprobante="Vigente"><des:RfcReceptores><des:RfcRecepto'
7-
b'r>ABC123456ABC</des:RfcReceptor></des:RfcReceptores><ds:Signature xm'
8-
b'lns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:Canon'
9-
b'icalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-'
10-
b'20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/'
11-
b'xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform'
12-
b' Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>'
13-
b'</ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/0'
14-
b'9/xmldsig#sha1"/><ds:DigestValue>5tIk7lQ/sABBcSmGghjvPQBuriM=</ds:Di'
15-
b'gestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>WSWnx4Qw'
16-
b'ZUfBg/dwjx5+LttzT7FCQXq89N401qJmfAbKZGzVy86Xkrqp/9n/ZRaoFigVmBiYua2c'
17-
b'm1AmXeRjI1inaFoIAaNrZeu37InyVpS3kqXUrHHGdtBJ5ESUIWcUfLItr1xnsNlspUa1'
18-
b'oBnjrp+FU8Rq0pgC9cTbV24moO2S6D66bM7T3asQfc0ZfAJBXPwelsVsamNL4ge4b0oS'
19-
b'h8R4Y0VVwrNR9YpIrpBFFf4gDonz1POucOBF6+oHVGWAt9iz15R6Wnyownimti3epoeO'
20-
b'iQc/3qJLfiSK7TCbHP6uaxl8k94zhuwK/usKDuYnecs+Cp05UIslf0AEG90X0g==</ds'
21-
b':SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509IssuerSerial><ds:X5'
22-
b'09IssuerName>unstructuredName=responsable: ACDMA-SAT,x500UniqueIdent'
23-
b'ifier=2.5.4.45,L=COYOACAN,ST=CIUDAD DE MEXICO,C=MX,postalCode=06370,'
24-
b'street=3ra cerrada de cadiz,[email protected],O'
25-
b'U=SAT-IES Authority,O=SERVICIO DE ADMINISTRACION TRIBUTARIA,CN=AC UA'
26-
b'T</ds:X509IssuerName><ds:X509SerialNumber>29223316287020600175976619'
27-
b'8444326234574038446385</ds:X509SerialNumber></ds:X509IssuerSerial><d'
28-
b's:X509Certificate>MIIF1DCCA7ygAwIBAgIUMzAwMDEwMDAwMDA0MDAwMDIzMTEwDQ'
29-
b'YJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0'
30-
b'lPIERFIEFETUlOSVNUUkFDSU9OIFRSSUJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQX'
31-
b'V0aG9yaXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYXJ0aW5lekBzYXQuZ29iLm14MR'
32-
b'0wGwYDVQQJDBQzcmEgY2VycmFkYSBkZSBjYWRpejEOMAwGA1UEEQwFMDYzNzAxCzAJBg'
33-
b'NVBAYTAk1YMRkwFwYDVQQIDBBDSVVEQUQgREUgTUVYSUNPMREwDwYDVQQHDAhDT1lPQU'
34-
b'NBTjERMA8GA1UELRMIMi41LjQuNDUxJTAjBgkqhkiG9w0BCQITFnJlc3BvbnNhYmxlOi'
35-
b'BBQ0RNQS1TQVQwHhcNMTkwNTI4MjE1ODQyWhcNMjMwNTI3MjE1ODQyWjCByTEeMBwGA1'
36-
b'UEAxMVQkVSRU5JQ0UgWElNTyBRVUVaQURBMR4wHAYDVQQpExVCRVJFTklDRSBYSU1PIF'
37-
b'FVRVpBREExHjAcBgNVBAoTFUJFUkVOSUNFIFhJTU8gUVVFWkFEQTELMAkGA1UEBhMCTV'
38-
b'gxJTAjBgkqhk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gL6Ovrk6L/SLULvhDe89eBmZHGIm5Vaye2X1OeY+Cmp'
53-
b'KZ0nMzu16+hOhE3ecRTmxHFUCWzyHuH8qyBetiJY64vyHMwgbyqwM3Lk7lEQowhYb4s8'
54-
b'vGyJgb0qQoyt0lACbtkM73CwzasPTtxnHZFKzt0C9aYIZvSVQidmK5EbGNh5YWL8tk35'
55-
b'2Sqjk4yxlZRqH8SkKHoMjPOrTcBJJwzWWQtz9hOl78kLqcYi+TK4ZWvunGXtZqDyQ2om'
56-
b'hZBokSAHqUDjcRmOnuMpazF68j8U73Bz2voQtimMJlB/yyT6luFlzUbEK3ckUYBkk0PK'
57-
b'xDe/6T7NXj+H4UWhpTivKnrqNWL7qAHLSP1tnmG8s=</ds:X509Certificate></ds:'
58-
b'X509Data></ds:KeyInfo></ds:Signature></des:solicitud></des:SolicitaD'
59-
b'escargaEmitidos></s:Body></s:Envelope>',
6+
b'e="I" EstadoComprobante="1"><des:RfcReceptores><des:RfcReceptor>ABC1'
7+
b'23456ABC</des:RfcReceptor></des:RfcReceptores><ds:Signature xmlns:ds'
8+
b'="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:Canonicaliz'
9+
b'ationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-200103'
10+
b'15"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsi'
11+
b'g#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algor'
12+
b'ithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:T'
13+
b'ransforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmld'
14+
b'sig#sha1"/><ds:DigestValue>M1NwuSlhMi51sRAjM1CZOqYPuK4=</ds:DigestVa'
15+
b'lue></ds:Reference></ds:SignedInfo><ds:SignatureValue>hqDE9Z/czCEX/K'
16+
b'ueQ81G2MiBkvfpRFUtekxU9pozHjhJrLq2Qh26M2GZoUQ6odvS2qPaEKNhLOC1oyNLNY'
17+
b'n4MibuoFh6Z8QXc4lGsELtxFAlL27LJi5XKpBym0gMkfR+VcI+fLPbVJM0R2xE6BffPX'
18+
b'X2dcirHkePE8MTh6s+Ao29UNVmKWNUleSPnxoLIkiki6ViBF49IP2oNdQh5pugxFxhh0'
19+
b'iPUS8fefxgo8yW9yqIGNBmRjUh/qu63W4NBXWg0GP+l5y3aYZ/x+M8QnjvJ23fCvIatb'
20+
b'/3XAMGPkqQ3MBG1kfiuT7+zirDUF5IzLUZ3+APFNnUBN4MnIFlPvInzw==</ds:Signa'
21+
b'tureValue><ds:KeyInfo><ds:X509Data><ds:X509IssuerSerial><ds:X509Issu'
22+
b'erName>unstructuredName=responsable: ACDMA-SAT,x500UniqueIdentifier='
23+
b'2.5.4.45,L=COYOACAN,ST=CIUDAD DE MEXICO,C=MX,postalCode=06370,street'
24+
b'=3ra cerrada de cadiz,[email protected],OU=SAT-'
25+
b'IES Authority,O=SERVICIO DE ADMINISTRACION TRIBUTARIA,CN=AC UAT</ds:'
26+
b'X509IssuerName><ds:X509SerialNumber>29223316287020600175976619844432'
27+
b'6234574038446385</ds:X509SerialNumber></ds:X509IssuerSerial><ds:X509'
28+
b'Certificate>MIIF1DCCA7ygAwIBAgIUMzAwMDEwMDAwMDA0MDAwMDIzMTEwDQYJKoZI'
29+
b'hvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERF'
30+
b'IEFETUlOSVNUUkFDSU9OIFRSSUJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQXV0aG9y'
31+
b'aXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYXJ0aW5lekBzYXQuZ29iLm14MR0wGwYD'
32+
b'VQQJDBQzcmEgY2VycmFkYSBkZSBjYWRpejEOMAwGA1UEEQwFMDYzNzAxCzAJBgNVBAYT'
33+
b'Ak1YMRkwFwYDVQQIDBBDSVVEQUQgREUgTUVYSUNPMREwDwYDVQQHDAhDT1lPQU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VbcXzZ9rrXoiXLo8OCCkE5fT4ig8FcWiH1bkh6ZABQSHKcEEY9ewJWZpD3bA8E7DL'
49+
b'HfDHmG1EqRKStajIG1aq3GSvFAetMvJE2epFsWvkO7CkN2hNT9SwsFkBYl+aiCP27LzQ'
50+
b'4uD+mXJ6Pg79nD/ayuQDa7RGJ6u5KHY1I66xcpVxOegQr+zolYQ6RfAye6Fk6JxUnYBV'
51+
b'XtnsC3GLpB0fMb+53NZGzARVD9/762A3dy3GHlMWs9FVoRN7DBJyNsVSlAodi9ClETC3'
52+
b'Tr7WuXIzPZTbu17JEcqgL6Ovrk6L/SLULvhDe89eBmZHGIm5Vaye2X1OeY+CmpKZ0nMz'
53+
b'u16+hOhE3ecRTmxHFUCWzyHuH8qyBetiJY64vyHMwgbyqwM3Lk7lEQowhYb4s8vGyJgb'
54+
b'0qQoyt0lACbtkM73CwzasPTtxnHZFKzt0C9aYIZvSVQidmK5EbGNh5YWL8tk352Sqjk4'
55+
b'yxlZRqH8SkKHoMjPOrTcBJJwzWWQtz9hOl78kLqcYi+TK4ZWvunGXtZqDyQ2omhZBokS'
56+
b'AHqUDjcRmOnuMpazF68j8U73Bz2voQtimMJlB/yyT6luFlzUbEK3ckUYBkk0PKxDe/6T'
57+
b'7NXj+H4UWhpTivKnrqNWL7qAHLSP1tnmG8s=</ds:X509Certificate></ds:X509Da'
58+
b'ta></ds:KeyInfo></ds:Signature></des:solicitud></des:SolicitaDescarg'
59+
b'aEmitidos></s:Body></s:Envelope>',
6060
'headers': {'Accept': 'text/xml',
6161
'Authorization': 'WRAP access_token="token_comprobante"',
6262
'Cache-Control': 'no-cache',

0 commit comments

Comments
 (0)