Skip to content

Commit 3f760c0

Browse files
Merge pull request #859 from cordada/task/sc-16111-parse-rcvdata-to-create-entrada-registro-ventas
rcv: Enhance "RCV Ventas" CSV parsing and add schema fields
2 parents 49d3cf7 + d0b002c commit 3f760c0

File tree

4 files changed

+627
-77
lines changed

4 files changed

+627
-77
lines changed

src/cl_sii/rcv/data_models.py

Lines changed: 174 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,22 +246,187 @@ class RvDetalleEntry(RcvDetalleEntry):
246246
# constants
247247
###########################################################################
248248

249-
DATETIME_FIELDS_TZ = SII_OFFICIAL_TZ
249+
RCV_KIND: ClassVar[RcvKind] = RcvKind.VENTAS
250250

251-
RCV_KIND = RcvKind.VENTAS
252-
RC_ESTADO_CONTABLE = None
251+
tipo_venta: str
252+
"""
253+
Tipo Venta
254+
"""
253255

254-
# TODO: docstring
255-
# TODO: can it be None? What happens for those "tipo docto" that do not have a receptor?
256256
receptor_razon_social: str
257+
"""
258+
Razon Social
259+
"""
257260

258-
# TODO: docstring
259-
# note: must be timezone-aware.
260261
fecha_acuse_dt: Optional[datetime]
262+
"""
263+
Fecha Acuse Recibo (must be timezone aware)
264+
"""
261265

262-
# TODO: docstring
263-
# note: must be timezone-aware.
264266
fecha_reclamo_dt: Optional[datetime]
267+
"""
268+
Fecha Reclamo (must be timezone aware)
269+
"""
270+
271+
monto_exento: int
272+
"""
273+
Monto Exento
274+
"""
275+
276+
monto_neto: int
277+
"""
278+
Monto Neto
279+
"""
280+
281+
monto_iva: int
282+
"""
283+
Monto IVA
284+
"""
285+
286+
iva_retenido_total: int
287+
"""
288+
IVA Retenido Total
289+
"""
290+
291+
iva_retenido_parcial: int
292+
"""
293+
IVA Retenido Parcial
294+
"""
295+
296+
iva_no_retenido: int
297+
"""
298+
IVA no retenido
299+
"""
300+
301+
iva_propio: int
302+
"""
303+
IVA propio
304+
"""
305+
306+
iva_terceros: int
307+
"""
308+
IVA Terceros
309+
"""
310+
311+
liquidacion_factura_emisor_rut: Optional[Rut]
312+
"""
313+
RUT Emisor Liquid. Factura
314+
"""
315+
316+
neto_comision_liquidacion_factura: int
317+
"""
318+
Neto Comision Liquid. Factura
319+
"""
320+
321+
exento_comision_liquidacion_factura: int
322+
"""
323+
Exento Comision Liquid. Factura
324+
"""
325+
326+
iva_comision_liquidacion_factura: int
327+
"""
328+
IVA Comision Liquid. Factura
329+
"""
330+
331+
iva_fuera_de_plazo: int
332+
"""
333+
IVA fuera de plazo
334+
"""
335+
336+
tipo_documento_referencia: Optional[int]
337+
"""
338+
Tipo Docto. Referencia
339+
"""
340+
341+
folio_documento_referencia: Optional[int]
342+
"""
343+
Folio Docto. Referencia
344+
"""
345+
346+
num_ident_receptor_extranjero: Optional[str]
347+
"""
348+
Num. Ident. Receptor Extranjero
349+
"""
350+
351+
nacionalidad_receptor_extranjero: Optional[str]
352+
"""
353+
Nacionalidad Receptor Extranjero
354+
"""
355+
356+
credito_empresa_constructora: int
357+
"""
358+
Credito empresa constructora
359+
"""
360+
361+
impuesto_zona_franca_ley_18211: Optional[int]
362+
"""
363+
Impto. Zona Franca (Ley 18211)
364+
"""
365+
366+
garantia_dep_envases: int
367+
"""
368+
Garantia Dep. Envases
369+
"""
370+
371+
indicador_venta_sin_costo: int
372+
"""
373+
Indicador Venta sin Costo
374+
"""
375+
376+
indicador_servicio_periodico: int
377+
"""
378+
Indicador Servicio Periodico
379+
"""
380+
381+
monto_no_facturable: int
382+
"""
383+
Monto No facturable
384+
"""
385+
386+
total_monto_periodo: int
387+
"""
388+
Total Monto Periodo
389+
"""
390+
391+
venta_pasajes_transporte_nacional: Optional[int]
392+
"""
393+
Venta Pasajes Transporte Nacional
394+
"""
395+
396+
venta_pasajes_transporte_internacional: Optional[int]
397+
"""
398+
Venta Pasajes Transporte Internacional
399+
"""
400+
401+
numero_interno: Optional[str]
402+
"""
403+
Numero Interno
404+
"""
405+
406+
codigo_sucursal: Optional[str]
407+
"""
408+
Codigo Sucursal
409+
"""
410+
411+
nce_o_nde_sobre_factura_de_compra: Optional[str]
412+
"""
413+
NCE o NDE sobre Fact. de Compra
414+
"""
415+
416+
codigo_otro_imp: Optional[str]
417+
"""
418+
Codigo Otro Imp.
419+
"""
420+
421+
valor_otro_imp: Optional[int]
422+
"""
423+
Valor Otro Imp.
424+
"""
425+
426+
tasa_otro_imp: Optional[float]
427+
"""
428+
Tasa Otro Imp.
429+
"""
265430

266431
###########################################################################
267432
# Validators

0 commit comments

Comments
 (0)