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
37 changes: 0 additions & 37 deletions cl_sii/rcv/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ class RvDetalleEntry(RcvDetalleEntry):
RCV_KIND = RcvKind.VENTAS
RC_ESTADO_CONTABLE = None

emisor_razon_social: Optional[str] = dc_field()
"""
"Razón social" (legal name) of the "emisor" of the "documento".
"""

# TODO: docstring
# TODO: can it be None? What happens for those "tipo docto" that do not have a receptor?
receptor_razon_social: str = dc_field()
Expand All @@ -244,11 +239,6 @@ class RvDetalleEntry(RcvDetalleEntry):
def __post_init__(self) -> None:
super().__post_init__()

if self.emisor_razon_social is not None:
if not isinstance(self.emisor_razon_social, str):
raise TypeError("Inappropriate type of 'emisor_razon_social'.")
cl_sii.dte.data_models.validate_contribuyente_razon_social(self.emisor_razon_social)

if not isinstance(self.receptor_razon_social, str):
raise TypeError("Inappropriate type of 'receptor_razon_social'.")
cl_sii.dte.data_models.validate_contribuyente_razon_social(self.receptor_razon_social)
Expand Down Expand Up @@ -279,10 +269,6 @@ class RcRegistroDetalleEntry(RcvDetalleEntry):
"Razón social" (legal name) of the "emisor" of the "documento".
"""

# TODO: docstring
# TODO: can it be None? What happens for those "tipo docto" that do not have a receptor?
receptor_razon_social: Optional[str] = dc_field()

# TODO: docstring
# note: must be timezone-aware.
fecha_acuse_dt: Optional[datetime] = dc_field()
Expand All @@ -294,11 +280,6 @@ def __post_init__(self) -> None:
raise TypeError("Inappropriate type of 'emisor_razon_social'.")
cl_sii.dte.data_models.validate_contribuyente_razon_social(self.emisor_razon_social)

if self.receptor_razon_social is not None:
if not isinstance(self.receptor_razon_social, str):
raise TypeError("Inappropriate type of 'receptor_razon_social'.")
cl_sii.dte.data_models.validate_contribuyente_razon_social(self.receptor_razon_social)

if self.fecha_acuse_dt is not None:
if not isinstance(self.fecha_acuse_dt, datetime):
raise TypeError("Inappropriate type of 'fecha_acuse_dt'.")
Expand Down Expand Up @@ -331,10 +312,6 @@ class RcReclamadoDetalleEntry(RcvDetalleEntry):
"Razón social" (legal name) of the "emisor" of the "documento".
"""

# TODO: docstring
# TODO: can it be None? What happens for those "tipo docto" that do not have a receptor?
receptor_razon_social: Optional[str] = dc_field()

# TODO: docstring
# note: must be timezone-aware.
fecha_reclamo_dt: Optional[datetime] = dc_field()
Expand All @@ -346,11 +323,6 @@ def __post_init__(self) -> None:
raise TypeError("Inappropriate type of 'emisor_razon_social'.")
cl_sii.dte.data_models.validate_contribuyente_razon_social(self.emisor_razon_social)

if self.receptor_razon_social is not None:
if not isinstance(self.receptor_razon_social, str):
raise TypeError("Inappropriate type of 'receptor_razon_social'.")
cl_sii.dte.data_models.validate_contribuyente_razon_social(self.receptor_razon_social)

if self.fecha_reclamo_dt is not None:
if not isinstance(self.fecha_reclamo_dt, datetime):
raise TypeError("Inappropriate type of 'fecha_reclamo_dt'.")
Expand All @@ -372,18 +344,9 @@ class RcPendienteDetalleEntry(RcvDetalleEntry):
"Razón social" (legal name) of the "emisor" of the "documento".
"""

# TODO: docstring
# TODO: can it be None? What happens for those "tipo docto" that do not have a receptor?
receptor_razon_social: Optional[str] = dc_field()

def __post_init__(self) -> None:
super().__post_init__()

if not isinstance(self.emisor_razon_social, str):
raise TypeError("Inappropriate type of 'emisor_razon_social'.")
cl_sii.dte.data_models.validate_contribuyente_razon_social(self.emisor_razon_social)

if self.receptor_razon_social is not None:
if not isinstance(self.receptor_razon_social, str):
raise TypeError("Inappropriate type of 'receptor_razon_social'.")
cl_sii.dte.data_models.validate_contribuyente_razon_social(self.receptor_razon_social)
10 changes: 0 additions & 10 deletions cl_sii/rcv/parse_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,6 @@ def to_detalle_entry(self, data: dict) -> RvDetalleEntry:
receptor_rut=receptor_rut,
monto_total=monto_total,
receptor_razon_social=receptor_razon_social,
# FIXME: remove after field 'emisor_razon_social' is removed from the dataclass
emisor_razon_social=None,
fecha_recepcion_dt=fecha_recepcion_dt,
fecha_acuse_dt=fecha_acuse_dt,
fecha_reclamo_dt=fecha_reclamo_dt,
Expand Down Expand Up @@ -791,8 +789,6 @@ def to_detalle_entry(self, data: dict) -> RcRegistroDetalleEntry:
receptor_rut=receptor_rut,
monto_total=monto_total,
emisor_razon_social=emisor_razon_social,
# FIXME: remove after field 'receptor_razon_social' is removed from the dataclass
receptor_razon_social=None,
fecha_recepcion_dt=fecha_recepcion_dt,
fecha_acuse_dt=fecha_acuse_dt,
)
Expand Down Expand Up @@ -827,8 +823,6 @@ def to_detalle_entry(self, data: dict) -> RcNoIncluirDetalleEntry:
receptor_rut=receptor_rut,
monto_total=monto_total,
emisor_razon_social=emisor_razon_social,
# FIXME: remove after field 'receptor_razon_social' is removed from the dataclass
receptor_razon_social=None,
fecha_recepcion_dt=fecha_recepcion_dt,
fecha_acuse_dt=fecha_acuse_dt,
)
Expand Down Expand Up @@ -967,8 +961,6 @@ def to_detalle_entry(self, data: dict) -> RcReclamadoDetalleEntry:
receptor_rut=receptor_rut,
monto_total=monto_total,
emisor_razon_social=emisor_razon_social,
# FIXME: remove after field 'receptor_razon_social' is removed from the dataclass
receptor_razon_social=None,
fecha_recepcion_dt=fecha_recepcion_dt,
fecha_reclamo_dt=fecha_reclamo_dt,
)
Expand Down Expand Up @@ -1090,8 +1082,6 @@ def to_detalle_entry(self, data: dict) -> RcPendienteDetalleEntry:
receptor_rut=receptor_rut,
monto_total=monto_total,
emisor_razon_social=emisor_razon_social,
# FIXME: remove after field 'receptor_razon_social' is removed from the dataclass
receptor_razon_social=None,
fecha_recepcion_dt=fecha_recepcion_dt,
)
except (TypeError, ValueError):
Expand Down