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
2 changes: 1 addition & 1 deletion src/xhandler/_core/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0-alpha.1
6.0.0-alpha.2
Binary file modified src/xhandler/_core/xhandler.wasm
Binary file not shown.
48 changes: 28 additions & 20 deletions src/xhandler/xbuilder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,29 @@ class DocumentoRelacionado(_Model):
serie_numero: str


class TipoFormaPago(str, Enum):
"""Tipo de forma de pago"""
CREDITO = 'Credito'
CONTADO = 'Contado'

def __str__(self) -> str:
return self.value


class CuotaPago(_Model):
"""Cuota de pago"""
importe: PlainDecimal
fecha_pago: date


class FormaPago(_Model):
"""Forma de pago. A missing `tipo` is filled in by the enricher, and
payment in full ("contado") has no `cuotas`."""
tipo: TipoFormaPago | None = None
cuotas: list[CuotaPago] = Field(default_factory=list)
total: PlainDecimal | None = None


class CreditNote(_Model):
"""Nota de credito"""
kind: ClassVar[str] = 'CreditNote'
Expand All @@ -216,12 +239,11 @@ class CreditNote(_Model):
guias: list[Guia] = Field(default_factory=list)
documentos_relacionados: list[DocumentoRelacionado] = Field(default_factory=list)
orden_compra: str | None = None


class CuotaPago(_Model):
"""Cuota de pago"""
importe: PlainDecimal
fecha_pago: date
forma_pago: FormaPago | None = None
"""The corrected amount owed and installments of the factura it
modifies: required for `tipo_nota` "13" (Catalog9, ajustes de montos
y/o fechas de pago) and refused for the others. Unlike an invoice's,
it isn't filled in when missing."""


class DebitNote(_Model):
Expand Down Expand Up @@ -429,20 +451,6 @@ class Detraccion(_Model):
monto: PlainDecimal | None = None


class TipoFormaPago(str, Enum):
"""Tipo de forma de pago"""
CREDITO = 'Credito'
CONTADO = 'Contado'


class FormaPago(_Model):
"""Forma de pago. A missing `tipo` is filled in by the enricher, and
payment in full ("contado") has no `cuotas`."""
tipo: TipoFormaPago | None = None
cuotas: list[CuotaPago] = Field(default_factory=list)
total: PlainDecimal | None = None


class GuiaEmbebida(_Model):
"""Datos del traslado de una factura guia"""
partida: Direccion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"documentos_relacionados": [],
"fecha_emision": null,
"firmante": null,
"forma_pago": null,
"guias": [],
"hora_emision": null,
"icb_tasa": null,
Expand Down
Loading
Loading