From 400b2754bf7d42770c8f1c110c484618ff7835e5 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Fri, 9 May 2025 13:33:08 -0400 Subject: [PATCH] FIX: Totales para multipropietario no sumaban correctamente --- .../views/ventas/facturacion/show/factura.blade.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/resources/views/ventas/facturacion/show/factura.blade.php b/app/resources/views/ventas/facturacion/show/factura.blade.php index f77ca5f..44547c3 100644 --- a/app/resources/views/ventas/facturacion/show/factura.blade.php +++ b/app/resources/views/ventas/facturacion/show/factura.blade.php @@ -194,7 +194,8 @@ }, unidad: ({unidad, no, classes, formatters}) => { const descuento = this.props.terreno.valor * unidad.prorrateo * this.props.proporcion - const bruto = unidad.precio - descuento + const precio = unidad.precio * this.props.proporcion + const bruto = precio - descuento const neto = bruto / 1.19 const data = [ no, @@ -256,7 +257,7 @@ tooltips.neto = ` data-tooltip="No coinciden netos! Promesa: ${formatters.pesos.format(this.props.detalle.neto)} - Unidades: ${formatters.pesos.format(this.props.total.neto)}"` } if (this.props.total.iva !== this.props.detalle.iva) { - tooltips.iva = ` data-tooltip="No coinciden ivas! Promesa: ${formatters.pesos.format(this.props.detalle.iva)} - Unidades: ${formatters.pesos.format(this.props.total.iva)}"` + tooltips.iva = ` data-tooltip="No coinciden IVAs! Promesa: ${formatters.pesos.format(this.props.detalle.iva)} - Unidades: ${formatters.pesos.format(this.props.total.iva)}"` } if (this.props.total.total !== this.props.detalle.total) { tooltips.total = ` data-tooltip="No coinciden totales! Promesa: ${formatters.pesos.format(this.props.detalle.total)} - Unidades: ${formatters.pesos.format(this.props.total.total)}"` @@ -399,7 +400,7 @@ }, total: () => { this.props.total.exento = this.props.detalle.terreno - this.props.total.neto = (this.props.unidades.reduce((sum, unidad) => sum + unidad.precio, 0) - this.props.total.exento) / 1.19 + this.props.total.neto = (this.props.unidades.reduce((sum, unidad) => sum + unidad.precio, 0) * this.props.proporcion - this.props.total.exento) / 1.19 this.props.total.iva = this.props.total.neto * 0.19 this.props.total.total = this.props.total.neto + this.props.total.iva + this.props.total.exento },