|
29 | 29 | from past.builtins import basestring |
30 | 30 |
|
31 | 31 | __author__ = "Mariano Reingart <[email protected]>" |
32 | | -__copyright__ = "Copyright (C) 2010-2021 Mariano Reingart" |
| 32 | +__copyright__ = "Copyright (C) 2010-2023 Mariano Reingart" |
33 | 33 | __license__ = "LGPL-3.0-or-later" |
34 | | -__version__ = "3.26a" |
| 34 | +__version__ = "3.27c" |
35 | 35 |
|
36 | 36 | import datetime |
37 | 37 | import decimal |
@@ -140,9 +140,10 @@ class WSFEv1(BaseWS): |
140 | 140 | _reg_class_spec_ = "pyafipws.wsfev1.WSFEv1" |
141 | 141 |
|
142 | 142 | if TYPELIB: |
143 | | - _typelib_guid_ = '{8AE2BD1D-A216-4E98-95DB-24A11225EF67}' |
| 143 | + _typelib_guid_ = "{8AE2BD1D-A216-4E98-95DB-24A11225EF67}" |
144 | 144 | _typelib_version_ = 1, 26 |
145 | | - _com_interfaces_ = ['IWSFEv1'] |
| 145 | + _com_interfaces_ = ["IWSFEv1"] |
| 146 | + ##_reg_class_spec_ = "wsfev1.WSFEv1" |
146 | 147 |
|
147 | 148 | # Variables globales para BaseWS: |
148 | 149 | HOMO = HOMO |
@@ -329,8 +330,8 @@ def AgregarComprador(self, doc_tipo=80, doc_nro=0, porcentaje=100.00, **kwarg): |
329 | 330 |
|
330 | 331 | def AgregarActividad(self, actividad_id=0, **kwarg): |
331 | 332 | "Agrego actividad a una factura (interna)" |
332 | | - op = { 'actividad_id': actividad_id } |
333 | | - self.factura['actividades'].append(op) |
| 333 | + act = {"actividad_id": actividad_id} |
| 334 | + self.factura["actividades"].append(act) |
334 | 335 | return True |
335 | 336 |
|
336 | 337 | def ObtenerCampoFactura(self, *campos): |
@@ -381,9 +382,6 @@ def CAESolicitar(self): |
381 | 382 | "FchServDesde": f.get("fecha_serv_desde"), |
382 | 383 | "FchServHasta": f.get("fecha_serv_hasta"), |
383 | 384 | "FchVtoPago": f.get("fecha_venc_pago"), |
384 | | - "FchServDesde": f.get("fecha_serv_desde"), |
385 | | - "FchServHasta": f.get("fecha_serv_hasta"), |
386 | | - "FchVtoPago": f["fecha_venc_pago"], |
387 | 385 | "MonId": f["moneda_id"], |
388 | 386 | "MonCotiz": f["moneda_ctz"], |
389 | 387 | "PeriodoAsoc": { |
@@ -456,7 +454,7 @@ def CAESolicitar(self): |
456 | 454 | "Actividades": [ |
457 | 455 | { |
458 | 456 | "Actividad": { |
459 | | - 'Id': actividad['actividad_id'], |
| 457 | + "Id": actividad["actividad_id"], |
460 | 458 | } |
461 | 459 | } |
462 | 460 | for actividad in f["actividades"] |
@@ -638,9 +636,9 @@ def CompConsultar(self, tipo_cbte, punto_vta, cbte_nro, reproceso=False): |
638 | 636 | } |
639 | 637 | copia = resultget.copy() |
640 | 638 | # TODO: ordenar / convertir opcionales (por ahora no se verifican) |
641 | | - del verificaciones['Opcionales'] |
642 | | - if 'Opcionales' in copia: |
643 | | - del copia['Opcionales'] |
| 639 | + del verificaciones["Opcionales"] |
| 640 | + if "Opcionales" in copia: |
| 641 | + del copia["Opcionales"] |
644 | 642 | verifica(verificaciones, copia, difs) |
645 | 643 | if difs: |
646 | 644 | print("Diferencias:", difs) |
@@ -802,9 +800,6 @@ def CAESolicitarX(self): |
802 | 800 | "FchServDesde": f.get("fecha_serv_desde"), |
803 | 801 | "FchServHasta": f.get("fecha_serv_hasta"), |
804 | 802 | "FchVtoPago": f.get("fecha_venc_pago"), |
805 | | - "FchServDesde": f.get("fecha_serv_desde"), |
806 | | - "FchServHasta": f.get("fecha_serv_hasta"), |
807 | | - "FchVtoPago": f["fecha_venc_pago"], |
808 | 803 | "MonId": f["moneda_id"], |
809 | 804 | "MonCotiz": f["moneda_ctz"], |
810 | 805 | "PeriodoAsoc": { |
@@ -1034,9 +1029,6 @@ def CAEARegInformativo(self): |
1034 | 1029 | "FchServDesde": f.get("fecha_serv_desde"), |
1035 | 1030 | "FchServHasta": f.get("fecha_serv_hasta"), |
1036 | 1031 | "FchVtoPago": f.get("fecha_venc_pago"), |
1037 | | - "FchServDesde": f.get("fecha_serv_desde"), |
1038 | | - "FchServHasta": f.get("fecha_serv_hasta"), |
1039 | | - "FchVtoPago": f["fecha_venc_pago"], |
1040 | 1032 | "MonId": f["moneda_id"], |
1041 | 1033 | "MonCotiz": f["moneda_ctz"], |
1042 | 1034 | "PeriodoAsoc": { |
@@ -1095,6 +1087,15 @@ def CAEARegInformativo(self): |
1095 | 1087 | for opcional in f["opcionales"] |
1096 | 1088 | ] |
1097 | 1089 | or None, |
| 1090 | + "Actividades": [ |
| 1091 | + { |
| 1092 | + "Actividad": { |
| 1093 | + "Id": actividad["actividad_id"], |
| 1094 | + } |
| 1095 | + } |
| 1096 | + for actividad in f["actividades"] |
| 1097 | + ] |
| 1098 | + or None, |
1098 | 1099 | "CAEA": f["caea"], |
1099 | 1100 | "CbteFchHsGen": f.get("fecha_hs_gen"), |
1100 | 1101 | } |
@@ -1301,13 +1302,15 @@ def ParamGetPtosVenta(self, sep="|"): |
1301 | 1302 |
|
1302 | 1303 | @inicializar_y_capturar_excepciones |
1303 | 1304 | def ParamGetActividades(self, sep="|"): |
1304 | | - "Recuperador de valores referenciales de códigos de Actividades" |
| 1305 | + "Recuperador de valores referenciales de c�digos de Actividades" |
1305 | 1306 | ret = self.client.FEParamGetActividades( |
1306 | | - Auth={'Token': self.Token, 'Sign': self.Sign, 'Cuit': self.Cuit}, |
1307 | | - ) |
1308 | | - res = ret['FEParamGetActividades'] |
1309 | | - return [(u"%(Id)s\t%(Orden)s\t%(Desc)s" % p['ActividadesTipo']).replace("\t", sep) |
1310 | | - for p in res['ResultGet']] |
| 1307 | + Auth={"Token": self.Token, "Sign": self.Sign, "Cuit": self.Cuit}, |
| 1308 | + ) |
| 1309 | + res = ret["FEParamGetActividadesResult"] |
| 1310 | + return [ |
| 1311 | + ("%(Id)s\t%(Orden)s\t%(Desc)s" % p["ActividadesTipo"]).replace("\t", sep) |
| 1312 | + for p in res["ResultGet"] |
| 1313 | + ] |
1311 | 1314 |
|
1312 | 1315 |
|
1313 | 1316 | def p_assert_eq(a, b): |
@@ -1500,7 +1503,7 @@ def main(): |
1500 | 1503 | if "--rg4540" in sys.argv: |
1501 | 1504 | wsfev1.AgregarPeriodoComprobantesAsociados("20200101", "20200131") |
1502 | 1505 |
|
1503 | | - if '--rg5259' in sys.argv: |
| 1506 | + if "--rg5259" in sys.argv: |
1504 | 1507 | wsfev1.AgregarActividad(960990) |
1505 | 1508 |
|
1506 | 1509 | # agregar la factura creada internamente para solicitud múltiple: |
|
0 commit comments