Totals calculation
LX CloudPos automatically calculates:
- Line subtotal =
cantidad × precioUnitario − montoDescuento - Line VAT =
subtotal × (porcentajeIVA / 100)(the percentage comes from the product) - Line exemption = if the line carries
idExoneracion, the line’s VAT × the authorized percentage, capped at the product’s rate — never an amount sent in the request - Line total =
subtotal + IVA − exoneración + otrosCargos - Document total = Σ line totals
Visual formula
Per line:
bruto = cantidad × precioUnitario
subtotal = bruto − descuento
iva = subtotal × (porcentaje_iva / 100)
exoneración = iva × porcentaje_exoneración (si la línea trae idExoneracion; topado a iva)
otrosCargos = configurado del producto si cliente paga timbre
totalLínea = subtotal + iva − exoneración + otrosCargos
Comprobante:
totalGravado = Σ líneas con IVA > 0
totalExento = Σ líneas con IVA = 0
totalExonerado = Σ exoneraciones
totalVenta = totalGravado + totalExento + totalExonerado
totalDescuentos = Σ descuentos
totalVentaNeta = totalVenta − totalDescuentos
totalImpuestos = Σ iva
totalOtros = Σ otrosCargos
totalComprobante = totalVentaNeta + totalImpuestos + totalOtrosRounding: half-even (banker’s rounding) to 2 decimals at each intermediate step.
montoExoneracionplays no part in this calculation. Even though the DTO still accepts it, the server ignores it entirely — see Tax exemptions andFacturaApiLineaDto.
See also: discounts, VAT, tax exemptions, other charges.