Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[bumpversion]
current_version = 0.77.0
current_version = 0.78.0
commit = True
tag = False
message = chore: Bump version from {current_version} to {new_version}

[bumpversion:file:src/cl_sii/__init__.py]

6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v6.0.2
uses: actions/checkout@v6.0.3

- name: Set Up Python ${{ matrix.python_version }}
id: set_up_python
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v6.0.2
uses: actions/checkout@v6.0.3

- name: Set Up Python ${{ matrix.python_version }}
id: set_up_python
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
make test-coverage-report

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./test-reports/coverage/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v6.0.2
uses: actions/checkout@v6.0.3

- name: Dependency Review
uses: actions/dependency-review-action@v4.9.0
uses: actions/dependency-review-action@v5.0.0
with:
fail-on-severity: critical
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v6.0.2
uses: actions/checkout@v6.0.3

- name: Set Up Python
id: set_up_python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v6.0.2
uses: actions/checkout@v6.0.3

- name: Set Up Python
id: set_up_python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/task-release-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Check Out VCS Repository
uses: actions/checkout@v6.0.2
uses: actions/checkout@v6.0.3
with:
ref: ${{ env.CREATE_RELEASE_VCS_REVISION_ID }}

Expand Down
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# History

## 0.78.0 (2026-06-08)

- (PR #1031, 2026-05-28) chore(deps): Bump build from 1.4.2 to 1.4.4 in the python-development group
- (PR #1039, 2026-06-02) chore(deps): Bump the github-actions-production group with 2 updates
- (PR #1040, 2026-06-05) dte: Add TipoDte 110, 111, 112
- (PR #1042, 2026-06-08) chore(deps): Bump the codecov to 7.0.0 - actions/checkout to 6.0.3

## 0.77.0 (2026-05-28)

- (PR #1030, 2026-05-11) chore(deps): Bump the github-actions-production group with 2 updates
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-c requirements.txt

black==25.11.0
build==1.4.2
build==1.4.4
bumpversion==0.5.3
coverage==7.10.7
flake8==7.3.0
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ black==25.11.0
# via -r requirements-dev.in
bleach==5.0.1
# via readme-renderer
build==1.4.2
build==1.4.4
# via
# -r requirements-dev.in
# pip-tools
Expand Down
2 changes: 1 addition & 1 deletion src/cl_sii/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

"""

__version__ = '0.77.0'
__version__ = '0.78.0'
35 changes: 27 additions & 8 deletions src/cl_sii/dte/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,20 @@ class TipoDte(enum.IntEnum):
"""Nota electrónica de crédito."""
# aka 'Nota de Crédito Electrónica'

# TODO: add
# 110 Factura de exportación electrónica
# 111 Nota de débito de exportación electrónica
# 112 Nota de crédito de exportación electrónica
# https://github.com/fyntex/lib-cl-sii-python/blob/f57a326/cl_sii/data/ref/factura_electronica/schemas-xml/SiiTypes_v10.xsd#L58-L60
# https://github.com/fyntex/lib-cl-sii-python/blob/f57a326/cl_sii/data/ref/factura_electronica/schemas-xml/SiiTypes_v10.xsd#L708-L717
# See 'cl_sii.rcv.constants.RcvTipoDocto'
# Should 'is_factura' be true for a "Factura de exportación electrónica" (110) ?
FACTURA_EXPORTACION_ELECTRONICA = 110
"""Factura de exportación electrónica."""
# https://github.com/fyntex/lib-cl-sii-python/blob/f57a326/cl_sii/data/ref/factura_electronica/schemas-xml/SiiTypes_v10.xsd#L58
# https://github.com/fyntex/lib-cl-sii-python/blob/f57a326/cl_sii/data/ref/factura_electronica/schemas-xml/SiiTypes_v10.xsd#L713

NOTA_DEBITO_EXPORTACION_ELECTRONICA = 111
"""Nota de débito de exportación electrónica."""
# https://github.com/fyntex/lib-cl-sii-python/blob/f57a326/cl_sii/data/ref/factura_electronica/schemas-xml/SiiTypes_v10.xsd#L59
# https://github.com/fyntex/lib-cl-sii-python/blob/f57a326/cl_sii/data/ref/factura_electronica/schemas-xml/SiiTypes_v10.xsd#L714

NOTA_CREDITO_EXPORTACION_ELECTRONICA = 112
"""Nota de crédito de exportación electrónica."""
# https://github.com/fyntex/lib-cl-sii-python/blob/f57a326/cl_sii/data/ref/factura_electronica/schemas-xml/SiiTypes_v10.xsd#L60
# https://github.com/fyntex/lib-cl-sii-python/blob/f57a326/cl_sii/data/ref/factura_electronica/schemas-xml/SiiTypes_v10.xsd#L715

@property
def is_factura(self) -> bool:
Expand All @@ -166,6 +172,8 @@ def is_factura(self) -> bool:
result = True
elif self is TipoDte.LIQUIDACION_FACTURA_ELECTRONICA:
result = True
elif self is TipoDte.FACTURA_EXPORTACION_ELECTRONICA:
result = True
else:
result = False

Expand All @@ -179,6 +187,8 @@ def is_factura_venta(self) -> bool:
result = True
elif self is TipoDte.LIQUIDACION_FACTURA_ELECTRONICA:
result = True
elif self is TipoDte.FACTURA_EXPORTACION_ELECTRONICA:
result = True
else:
result = False

Expand All @@ -199,6 +209,10 @@ def is_nota(self) -> bool:
result = True
elif self is TipoDte.NOTA_CREDITO_ELECTRONICA:
result = True
elif self is TipoDte.NOTA_DEBITO_EXPORTACION_ELECTRONICA:
result = True
elif self is TipoDte.NOTA_CREDITO_EXPORTACION_ELECTRONICA:
result = True
else:
result = False

Expand Down Expand Up @@ -295,6 +309,9 @@ def receptor_is_vendedor(self) -> bool:
TipoDte.NOTA_CREDITO_ELECTRONICA,
TipoDte.NOTA_DEBITO_ELECTRONICA,
TipoDte.FACTURA_COMPRA_ELECTRONICA,
TipoDte.FACTURA_EXPORTACION_ELECTRONICA,
TipoDte.NOTA_DEBITO_EXPORTACION_ELECTRONICA,
TipoDte.NOTA_CREDITO_EXPORTACION_ELECTRONICA,
}
)

Expand Down Expand Up @@ -345,6 +362,8 @@ def receptor_is_vendedor(self) -> bool:
{
TipoDte.NOTA_CREDITO_ELECTRONICA,
TipoDte.NOTA_DEBITO_ELECTRONICA,
TipoDte.NOTA_DEBITO_EXPORTACION_ELECTRONICA,
TipoDte.NOTA_CREDITO_EXPORTACION_ELECTRONICA,
}
)

Expand Down
54 changes: 54 additions & 0 deletions src/tests/test_dte_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,57 @@ def test_NOTA_CREDITO_ELECTRONICA(self) -> None:

for result, expected in assertions:
self.assertTrue(result is expected)

def test_FACTURA_EXPORTACION_ELECTRONICA(self) -> None:
value = self.TipoDte.FACTURA_EXPORTACION_ELECTRONICA

self.assertEqual(value.name, 'FACTURA_EXPORTACION_ELECTRONICA')
self.assertEqual(value.value, 110)

assertions = [
(value.is_factura, True),
(value.is_factura_venta, True),
(value.is_factura_compra, False),
(value.is_nota, False),
(value.emisor_is_vendedor, True),
(value.receptor_is_vendedor, False),
]

for result, expected in assertions:
self.assertTrue(result is expected)

def test_NOTA_DEBITO_EXPORTACION_ELECTRONICA(self) -> None:
value = self.TipoDte.NOTA_DEBITO_EXPORTACION_ELECTRONICA

self.assertEqual(value.name, 'NOTA_DEBITO_EXPORTACION_ELECTRONICA')
self.assertEqual(value.value, 111)

assertions = [
(value.is_factura, False),
(value.is_factura_venta, False),
(value.is_factura_compra, False),
(value.is_nota, True),
(value.emisor_is_vendedor, False),
(value.receptor_is_vendedor, False),
]

for result, expected in assertions:
self.assertTrue(result is expected)

def test_NOTA_CREDITO_EXPORTACION_ELECTRONICA(self) -> None:
value = self.TipoDte.NOTA_CREDITO_EXPORTACION_ELECTRONICA

self.assertEqual(value.name, 'NOTA_CREDITO_EXPORTACION_ELECTRONICA')
self.assertEqual(value.value, 112)

assertions = [
(value.is_factura, False),
(value.is_factura_venta, False),
(value.is_factura_compra, False),
(value.is_nota, True),
(value.emisor_is_vendedor, False),
(value.receptor_is_vendedor, False),
]

for result, expected in assertions:
self.assertTrue(result is expected)
12 changes: 12 additions & 0 deletions src/tests/test_rcv_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ def test_as_tipo_dte(self) -> None:
self.RcvTipoDocto.FACTURA_ELECTRONICA.as_tipo_dte(),
TipoDte.FACTURA_ELECTRONICA,
)
self.assertEqual(
self.RcvTipoDocto.FACTURA_EXPORTACION_ELECTRONICA.as_tipo_dte(),
TipoDte.FACTURA_EXPORTACION_ELECTRONICA,
)
self.assertEqual(
self.RcvTipoDocto.NOTA_DEBITO_EXPORTACION_ELECTRONICA.as_tipo_dte(),
TipoDte.NOTA_DEBITO_EXPORTACION_ELECTRONICA,
)
self.assertEqual(
self.RcvTipoDocto.NOTA_CREDITO_EXPORTACION_ELECTRONICA.as_tipo_dte(),
TipoDte.NOTA_CREDITO_EXPORTACION_ELECTRONICA,
)

with self.assertRaises(ValueError) as cm:
self.RcvTipoDocto.FACTURA.as_tipo_dte()
Expand Down
35 changes: 35 additions & 0 deletions src/tests/test_rcv_data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,41 @@ def test_get_documento_referencia_dte_natural_keys(self) -> None:

self.assertEqual(expected_doc_ref_dte_natural_key, actual_doc_ref_dte_natural_key)

# Detalle Entry that references an export DTE:

rv_detalle_entry_with_export_doc_ref = dataclasses.replace(
rv_detalle_entry,
tipo_docto=RcvTipoDocto.FACTURA_EXPORTACION_ELECTRONICA,
folio=2233,
documento_referencias=[
DocumentoReferencia(
tipo_documento_referencia=RcvTipoDocto.FACTURA_EXPORTACION_ELECTRONICA,
folio_documento_referencia=12345,
)
],
)
self.assertEqual(
cl_sii.dte.data_models.DteNaturalKey(
emisor_rut=Rut('76354771-K'),
tipo_dte=cl_sii.dte.constants.TipoDte.FACTURA_EXPORTACION_ELECTRONICA,
folio=2233,
),
rv_detalle_entry_with_export_doc_ref.as_dte_data_l2().natural_key,
)

expected_doc_ref_dte_natural_key = [
cl_sii.dte.data_models.DteNaturalKey(
emisor_rut=Rut('76354771-K'),
tipo_dte=cl_sii.dte.constants.TipoDte.FACTURA_EXPORTACION_ELECTRONICA,
folio=12345,
)
]
actual_doc_ref_dte_natural_key = (
rv_detalle_entry_with_export_doc_ref.get_documento_referencia_dte_natural_keys()
)

self.assertEqual(expected_doc_ref_dte_natural_key, actual_doc_ref_dte_natural_key)

# Detalle Entry that references a documento that is a valid DTE
# but not a valid RCV Tipo de Documento:

Expand Down
Loading