feature/cierres #31

Merged
aldarien merged 462 commits from feature/cierres into develop 2025-09-11 17:05:18 -03:00
371 changed files with 955 additions and 16633 deletions
Showing only changes of commit b5d08620f9 - Show all commits

View File

@ -52,8 +52,12 @@
draw(formatter, dateFormatter) {
const tipo = this.estado.tipo_estado_venta.descripcion
const date = new Date(this.fecha)
let unidad = this.propiedad.unidades[0]
if (this.propiedad.departamentos.length > 0) {
unidad = this.propiedad.departamentos[0]
}
return $('<tr></tr>').append(
$('<td></td>').attr('data-order', this.propiedad.departamentos[0].descripcion).append(
$('<td></td>').attr('data-order', unidad.descripcion).append(
$('<a></a>').attr('href', '{{$urls->base}}/venta/' + this.id).html(this.propiedad.summary)
)
).append(
@ -63,9 +67,9 @@
).append(
$('<td></td>').html(formatter.format(this.valor) + ' UF')
).append(
$('<td></td>').html(this.propiedad.departamentos[0].proyecto_tipo_unidad.abreviacion + ' (' + formatter.format(this.propiedad.departamentos[0].proyecto_tipo_unidad.vendible) + ' m²)')
$('<td></td>').html(unidad.proyecto_tipo_unidad.abreviacion + ' (' + formatter.format(unidad.proyecto_tipo_unidad.vendible) + ' m²)')
).append(
$('<td></td>').html(formatter.format(this.valor / this.propiedad.departamentos[0].proyecto_tipo_unidad.vendible) + ' UF/m²')
$('<td></td>').html(formatter.format(this.valor / unidad.proyecto_tipo_unidad.vendible) + ' UF/m²')
).append(
$('<td></td>').attr('data-order', this.fecha).html(dateFormatter.format(date))
).append(
@ -237,7 +241,12 @@
const tbody = $('<tbody></tbody>')
this.data.ventas.forEach(venta => {
tbody.append(venta.draw(this.formatters.number, this.formatters.date))
try {
tbody.append(venta.draw(this.formatters.number, this.formatters.date))
} catch (error) {
console.debug(venta)
console.error(error)
}
})
table.append(this.draw().header()).append(tbody)
table.show()