Skip to content

Commit

Permalink
WSFEv1: re-sync updates
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Sandoval <nicolassandovalunm@gmail.com>
  • Loading branch information
reingart authored and NicolasSandoval committed Jun 29, 2023
1 parent c1462da commit 1b46313
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions wsfev1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
__author__ = "Mariano Reingart <reingart@gmail.com>"
__copyright__ = "Copyright (C) 2010-2023 Mariano Reingart"
__license__ = "LGPL-3.0-or-later"
__version__ = "3.26a"
__version__ = "3.27c"

import datetime
import decimal
Expand Down Expand Up @@ -140,9 +140,10 @@ class WSFEv1(BaseWS):
_reg_class_spec_ = "pyafipws.wsfev1.WSFEv1"

if TYPELIB:
_typelib_guid_ = '{8AE2BD1D-A216-4E98-95DB-24A11225EF67}'
_typelib_guid_ = "{8AE2BD1D-A216-4E98-95DB-24A11225EF67}"
_typelib_version_ = 1, 26
_com_interfaces_ = ['IWSFEv1']
_com_interfaces_ = ["IWSFEv1"]
##_reg_class_spec_ = "wsfev1.WSFEv1"

# Variables globales para BaseWS:
HOMO = HOMO
Expand Down Expand Up @@ -329,8 +330,8 @@ def AgregarComprador(self, doc_tipo=80, doc_nro=0, porcentaje=100.00, **kwarg):

def AgregarActividad(self, actividad_id=0, **kwarg):
"Agrego actividad a una factura (interna)"
op = { 'actividad_id': actividad_id }
self.factura['actividades'].append(op)
act = {"actividad_id": actividad_id}
self.factura["actividades"].append(act)
return True

def ObtenerCampoFactura(self, *campos):
Expand Down Expand Up @@ -381,9 +382,6 @@ def CAESolicitar(self):
"FchServDesde": f.get("fecha_serv_desde"),
"FchServHasta": f.get("fecha_serv_hasta"),
"FchVtoPago": f.get("fecha_venc_pago"),
"FchServDesde": f.get("fecha_serv_desde"),
"FchServHasta": f.get("fecha_serv_hasta"),
"FchVtoPago": f["fecha_venc_pago"],
"MonId": f["moneda_id"],
"MonCotiz": f["moneda_ctz"],
"PeriodoAsoc": {
Expand Down Expand Up @@ -456,7 +454,7 @@ def CAESolicitar(self):
"Actividades": [
{
"Actividad": {
'Id': actividad['actividad_id'],
"Id": actividad["actividad_id"],
}
}
for actividad in f["actividades"]
Expand Down Expand Up @@ -638,9 +636,9 @@ def CompConsultar(self, tipo_cbte, punto_vta, cbte_nro, reproceso=False):
}
copia = resultget.copy()
# TODO: ordenar / convertir opcionales (por ahora no se verifican)
del verificaciones['Opcionales']
if 'Opcionales' in copia:
del copia['Opcionales']
del verificaciones["Opcionales"]
if "Opcionales" in copia:
del copia["Opcionales"]
verifica(verificaciones, copia, difs)
if difs:
print("Diferencias:", difs)
Expand Down Expand Up @@ -802,9 +800,6 @@ def CAESolicitarX(self):
"FchServDesde": f.get("fecha_serv_desde"),
"FchServHasta": f.get("fecha_serv_hasta"),
"FchVtoPago": f.get("fecha_venc_pago"),
"FchServDesde": f.get("fecha_serv_desde"),
"FchServHasta": f.get("fecha_serv_hasta"),
"FchVtoPago": f["fecha_venc_pago"],
"MonId": f["moneda_id"],
"MonCotiz": f["moneda_ctz"],
"PeriodoAsoc": {
Expand Down Expand Up @@ -1034,9 +1029,6 @@ def CAEARegInformativo(self):
"FchServDesde": f.get("fecha_serv_desde"),
"FchServHasta": f.get("fecha_serv_hasta"),
"FchVtoPago": f.get("fecha_venc_pago"),
"FchServDesde": f.get("fecha_serv_desde"),
"FchServHasta": f.get("fecha_serv_hasta"),
"FchVtoPago": f["fecha_venc_pago"],
"MonId": f["moneda_id"],
"MonCotiz": f["moneda_ctz"],
"PeriodoAsoc": {
Expand Down Expand Up @@ -1095,6 +1087,15 @@ def CAEARegInformativo(self):
for opcional in f["opcionales"]
]
or None,
"Actividades": [
{
"Actividad": {
"Id": actividad["actividad_id"],
}
}
for actividad in f["actividades"]
]
or None,
"CAEA": f["caea"],
"CbteFchHsGen": f.get("fecha_hs_gen"),
}
Expand Down Expand Up @@ -1301,13 +1302,15 @@ def ParamGetPtosVenta(self, sep="|"):

@inicializar_y_capturar_excepciones
def ParamGetActividades(self, sep="|"):
"Recuperador de valores referenciales de códigos de Actividades"
"Recuperador de valores referenciales de c�digos de Actividades"
ret = self.client.FEParamGetActividades(
Auth={'Token': self.Token, 'Sign': self.Sign, 'Cuit': self.Cuit},
)
res = ret['FEParamGetActividades']
return [(u"%(Id)s\t%(Orden)s\t%(Desc)s" % p['ActividadesTipo']).replace("\t", sep)
for p in res['ResultGet']]
Auth={"Token": self.Token, "Sign": self.Sign, "Cuit": self.Cuit},
)
res = ret["FEParamGetActividadesResult"]
return [
("%(Id)s\t%(Orden)s\t%(Desc)s" % p["ActividadesTipo"]).replace("\t", sep)
for p in res["ResultGet"]
]


def p_assert_eq(a, b):
Expand Down Expand Up @@ -1500,7 +1503,7 @@ def main():
if "--rg4540" in sys.argv:
wsfev1.AgregarPeriodoComprobantesAsociados("20200101", "20200131")

if '--rg5259' in sys.argv:
if "--rg5259" in sys.argv:
wsfev1.AgregarActividad(960990)

# agregar la factura creada internamente para solicitud múltiple:
Expand Down

0 comments on commit 1b46313

Please sign in to comment.