Added calculation detail
This commit is contained in:
@ -44,6 +44,7 @@
|
|||||||
facturas: () => {
|
facturas: () => {
|
||||||
document.getElementById(this.ids.facturas).innerHTML = this.venta.draw().facturas(this.formatters)
|
document.getElementById(this.ids.facturas).innerHTML = this.venta.draw().facturas(this.formatters)
|
||||||
this.venta.watch().facturas()
|
this.venta.watch().facturas()
|
||||||
|
$('[data-html]').popup()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -220,9 +220,47 @@
|
|||||||
},
|
},
|
||||||
resumen: ({no, classes, formatters}) => {
|
resumen: ({no, classes, formatters}) => {
|
||||||
const emptyTerreno = '<div class="ui tiny red horizontal circular label">0</div>'
|
const emptyTerreno = '<div class="ui tiny red horizontal circular label">0</div>'
|
||||||
|
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 = [
|
||||||
|
'<table>'
|
||||||
|
]
|
||||||
|
calculoTerreno.forEach(items => {
|
||||||
|
const row = []
|
||||||
|
items.forEach((cell, idx) => {
|
||||||
|
row.push(`<td${tableClasses[idx]}>${cell}</td>`)
|
||||||
|
})
|
||||||
|
calculoTerrenoTable.push(`<tr>${row.join('')}</tr>`)
|
||||||
|
})
|
||||||
|
calculoTerrenoTable.push('</table>')
|
||||||
|
|
||||||
const data = [
|
const data = [
|
||||||
no,
|
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) + '<br />' +
|
'Valor con Terreno: $' + formatters.pesos.format(this.props.detalle.base) + ' - Menos valor terreno: <span data-variation="wide multiline" data-html="' + calculoTerrenoTable.join('') + '">$' + ((this.props.detalle.terreno > 0) ? formatters.pesos.format(-this.props.detalle.terreno) : emptyTerreno) + '</span><br />' +
|
||||||
'Base imponible (Neto): $' + formatters.pesos.format(this.props.detalle.neto) + '<br />' +
|
'Base imponible (Neto): $' + formatters.pesos.format(this.props.detalle.neto) + '<br />' +
|
||||||
'IVA: $' + formatters.pesos.format(this.props.detalle.iva) + '<br />' +
|
'IVA: $' + formatters.pesos.format(this.props.detalle.iva) + '<br />' +
|
||||||
'SUBTOTAL (Bruto): $' + formatters.pesos.format(this.props.detalle.bruto) + '<br />' +
|
'SUBTOTAL (Bruto): $' + formatters.pesos.format(this.props.detalle.bruto) + '<br />' +
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class IPC
|
|||||||
ksort($ipcs);
|
ksort($ipcs);
|
||||||
$this->redisService->set($this->redisKey, json_encode($ipcs), 60 * 60 * 24 * 30);
|
$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
|
public function readjust(float $base, DateTimeInterface $from, DateTimeInterface $to = new DateTimeImmutable()):float
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user