|
3 | 3 | ================
|
4 | 4 |
|
5 | 5 | """
|
| 6 | +from __future__ import annotations |
| 7 | + |
| 8 | +import enum |
| 9 | + |
6 | 10 | import pytz
|
7 | 11 |
|
8 | 12 | from cl_sii.libs.tz_utils import PytzTimezone
|
|
11 | 15 | TZ_CL_SANTIAGO: PytzTimezone = pytz.timezone('America/Santiago')
|
12 | 16 |
|
13 | 17 | SII_OFFICIAL_TZ = TZ_CL_SANTIAGO
|
| 18 | + |
| 19 | + |
| 20 | +class XmlSchemasVersionEnum(enum.Enum): |
| 21 | + """ |
| 22 | + Enum of "SII XML Schema Version". |
| 23 | + The version name is selected considering the last updated timestamp |
| 24 | + of the files in the set |
| 25 | +
|
| 26 | + """ |
| 27 | + |
| 28 | + V2017_10_23_LIBRE_DTE = '2017_10_23_libre_dte' |
| 29 | + """ |
| 30 | + Incremental update to version V2013_02_07_SII_OFFICIAL, from an unofficial |
| 31 | + source since the files available on the SII website are outdated with respect |
| 32 | + to the regulations (and even the documentation PDFs published alongside) |
| 33 | +
|
| 34 | + Source: repository/project "LibreDTE" at https://github.com/LibreDTE/libredte-lib |
| 35 | +
|
| 36 | + Most recent modification timestamp of the XML schemas: 2017-10-23 |
| 37 | + """ |
| 38 | + |
| 39 | + V2013_02_07_SII_OFFICIAL = '2013_02_07_sii_official' |
| 40 | + """ |
| 41 | + Official schemas of entities related to these domain concepts: |
| 42 | + - DTE (Documento Tributario Electrónico) |
| 43 | + - IECV (Información Electrónica de Libros de Compra y Venta) |
| 44 | + - LCE (Libros Contables Electrónicos) |
| 45 | + - RTC (Registro de Transferencia de Crédito) |
| 46 | +
|
| 47 | + All the files have been preserved as they were; schemas are in their |
| 48 | + original text encoding (ISO-8859-1) and have not been modified in the |
| 49 | + slightest way. |
| 50 | +
|
| 51 | + Sources (2021-04-19): |
| 52 | + http://www.sii.cl/factura_electronica/schema_dte.zip |
| 53 | + http://www.sii.cl/factura_electronica/schema_iecv.zip |
| 54 | + http://www.sii.cl/factura_electronica/schema_cesion.zip |
| 55 | +
|
| 56 | + Most recent modification timestamp of the XML schemas: 2013-02-07 |
| 57 | + """ |
| 58 | + |
| 59 | + @classmethod |
| 60 | + def latest(cls) -> XmlSchemasVersionEnum: |
| 61 | + """Reference to the latest version available""" |
| 62 | + return cls.V2017_10_23_LIBRE_DTE |
0 commit comments