Added calculation detail
This commit is contained in:
@ -220,9 +220,47 @@
|
||||
},
|
||||
resumen: ({no, classes, formatters}) => {
|
||||
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 = [
|
||||
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 />' +
|
||||
'IVA: $' + formatters.pesos.format(this.props.detalle.iva) + '<br />' +
|
||||
'SUBTOTAL (Bruto): $' + formatters.pesos.format(this.props.detalle.bruto) + '<br />' +
|
||||
|
||||
Reference in New Issue
Block a user