From 2edcdacbe08d00bed25c3afbd47af9e21b9ef8e7 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Sat, 25 Oct 2025 12:49:58 -0300 Subject: [PATCH] FIX: promotions id --- .../views/ventas/reservations.blade.php | 24 ++++++++++++++++++- .../ventas/reservations/modal/add.blade.php | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/resources/views/ventas/reservations.blade.php b/app/resources/views/ventas/reservations.blade.php index 959eb06..007c456 100644 --- a/app/resources/views/ventas/reservations.blade.php +++ b/app/resources/views/ventas/reservations.blade.php @@ -533,13 +533,35 @@ 'Precio', '' ] + const rowAlters = [ + '', + " align='right'", + " align='right'", + " align='right'" + ] reservation.units.forEach(unit => { let type = unit.unit.proyecto_tipo_unidad.tipo_unidad.descripcion type = type.charAt(0).toUpperCase() + type.slice(1) const base = unit.base ?? (unit.value ?? 0); const price = unit.unit.current_precio?.valor ?? 0 const diff = (base - price) / price * 100 - table.push(`${type} ${unit.unit.descripcion}: ${formatter.format(base)} UF${formatter.format(price)} UF(${formatter.format(diff)} %)`) + const rowsData = [ + [ + `${type} ${unit.unit.descripcion}`, + `${formatter.format(base)} UF`, + `${formatter.format(price)} UF`, + `(${formatter.format(diff)} %)` + ] + ] + const rowContent = [] + rowsData.forEach(row => { + const content = [] + row.forEach((cell, idx) => { + content.push(`${cell}`) + }) + rowContent.push(`${content.join('')}`) + }) + table.push(rowContent.join('')) }) if (reservation.broker !== null) { table.push('-----') diff --git a/app/resources/views/ventas/reservations/modal/add.blade.php b/app/resources/views/ventas/reservations/modal/add.blade.php index 1f0b9fc..69109be 100644 --- a/app/resources/views/ventas/reservations/modal/add.blade.php +++ b/app/resources/views/ventas/reservations/modal/add.blade.php @@ -222,7 +222,7 @@ draw = { promotion: idx => { const promotions = this.data.promotions.map(promotion => { - return `
${promotion.name}
` + return `
${promotion.name}
` }) return [ `
`,