|
21 | 21 | from builtins import str |
22 | 22 |
|
23 | 23 | __author__ = "Mariano Reingart (reingart@gmail.com)" |
24 | | -__copyright__ = "Copyright (C) 2011-2023 Mariano Reingart" |
| 24 | +__copyright__ = "Copyright (C) 2011-2025 Mariano Reingart" |
25 | 25 | __license__ = "LGPL-3.0-or-later" |
26 | | -__version__ = "3.11a" |
| 26 | +__version__ = "3.12a" |
27 | 27 |
|
28 | 28 | import datetime |
29 | 29 | import decimal |
@@ -163,6 +163,7 @@ def CrearFactura( |
163 | 163 | idioma_cbte=7, |
164 | 164 | incoterms_ds=None, |
165 | 165 | fecha_pago=None, |
| 166 | + cancela_misma_moneda_ext=None, |
166 | 167 | **kwargs |
167 | 168 | ): |
168 | 169 | "Creo un objeto factura (interna)" |
@@ -196,6 +197,9 @@ def CrearFactura( |
196 | 197 | "detalles": [], |
197 | 198 | "actividades": [], |
198 | 199 | } |
| 200 | + |
| 201 | + if cancela_misma_moneda_ext: fact['cancela_misma_moneda_ext'] = cancela_misma_moneda_ext |
| 202 | + |
199 | 203 | self.factura = fact |
200 | 204 |
|
201 | 205 | return True |
@@ -278,6 +282,7 @@ def Authorize(self, id): |
278 | 282 | "Id_impositivo": f["id_impositivo"], |
279 | 283 | "Moneda_Id": f["moneda_id"], |
280 | 284 | "Moneda_ctz": f["moneda_ctz"], |
| 285 | + 'CanMisMonExt': f.get('cancela_misma_moneda_ext'), |
281 | 286 | "Obs_comerciales": f["obs_comerciales"], |
282 | 287 | "Imp_total": f["imp_total"], |
283 | 288 | "Obs": f["obs_generales"], |
@@ -818,6 +823,29 @@ def GetParamActividades(self, sep="|"): |
818 | 823 | else: |
819 | 824 | return ret |
820 | 825 |
|
| 826 | + @inicializar_y_capturar_excepciones |
| 827 | + def GetParamActividades(self, sep="|"): |
| 828 | + "Recuperar lista de valores referenciales de c�digos de Idiomas" |
| 829 | + ret = self.client.FEXGetPARAM_Actividades( |
| 830 | + Auth={'Token': self.Token, 'Sign': self.Sign, 'Cuit': self.Cuit, }) |
| 831 | + result = ret['FEXGetPARAM_ActividadesResult'] |
| 832 | + self.__analizar_errores(result) |
| 833 | + |
| 834 | + ret = [] |
| 835 | + for u in result.get('FEXResultGet', []): |
| 836 | + u = u['ClsFEXResponse_ActividadTipo'] |
| 837 | + try: |
| 838 | + r = {'codigo': u.get('Id'), 'ds': u.get('Desc'), |
| 839 | + 'orden': u.get('Orden'), } |
| 840 | + except Exception as e: |
| 841 | + print(e) |
| 842 | + |
| 843 | + ret.append(r) |
| 844 | + if sep: |
| 845 | + return [("\t%(codigo)s\t%(ds)s\t%(orden)s\t" |
| 846 | + % it).replace("\t", sep) for it in ret] |
| 847 | + else: |
| 848 | + return ret |
821 | 849 |
|
822 | 850 | class WSFEX(WSFEXv1): |
823 | 851 | "Wrapper para retrocompatibilidad con WSFEX" |
@@ -953,7 +981,7 @@ def main(): |
953 | 981 | incoterms, |
954 | 982 | idioma_cbte, |
955 | 983 | incoterms_ds, |
956 | | - fecha_pago, |
| 984 | + fecha_pago,cancela_misma_moneda_ext="N", |
957 | 985 | ) |
958 | 986 |
|
959 | 987 | # Agrego un item: |
@@ -989,7 +1017,11 @@ def main(): |
989 | 1017 | cbteasoc_tipo, cbteasoc_pto_vta, cbteasoc_nro, cbteasoc_cuit |
990 | 1018 | ) |
991 | 1019 |
|
992 | | - ok = wsfexv1.AgregarActividad(1234) |
| 1020 | + ##id = "99000000000100" # n�mero propio de transacci�n |
| 1021 | + # obtengo el �ltimo ID y le adiciono 1 |
| 1022 | + # (advertencia: evitar overflow y almacenar!) |
| 1023 | + id = long(wsfexv1.GetLastID()) + 1 |
| 1024 | + ok = wsfexv1.AgregarActividad(1234) |
993 | 1025 |
|
994 | 1026 | ##id = "99000000000100" # número propio de transacción |
995 | 1027 | # obtengo el último ID y le adiciono 1 |
|
0 commit comments