Skip to Content
v1.5Official documentation for the LX CloudPos API · stable in production
v1.5 (current)Business rulesTotals calculation

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 + totalOtros

Rounding: half-even (banker’s rounding) to 2 decimals at each intermediate step.

montoExoneracion plays no part in this calculation. Even though the DTO still accepts it, the server ignores it entirely — see Tax exemptions and FacturaApiLineaDto.

See also: discounts, VAT, tax exemptions, other charges.