Skip to content

cte: SII Form 29 "datos" object may contain field codes with four digits #93

@jtrh

Description

@jtrh

Problem 1

The schema validates SII Form 29 codes using a regex that matches strings with three digits. New information has shown that codes with four digits are possible.

Problem 2

If problem 1 is fixed, a new problem occurs: The value of the four-digit code 9906 is a date-formatted string ("22/01/2019"), but the data type specified by the SII in the datos object is number (N), not date (F), which causes an error when the code attempts to convert the string value to an integer: ValueError: invalid literal for int() with base 10: '22/01/2019'.

Example for Problems 1 and 2

{
  "campos": {
    "001": "D***",
    "...": "...",
    "596": "0",
    "9906": "22/01/2019"
  },
  "extras": {
    "ADM8703": "",
    "ADM8721": "",
    "BANCO": "",
    "CALIDADDECLARANTE": "Contribuyente",
    "CARTRIB": "1",
    "CLASE": "Rectificatoria con Giro",
    "CODINT": "59*****52",
    "COD_FORM": "F29",
    "DV_ORIGEN": "5",
    "FECHA_HOY": "17/01/2020",
    "FECHA_INGRESO": "22012019",
    "FOLIO": "67******56",
    "MEDIO_INGRESO": "INTERNET",
    "MEDIO_PAGO": "",
    "MOSTRAR_FOLIO": "1",
    "NOMBRES": "C******* *** C***** D*** Z*****",
    "NOMBRE_FUN": "  ",
    "OPCION": "VC",
    "PERIODO": "201812",
    "RUT_ORIGEN": "10****00",
    "TIPO_MOVIMIENTO": "5",
    "TOKEN": "VFC",
    "USUARIO": "0",
    "cant_anuladas": 1
  },
  "folioF": {
    "COD_9902_1": "67******46"
  },
  "glosa": {
    "001": "APELLIDO PATERNO O RAZÓN SOCIAL",
    "...": "...",
    "596": "RETENCION CAMBIO DE SUJETO",
    "9906": "FECHA PRESENTACION DECL. PRIMITIVA "
  },
  "justif": {
    "001": "I",
    "...": "...",
    "596": "D",
    "9906": "I"
  },
  "linea": {
    "001": "0",
    "...": "...",
    "596": "111",
    "9906": "118"
  },
  "tipos": {
    "001": "C",
    "...": "...",
    "596": "M",
    "9906": "N"
  }
}

Ref: Internal ID: a7de52c9-7bc4-4f53-8d06-8e7e2a36be8f

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions