Skip to content

Commit e34b569

Browse files
committed
rtc.data_models_aec: remove match validation for 'fecha_firma_dt' and 'fecha_cesion_dt'
The coincidence between the fields 'fecha_firma_dt' and 'fecha_cesion_dt' in a 'cesion' is not mentioned among the validations that the SII performs to accept an AEC XML Document, in fact, there are known cases of valid AEC XML Documents where these fields do not have the same date, with a slight difference of one second, but still, the AEC is valid for the SII. Ref. Instructivo Técnico Registro Público Electrónico de Transferencia de Crédito (retrieved on 2021-03-03) Source: (https://www.sii.cl/factura_electronica/ins_tecnico.pdf)
1 parent 0d54e13 commit e34b569

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

cl_sii/rtc/data_models_aec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ def validate_last_cesion_matches_some_fields(
746746
) -> Mapping[str, object]:
747747
field_validations: Sequence[Tuple[str, str]] = [
748748
# (AecXml field, CesionAecXml field):
749-
('fecha_firma_dt', 'fecha_cesion_dt'),
749+
# ('fecha_firma_dt', 'fecha_cesion_dt'),
750750
('cedente_rut', 'cedente_rut'),
751751
('cesionario_rut', 'cesionario_rut'),
752752
]

tests/test_rtc_data_models_aec.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -660,24 +660,18 @@ def test_validate_last_cesion_matches_some_fields(self) -> None:
660660
{
661661
'loc': ('__root__',),
662662
'msg':
663-
"'fecha_cesion_dt' of last 'cesion' must match 'fecha_firma_dt':"
664-
" datetime.datetime("
665-
"2019, 4, 5, 12, 57, 32,"
666-
" tzinfo=<DstTzInfo 'America/Santiago' -03-1 day, 21:00:00 DST>"
667-
")"
663+
"'cedente_rut' of last 'cesion' must match 'cedente_rut':"
664+
" Rut('76389992-6')"
668665
" !="
669-
" datetime.datetime("
670-
"2019, 4, 5, 12, 0, 32,"
671-
" tzinfo=<DstTzInfo 'America/Santiago' -03-1 day, 21:00:00 DST>"
672-
").",
666+
" Rut('76598556-0').",
673667
'type': 'value_error',
674668
},
675669
]
676670

677671
with self.assertRaises(pydantic.ValidationError) as assert_raises_cm:
678672
dataclasses.replace(
679673
obj,
680-
fecha_firma_dt=obj.fecha_firma_dt.replace(minute=0), # Original minute is 57.
674+
cedente_rut=obj.cesionario_rut,
681675
)
682676

683677
validation_errors = assert_raises_cm.exception.errors()

0 commit comments

Comments
 (0)