diff --git a/app/resources/views/ventas/facturacion/show.blade.php b/app/resources/views/ventas/facturacion/show.blade.php
index b5e3f0d..63b08ba 100644
--- a/app/resources/views/ventas/facturacion/show.blade.php
+++ b/app/resources/views/ventas/facturacion/show.blade.php
@@ -44,6 +44,7 @@
facturas: () => {
document.getElementById(this.ids.facturas).innerHTML = this.venta.draw().facturas(this.formatters)
this.venta.watch().facturas()
+ $('[data-html]').popup()
}
}
},
diff --git a/app/resources/views/ventas/facturacion/show/factura.blade.php b/app/resources/views/ventas/facturacion/show/factura.blade.php
index 44547c3..ab909ba 100644
--- a/app/resources/views/ventas/facturacion/show/factura.blade.php
+++ b/app/resources/views/ventas/facturacion/show/factura.blade.php
@@ -220,9 +220,47 @@
},
resumen: ({no, classes, formatters}) => {
const emptyTerreno = '
0
'
+ const calculoTerreno = [
+ [
+ `Base Terreno (${formatters.date.format(this.props.terreno.fecha)})`,
+ `\$${formatters.pesos.format(this.props.terreno.valor)}`
+ ],
+ [
+ `IPC (${formatters.date.format(this.props.fecha)})`,
+ `${formatters.percent.format({{ $ipc }})}%`
+ ],
+ [
+ 'Prorrateo',
+ `${formatters.percent.format(this.props.detalle.descuento * 100)}%`
+ ],
+ [
+ 'Proporcion',
+ `${(this.props.proporcion * 100).toFixed(2).replace('.', ',')}%`
+ ],
+ [
+ 'Terreno Aplicado',
+ `\$${formatters.pesos.format(this.props.detalle.terreno)}`
+ ]
+ ]
+ const tableClasses = [
+ '',
+ " align='right'"
+ ]
+ const calculoTerrenoTable = [
+ ''
+ ]
+ calculoTerreno.forEach(items => {
+ const row = []
+ items.forEach((cell, idx) => {
+ row.push(`| ${cell} | `)
+ })
+ calculoTerrenoTable.push(`${row.join('')}
`)
+ })
+ calculoTerrenoTable.push('
')
+
const data = [
no,
- 'Valor con Terreno: $' + formatters.pesos.format(this.props.detalle.base) + ' - Menos valor terreno: $' + ((this.props.detalle.terreno > 0) ? formatters.pesos.format(-this.props.detalle.terreno) : emptyTerreno) + '
' +
+ 'Valor con Terreno: $' + formatters.pesos.format(this.props.detalle.base) + ' - Menos valor terreno: $' + ((this.props.detalle.terreno > 0) ? formatters.pesos.format(-this.props.detalle.terreno) : emptyTerreno) + '
' +
'Base imponible (Neto): $' + formatters.pesos.format(this.props.detalle.neto) + '
' +
'IVA: $' + formatters.pesos.format(this.props.detalle.iva) + '
' +
'SUBTOTAL (Bruto): $' + formatters.pesos.format(this.props.detalle.bruto) + '
' +
diff --git a/app/src/Service/IPC.php b/app/src/Service/IPC.php
index 8a4059d..8d1a546 100644
--- a/app/src/Service/IPC.php
+++ b/app/src/Service/IPC.php
@@ -35,7 +35,7 @@ class IPC
ksort($ipcs);
$this->redisService->set($this->redisKey, json_encode($ipcs), 60 * 60 * 24 * 30);
}
- return $ipcs[$dateKey];
+ return $ipcs[$dateKey] * ($ipcs[$dateKey] > 1 ? 1/100 : 1);
}
public function readjust(float $base, DateTimeInterface $from, DateTimeInterface $to = new DateTimeImmutable()):float
{