From 7613ed747ff1ae0adccc11c39a0112e377e1a860 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 13:39:25 +0000 Subject: [PATCH 1/6] chore(deps-dev): Bump mypy from 0.991 to 1.0.1 Bumps [mypy](https://github.com/python/mypy) from 0.991 to 1.0.1. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.991...v1.0.1) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.in | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.in b/requirements-dev.in index b4044492..cc90527d 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -10,7 +10,7 @@ codecov==2.1.12 coverage==7.1.0 flake8==4.0.1 isort==5.10.1 -mypy==0.991 +mypy==1.0.1 tox==3.25.1 twine==3.1.1 types-jsonschema==4.17.0.3 diff --git a/requirements-dev.txt b/requirements-dev.txt index e693f7a4..832aceda 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -67,7 +67,7 @@ keyring==21.4.0 # via twine mccabe==0.6.1 # via flake8 -mypy==0.991 +mypy==1.0.1 # via -r requirements-dev.in mypy-extensions==0.4.3 # via From d3d13e7a3011e4a8fb57813545789298972cba50 Mon Sep 17 00:00:00 2001 From: Samuel Villegas Date: Tue, 7 Mar 2023 15:57:59 -0300 Subject: [PATCH 2/6] chore: Drop support for Python 3.7 The support of Python 3.7 ends on 2023-06-27: - https://peps.python.org/pep-0537/#lifespan Ref: https://github.com/fyntex/lib-cl-sii-python/issues/439 Ref: https://cordada.aha.io/features/COMPCLDATA-219 --- .github/workflows/ci.yaml | 4 +--- README.md | 4 ++-- mypy.ini | 2 +- requirements-dev.txt | 20 +------------------- requirements.txt | 11 +++-------- setup.py | 3 +-- tox.ini | 2 -- 7 files changed, 9 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cc1154d5..86ddd1c1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,6 @@ jobs: strategy: matrix: python_version: - - "3.7.15" - "3.8.13" - "3.9.16" - "3.10.9" @@ -70,7 +69,6 @@ jobs: strategy: matrix: python_version: - - "3.7.15" - "3.8.13" - "3.9.16" - "3.10.9" @@ -126,7 +124,7 @@ jobs: - name: Check that compiled Python dependency manifests are up-to-date with their sources # FIXME: There are issues related to testing with multiple Python versions. - if: ${{ startsWith(matrix.python_version, '3.7.') }} + if: ${{ startsWith(matrix.python_version, '3.8.') }} run: | source "$PYTHON_VIRTUALENV_ACTIVATE" make python-deps-sync-check diff --git a/README.md b/README.md index 24d33d5b..4ff784a8 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ The full documentation is at . ## Supported Python versions -Only Python 3.7, 3.8, 3.9 and 3.10. Python 3.6 and below will not work because we use some features -introduced in Python 3.7. +Only Python 3.8, 3.9 and 3.10. Python 3.7 and below will not work because we use some features +introduced in Python 3.8. ## Quickstart diff --git a/mypy.ini b/mypy.ini index d551da5f..849c4612 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version = 3.7 +python_version = 3.8 platform = linux files = cl_sii, diff --git a/requirements-dev.txt b/requirements-dev.txt index 832aceda..990a0073 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with python 3.7 +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # pip-compile --strip-extras requirements-dev.in @@ -47,16 +47,6 @@ flake8==4.0.1 # via -r requirements-dev.in idna==2.10 # via requests -importlib-metadata==1.6.0 - # via - # -c requirements.txt - # click - # flake8 - # keyring - # pluggy - # tox - # twine - # virtualenv isort==5.10.1 # via -r requirements-dev.in jeepney==0.8.0 @@ -125,10 +115,6 @@ tqdm==4.64.0 # via twine twine==3.1.1 # via -r requirements-dev.in -typed-ast==1.5.4 - # via - # black - # mypy types-jsonschema==4.17.0.3 # via -r requirements-dev.in types-pyopenssl==23.0.0.2 @@ -148,10 +134,6 @@ webencodings==0.5.1 # via bleach wheel==0.38.4 # via -r requirements-dev.in -zipp==3.8.1 - # via - # -c requirements.txt - # importlib-metadata # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/requirements.txt b/requirements.txt index c2df4346..78ca53c2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with python 3.7 +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # pip-compile --strip-extras requirements.in @@ -26,9 +26,7 @@ django==3.2.17 djangorestframework==3.14.0 # via -r requirements.in importlib-metadata==1.6.0 - # via - # -r requirements.in - # jsonschema + # via -r requirements.in importlib-resources==5.10.2 # via jsonschema jsonschema==4.17.3 @@ -63,10 +61,7 @@ signxml==2.10.1 sqlparse==0.4.2 # via django typing-extensions==4.3.0 - # via - # asgiref - # jsonschema - # pydantic + # via pydantic zipp==3.8.1 # via # importlib-metadata diff --git a/setup.py b/setup.py index 22039c43..4ce5c622 100644 --- a/setup.py +++ b/setup.py @@ -72,7 +72,6 @@ def get_version(*file_paths: Sequence[str]) -> str: 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', @@ -87,7 +86,7 @@ def get_version(*file_paths: Sequence[str]) -> str: name='cl-sii', package_data=_package_data, packages=find_packages(exclude=['docs', 'tests*']), - python_requires='>=3.7, <3.11', + python_requires='>=3.8, <3.11', setup_requires=setup_requirements, test_suite='tests', tests_require=test_requirements, diff --git a/tox.ini b/tox.ini index a506f124..1fe875ad 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,5 @@ [tox] envlist = - py37, py38, py39, py310, @@ -13,7 +12,6 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/requirements-dev.txt basepython = - py37: python3.7 py38: python3.8 py39: python3.9 py310: python3.10 From abaa938c78331ce9b8c9454b760170608532f02f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 17:50:37 +0000 Subject: [PATCH 3/6] chore: Bump actions/cache from 3.2.5 to 3.2.6 Bumps [actions/cache](https://github.com/actions/cache) from 3.2.5 to 3.2.6. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.2.5...v3.2.6) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/deploy.yaml | 2 +- .github/workflows/release.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 86ddd1c1..0214e4e3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -45,7 +45,7 @@ jobs: run: make python-virtualenv PYTHON_VIRTUALENV_DIR="venv" - name: Restoring/Saving Cache - uses: actions/cache@v3.2.5 + uses: actions/cache@v3.2.6 with: path: "venv" key: py-v1-deps-${{ runner.os }}-${{ matrix.python_version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('Makefile', 'make/**.mk') }} @@ -83,7 +83,7 @@ jobs: python-version: "${{ matrix.python_version }}" - name: Restoring/Saving Cache - uses: actions/cache@v3.2.5 + uses: actions/cache@v3.2.6 with: path: "venv" key: py-v1-deps-${{ runner.os }}-${{ matrix.python_version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('Makefile', 'make/**.mk') }} diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 37187b30..075b69cf 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -47,7 +47,7 @@ jobs: python-version: "3.10.9" - name: Restoring/Saving Cache - uses: actions/cache@v3.2.5 + uses: actions/cache@v3.2.6 with: path: "venv" key: py-v1-deps-${{ runner.os }}-${{ steps.set_up_python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('Makefile', 'make/**.mk') }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c55e9366..3a4f0d6a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -47,7 +47,7 @@ jobs: run: make python-virtualenv PYTHON_VIRTUALENV_DIR="venv" - name: Restoring/Saving Cache - uses: actions/cache@v3.2.5 + uses: actions/cache@v3.2.6 with: path: "venv" key: py-v1-deps-${{ runner.os }}-${{ steps.set_up_python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}-${{ hashFiles('Makefile', 'make/**.mk') }} From 832676110593c11cefd1f6bdf3613c328a65c758 Mon Sep 17 00:00:00 2001 From: Felipe Pinto Date: Mon, 27 Feb 2023 17:41:53 -0300 Subject: [PATCH 4/6] fix(cte): Add default values for known missing codes in SII CTE Form 29 - Add best effort validator that adds default values for missing keys. - Add file with default values. - Update related test. - Update test file. Ref: https://cordada.aha.io/features/COMPCLDATA-215 --- cl_sii/cte/f29/parse_datos_obj.py | 108 ++++++++- .../cte/f29_datos_obj_missing_key_fixes.json | 8 + tests/test_cte_f29_parse_datos_obj.py | 107 +++++++++ ...000016-datos-obj-fake-missing-code-49.json | 221 ++++++++++++++++++ 4 files changed, 435 insertions(+), 9 deletions(-) create mode 100644 cl_sii/data/cte/f29_datos_obj_missing_key_fixes.json create mode 100644 tests/test_data/sii-cte/f29/cte--61002000-3--f29-6600000016-datos-obj-fake-missing-code-49.json diff --git a/cl_sii/cte/f29/parse_datos_obj.py b/cl_sii/cte/f29/parse_datos_obj.py index 3a8a52bf..dde6aa62 100644 --- a/cl_sii/cte/f29/parse_datos_obj.py +++ b/cl_sii/cte/f29/parse_datos_obj.py @@ -1,5 +1,7 @@ from __future__ import annotations +import copy +import json from datetime import datetime from decimal import Decimal from pathlib import Path @@ -23,10 +25,17 @@ ) CTE_F29_DATOS_OBJ_SCHEMA = read_json_schema(_CTE_F29_DATOS_OBJ_SCHEMA_PATH) +_CTE_F29_DATOS_OBJ_MISSING_KEY_FIXES_PATH = ( + Path(__file__).parent.parent.parent / 'data' / 'cte' / 'f29_datos_obj_missing_key_fixes.json' +) +CTE_F29_DATOS_OBJ_MISSING_KEY_FIXES: SiiCteF29DatosObjType = json.load( + open(_CTE_F29_DATOS_OBJ_MISSING_KEY_FIXES_PATH) +) + def parse_sii_cte_f29_datos_obj( datos_obj: SiiCteF29DatosObjType, - schema_validator: Optional[Callable[[SiiCteF29DatosObjType], None]] = None, + schema_validator: Optional[Callable[[SiiCteF29DatosObjType], SiiCteF29DatosObjType]] = None, campo_deserializer: Optional[Callable[[object, str], object]] = None, ) -> CteForm29: """ @@ -55,7 +64,7 @@ def parse_sii_cte_f29_datos_obj( def _parse_sii_cte_f29_datos_obj_to_dict( datos_obj: SiiCteF29DatosObjType, - schema_validator: Callable[[SiiCteF29DatosObjType], None], + schema_validator: Callable[[SiiCteF29DatosObjType], SiiCteF29DatosObjType], campo_deserializer: Callable[[object, str], object], ) -> Mapping[str, object]: """ @@ -67,17 +76,17 @@ def _parse_sii_cte_f29_datos_obj_to_dict( :param campo_deserializer: :raises JsonSchemaValidationError: If schema validation fails. """ - schema_validator(datos_obj) + validated_datos_obj = schema_validator(datos_obj) datos_obj_campos: Mapping[int, str] = { - int(code): str(value) for code, value in datos_obj['campos'].items() + int(code): str(value) for code, value in validated_datos_obj['campos'].items() } - datos_obj_extras: Mapping[str, object] = datos_obj['extras'] + datos_obj_extras: Mapping[str, object] = validated_datos_obj['extras'] datos_obj_glosa: Mapping[int, str] = { # noqa: F841 - int(code): str(value) for code, value in datos_obj['glosa'].items() + int(code): str(value) for code, value in validated_datos_obj['glosa'].items() } datos_obj_tipos: Mapping[int, str] = { - int(code): str(value) for code, value in datos_obj['tipos'].items() + int(code): str(value) for code, value in validated_datos_obj['tipos'].items() } deserialized_datos_obj_campos = { @@ -156,12 +165,14 @@ def cte_f29_datos_obj_campo_best_effort_deserializer(campo_value: object, tipo: return deserialized_value -def cte_f29_datos_schema_default_validator(datos_obj: SiiCteF29DatosObjType) -> None: +def cte_f29_datos_schema_default_validator( + datos_obj: SiiCteF29DatosObjType, +) -> SiiCteF29DatosObjType: """ Validate the ``datos`` object against the schema. :raises JsonSchemaValidationError: If schema validation fails. - :returns: ``None`` if schema validation passed. + :returns: Validated ``datos`` object if schema validation passed. """ try: jsonschema.validate(datos_obj, schema=CTE_F29_DATOS_OBJ_SCHEMA) @@ -172,3 +183,82 @@ def cte_f29_datos_schema_default_validator(datos_obj: SiiCteF29DatosObjType) -> raise JsonSchemaValidationError("The keys of 'campos' and 'tipos' are not exactly the same") if datos_obj['campos'].keys() != datos_obj['glosa'].keys(): raise JsonSchemaValidationError("The keys of 'campos' and 'tipos' are not exactly the same") + + return datos_obj + + +def cte_f29_datos_schema_best_effort_validator( + datos_obj: SiiCteF29DatosObjType, +) -> SiiCteF29DatosObjType: + """ + Validate the ``datos`` object against the schema. + + If there are missing keys in the `tipos` or `glosa` dicts, it will try to get them + from a list of default values. + + :raises JsonSchemaValidationError: If schema validation fails. + :returns: Validated ``datos`` object if schema validation passed. + """ + try: + validated_datos_obj = cte_f29_datos_schema_default_validator(datos_obj) + except JsonSchemaValidationError as exc: + if exc.__cause__ is jsonschema.exceptions.ValidationError: + # We will not try to fix this kind of error. + raise + elif exc.__cause__ is None: + # Let's try to fix this. + new_datos_obj = try_fix_cte_f29_datos(datos_obj) + + # Let's try again. + cte_f29_datos_schema_default_validator(new_datos_obj) + return new_datos_obj + else: + raise + else: + return validated_datos_obj + + +def try_fix_cte_f29_datos(datos_obj: SiiCteF29DatosObjType) -> SiiCteF29DatosObjType: + """ + Try to fix the ``datos`` object. + + If there are missing keys in the `tipos` or `glosa` dicts, it will try to get them + from a list of default values. + + :raises JsonSchemaValidationError: If an unfixable issue is found. + :returns: A possibly fixed ``datos`` object. + """ + new_datos_obj: Mapping[str, MutableMapping[str, object]] + new_datos_obj = copy.deepcopy(datos_obj) # type: ignore[arg-type] + + campos_tipos_keys_diff = datos_obj['campos'].keys() - datos_obj['tipos'].keys() + remaining_campos_tipos_diff = ( + campos_tipos_keys_diff - CTE_F29_DATOS_OBJ_MISSING_KEY_FIXES['tipos'].keys() + ) + if remaining_campos_tipos_diff: + raise JsonSchemaValidationError( + "The keys of 'campos' and 'tipos' differ for the following codes: " + f"{remaining_campos_tipos_diff}" + ) + else: + for missing_key in campos_tipos_keys_diff: + new_datos_obj['tipos'][missing_key] = CTE_F29_DATOS_OBJ_MISSING_KEY_FIXES['tipos'][ + missing_key + ] + + campos_glosa_keys_diff = datos_obj['campos'].keys() - datos_obj['glosa'].keys() + remaining_campos_glosa_diff = ( + campos_glosa_keys_diff - CTE_F29_DATOS_OBJ_MISSING_KEY_FIXES['glosa'].keys() + ) + if remaining_campos_glosa_diff: + raise JsonSchemaValidationError( + "The keys of 'campos' and 'glosa' differ for the following codes: " + f"{remaining_campos_glosa_diff}" + ) + else: + for missing_key in campos_glosa_keys_diff: + new_datos_obj['glosa'][missing_key] = CTE_F29_DATOS_OBJ_MISSING_KEY_FIXES['glosa'][ + missing_key + ] + + return new_datos_obj diff --git a/cl_sii/data/cte/f29_datos_obj_missing_key_fixes.json b/cl_sii/data/cte/f29_datos_obj_missing_key_fixes.json new file mode 100644 index 00000000..41fd122d --- /dev/null +++ b/cl_sii/data/cte/f29_datos_obj_missing_key_fixes.json @@ -0,0 +1,8 @@ +{ + "glosa": { + "049": "(Desconocido)" + }, + "tipos": { + "049": "M" + } +} diff --git a/tests/test_cte_f29_parse_datos_obj.py b/tests/test_cte_f29_parse_datos_obj.py index a567ebe2..8e34bd86 100644 --- a/tests/test_cte_f29_parse_datos_obj.py +++ b/tests/test_cte_f29_parse_datos_obj.py @@ -216,3 +216,110 @@ def test_full_2(self) -> None: "fecha_presentacion": datetime.date(2019, 1, 22), } self.assertEqual(dict(obj), expected_dict) + + def test_full_3_file_with_missing_value(self) -> None: + datos_obj: Mapping[str, Any] = read_test_file_json_dict( + 'test_data/sii-cte/f29/cte--61002000-3--f29-6600000016-datos-obj-fake-missing-code-49.json', # noqa: E501 + ) + obj = parse_datos_obj.parse_sii_cte_f29_datos_obj( + datos_obj=datos_obj, + schema_validator=parse_datos_obj.cte_f29_datos_schema_best_effort_validator, + ) + + self.assertIsInstance(obj, data_models.CteForm29) + self.assertEqual(obj.contribuyente_rut, Rut('61002000-3')) + self.assertEqual(obj.periodo_tributario, PeriodoTributario(year=2017, month=7)) + self.assertEqual(obj.folio, 6600000016) + + expected_codes_dict = { + 1: "SERVICIO DE REGISTRO CIVIL E IDENTIFICACION", + 3: Rut('61002000-3'), + 6: "HUERFANOS 1570", + 7: 6600000016, + 8: "SANTIAGO", + 15: PeriodoTributario(year=2017, month=7), + 30: 723122062, + 48: 1409603, + 49: 211345, + 60: 70, + 89: 0, + 77: 11429763, + 91: 1536269, + 92: 0, + 93: 224400, + 94: 1603589, + 151: 126666, + 315: datetime.date(2017, 8, 28), + 502: 6588397, + 503: 9, + 504: 17037344, + 511: 980816, + 519: 30, + 520: 1481178, + 527: 2, + 528: 512805, + 537: 18018160, + 538: 6588397, + 547: 1536269, + 562: 17296416, + 584: 10, + 595: 1536269, + 761: 1, + 762: 12443, + 795: 157080, + 915: datetime.date(2017, 10, 31), + 922: "013-2015", + } + self.assertEqual(obj.as_codes_dict(include_none=False), expected_codes_dict) + + expected_dict = { + "contribuyente_rut": Rut('61002000-3'), + "periodo_tributario": PeriodoTributario(year=2017, month=7), + "folio": 6600000016, + "apellido_paterno_o_razon_social": "SERVICIO DE REGISTRO CIVIL E IDENTIFICACION", + "apellido_materno": None, + "nombres": None, + "calle_direccion": "HUERFANOS 1570", + "numero_direccion": None, + "comuna_direccion": "SANTIAGO", + "telefono": None, + "correo_electronico": None, + "representante_legal_rut": None, + "extra": { + 30: 723122062, + 48: 1409603, + 49: 211345, + 77: 11429763, + 89: 0, + 92: 0, + 93: 224400, + 151: 126666, + 502: 6588397, + 503: 9, + 504: 17037344, + 511: 980816, + 519: 30, + 520: 1481178, + 527: 2, + 528: 512805, + 537: 18018160, + 538: 6588397, + 547: 1536269, + 562: 17296416, + 584: 10, + 595: 1536269, + 761: 1, + 762: 12443, + 795: 157080, + }, + "total_a_pagar_en_plazo_legal": 1536269, + "total_a_pagar_con_recargo": 1603589, + "pct_condonacion": 70, + "num_res_condonacion": "013-2015", + "fecha_condonacion": datetime.date(2017, 10, 31), + "tipo_declaracion": "Primitiva", + "banco": "Banco del Patito Amarillo", + "medio_pago": "PEL", + "fecha_presentacion": datetime.date(2017, 8, 28), + } + self.assertEqual(dict(obj), expected_dict) diff --git a/tests/test_data/sii-cte/f29/cte--61002000-3--f29-6600000016-datos-obj-fake-missing-code-49.json b/tests/test_data/sii-cte/f29/cte--61002000-3--f29-6600000016-datos-obj-fake-missing-code-49.json new file mode 100644 index 00000000..238c32d8 --- /dev/null +++ b/tests/test_data/sii-cte/f29/cte--61002000-3--f29-6600000016-datos-obj-fake-missing-code-49.json @@ -0,0 +1,221 @@ +{ + "campos": { + "001": "SERVICIO DE REGISTRO CIVIL E IDENTIFICACION", + "003": "61002000-3", + "006": "HUERFANOS 1570", + "007": "6600000016", + "008": "SANTIAGO", + "015": "201707", + "030": "723122062", + "048": "1409603", + "049": "211345", + "060": "70", + "077": "11429763", + "089": "0", + "091": "1536269", + "092": "0", + "093": "224400", + "094": "1603589", + "151": "126666", + "315": "28/08/2017", + "502": "6588397", + "503": "9", + "504": "17037344", + "511": "980816", + "519": "30", + "520": "1481178", + "527": "2", + "528": "512805", + "537": "18018160", + "538": "6588397", + "547": "1536269", + "562": "17296416", + "584": "10", + "595": "1536269", + "761": "1", + "762": "12443", + "795": "157080", + "915": "31/10/2017", + "922": "013-2015" + }, + "extras": { + "ADM8703": "", + "ADM8721": "", + "BANCO": "Banco del Patito Amarillo", + "CALIDADDECLARANTE": "Contribuyente", + "CARTRIB": "1", + "CLASE": "Primitiva", + "CODINT": "580000019", + "COD_FORM": "F29", + "DV_ORIGEN": "3", + "FECHA_HOY": "16/10/2019", + "FECHA_INGRESO": "28082017", + "FOLIO": "6600000016", + "MEDIO_INGRESO": "INTERNET", + "MEDIO_PAGO": "PEL", + "MOSTRAR_FOLIO": "1", + "NOMBRES": " SERVICIO DE REGISTRO CIVIL E IDENTIFICACION ", + "NOMBRE_FUN": " ", + "OPCION": "VC", + "PERIODO": "201707", + "RUT_ORIGEN": "61002000", + "TIPO_MOVIMIENTO": "1", + "TOKEN": "VFC", + "USUARIO": "0", + "cant_anuladas": 0 + }, + "folioF": {}, + "glosa": { + "001": "APELLIDO PATERNO O RAZ\u00d3N SOCIAL", + "003": "N DE RUT", + "006": "DIRECCION", + "007": "FOLIO", + "008": "COMUNA", + "015": "PERIODO TRIBUTARIO", + "030": "PPM ART. 84, A) PERD. ART. 90", + "048": "RET. IMP. \u00daNICO TRAB. ART. 74 N 1 LIR", + "060": "PORCENTAJE CONDONACION TGR", + "077": "REMANENTE DE CR\u00c9DITO FISC.", + "089": "IMP. DETERM. IVA DETERM.", + "091": "TOTAL A PAGAR DENTRO DEL PLAZO", + "092": "REAJUSTES", + "093": "Intereses y multas", + "094": "Total a pagar con recargo", + "151": "RET, TASAS DE 10 % SOBRE LAS RENT. ", + "315": "FECHA TIMBRE CAJA", + "502": "D\u00c9BITOS FACTURAS EMITIDAS", + "503": "CANTIDAD FACTURAS EMITIDAS", + "504": "REMANENTE CREDITO MES ANTERIOR", + "511": "CR\u00c9D. IVA POR DCTOS. ELECTRONICOS", + "519": "CANT. DE DCTOS. FACT. RECIB. DEL GIRO", + "520": "CR\u00c9DITO REC. Y REINT./FACT. DEL GIRO", + "527": "CANT. NOTAS DE CR\u00c9DITO RECIBIDAS", + "528": "CR\u00c9DITO RECUP. Y REINT NOTAS DE CR\u00c9D", + "537": "TOTAL CR\u00c9DITOS", + "538": "TOTAL D\u00c9BITOS", + "547": "TOTAL DETERMINADO", + "562": "MONTO SIN DER. A CRED. FISCAL", + "584": "CANT.INT.EX.NO GRAV.SIN DER. CRED.FISCAL", + "595": "SUB TOTAL IMP. DETERMINADO ANVERSO", + "761": "CANT. FACT. SUPERMERCADOS Y SIMILARES", + "762": "CR\u00c9D. FACT. SUPERMERCADOS Y SIMILARES", + "795": "MONTO DE CONDONACION SII", + "915": "Fecha de Vigencia de Condonacion", + "922": "NUMERO RESOLUCION SII AUTO. CONDONACION" + }, + "justif": { + "001": "I", + "003": "I", + "006": "I", + "007": "I", + "008": "I", + "015": "I", + "030": "I", + "048": "I", + "060": "I", + "077": "I", + "089": "D", + "091": "-", + "092": "-", + "093": "-", + "094": "-", + "151": "I", + "315": "I", + "502": "D", + "503": "I", + "504": "D", + "511": "I", + "519": "I", + "520": "D", + "527": "I", + "528": "D", + "537": "D", + "538": "D", + "547": "D", + "562": "D", + "584": "I", + "595": "D", + "761": "I", + "762": "D", + "795": "I", + "915": "-", + "922": "-" + }, + "linea": { + "001": "0", + "003": "0", + "006": "0", + "007": "0", + "008": "0", + "015": "0", + "030": "56", + "048": "49", + "049": "0", + "060": "0", + "077": "47", + "089": "47", + "091": "119", + "092": "120", + "093": "121", + "094": "122", + "151": "50", + "315": "0", + "502": "7", + "503": "7", + "504": "33", + "511": "23", + "519": "27", + "520": "27", + "527": "29", + "528": "29", + "537": "46", + "538": "22", + "547": "104", + "562": "26", + "584": "26", + "595": "74", + "761": "27", + "762": "27", + "795": "0", + "915": "0", + "922": "0" + }, + "tipos": { + "001": "C", + "003": "R", + "006": "C", + "007": "N", + "008": "C", + "015": "N", + "030": "M", + "048": "M", + "060": "N", + "077": "M", + "089": "M", + "091": "M", + "092": "M", + "093": "M", + "094": "M", + "151": "M", + "315": "F", + "502": "M", + "503": "N", + "504": "M", + "511": "M", + "519": "N", + "520": "M", + "527": "N", + "528": "M", + "537": "M", + "538": "M", + "547": "M", + "562": "M", + "584": "N", + "595": "M", + "761": "N", + "762": "M", + "795": "M", + "915": "F", + "922": "C" + } + } From 86129e0e963e2c2462fa034a31a5eadce9afcc5f Mon Sep 17 00:00:00 2001 From: Felipe Pinto Date: Thu, 9 Mar 2023 11:15:24 -0300 Subject: [PATCH 5/6] chore: Update history for new version --- HISTORY.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 5142e8e5..b9c2d767 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,12 @@ # History +## 0.22.0 (2023-03-09) + +- (PR #446, 2023-03-07) chore(deps-dev): Bump mypy from 0.991 to 1.0.1 +- (PR #449, 2023-03-08) Drop support for Python 3.7 +- (PR #442, 2023-03-09) chore: Bump actions/cache from 3.2.5 to 3.2.6 +- (PR #440, 2023-03-09) fix(cte): Add default values for known missing codes in SII CTE Form 29 + ## 0.21.0 (2023-02-28) - (PR #441, 2023-03-01) Switch CI/CD from CircleCI to GitHub Actions From 5bf633ac23eb01142ffd84983a9e77ffc7af9201 Mon Sep 17 00:00:00 2001 From: Felipe Pinto Date: Thu, 9 Mar 2023 11:15:39 -0300 Subject: [PATCH 6/6] chore: Bump version from 0.21.0 to 0.22.0 --- .bumpversion.cfg | 2 +- cl_sii/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 285c5889..8cc39baf 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.21.0 +current_version = 0.22.0 commit = True tag = False message = chore: Bump version from {current_version} to {new_version} diff --git a/cl_sii/__init__.py b/cl_sii/__init__.py index ae8b4c36..f27862d8 100644 --- a/cl_sii/__init__.py +++ b/cl_sii/__init__.py @@ -5,4 +5,4 @@ """ -__version__ = '0.21.0' +__version__ = '0.22.0'