2 Commits

View File

@ -247,9 +247,19 @@
return row.join('') return row.join('')
}, },
totales: ({formatters}) => { totales: ({formatters}) => {
let tooltip let tooltips = {
neto: null,
iva: null,
total: null
}
if (this.props.total.neto !== this.props.detalle.neto) {
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)}"`
}
if (this.props.total.total !== this.props.detalle.total) { if (this.props.total.total !== this.props.detalle.total) {
tooltip = ` data-tooltip="No coinciden totales! Promesa: ${formatters.pesos.format(this.props.detalle.total)} - Unidades: ${formatters.pesos.format(this.props.total.total)}"` tooltips.total = ` data-tooltip="No coinciden totales! Promesa: ${formatters.pesos.format(this.props.detalle.total)} - Unidades: ${formatters.pesos.format(this.props.total.total)}"`
} }
return [ return [
'<div class="row">', '<div class="row">',
@ -264,7 +274,7 @@
'<tbody>', '<tbody>',
'<tr>', '<tr>',
'<td class="grey">Monto Neto</td>', '<td class="grey">Monto Neto</td>',
'<td class="right aligned" id="neto">'+formatters.pesos.format(this.props.total.neto)+'</td>', `<td class="right aligned${this.props.total.neto !== this.props.detalle.neto ? ' red' : ''}"${this.props.total.neto !== this.props.detalle.neto ? tooltips.neto : ''} id="neto">${formatters.pesos.format(this.props.total.neto)}</td>`,
'</tr>', '</tr>',
'<tr>', '<tr>',
'<td class="grey">Monto Exento</td>', '<td class="grey">Monto Exento</td>',
@ -272,11 +282,11 @@
'</tr>', '</tr>',
'<tr>', '<tr>',
'<td class="grey">19% IVA</td>', '<td class="grey">19% IVA</td>',
'<td class="right aligned" id="iva">'+formatters.pesos.format(this.props.total.iva)+'</td>', `<td class="right aligned${this.props.total.iva !== this.props.detalle.iva ? ' red' : ''}"${this.props.total.iva !== this.props.detalle.iva ? tooltips.iva : ''} id="iva">${formatters.pesos.format(this.props.total.iva)}</td>`,
'</tr>', '</tr>',
'<tr>', '<tr>',
'<td class="grey">Monto Total</td>', '<td class="grey">Monto Total</td>',
`<td class="right aligned${(this.props.total.total !== this.props.detalle.total) ? ' red' : ''}"${(this.props.total.total !== this.props.detalle.total) ? tooltip : ''}><strong id="total">${formatters.pesos.format(this.props.total.total)}</strong></td>`, `<td class="right aligned${(this.props.total.total !== this.props.detalle.total) ? ' red' : ''}"${(this.props.total.total !== this.props.detalle.total) ? tooltips.total : ''}><strong id="total">${formatters.pesos.format(this.props.total.total)}</strong></td>`,
'</tr>', '</tr>',
'</tbody>', '</tbody>',
'</table>', '</table>',