From d1542127324298d0c23eb4977c3f48b8319a7e37 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Wed, 6 Nov 2024 19:55:49 -0300 Subject: [PATCH] FIX: Editar pago --- .../views/ventas/pies/cuotas.blade.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/resources/views/ventas/pies/cuotas.blade.php b/app/resources/views/ventas/pies/cuotas.blade.php index 256b946..36f6b25 100644 --- a/app/resources/views/ventas/pies/cuotas.blade.php +++ b/app/resources/views/ventas/pies/cuotas.blade.php @@ -301,15 +301,15 @@ return } const tr = $(`tr[data-pago='${json.pago.id}']`) - tr.find(':nth-child(1)').html(json.pago.numero) + tr.children(':nth-child(1)').html(json.pago.numero) const fecha = json.pago.fecha.split(' ')[0].split('-').reverse().join('-') - tr.find(':nth-child(2)').html(fecha) - tr.find(':nth-child(3)').html(json.pago.banco.nombre) - tr.find(':nth-child(4)').html(json.pago.identificador) + tr.children(':nth-child(2)').html(fecha) + tr.children(':nth-child(3)').html(json.pago.banco.nombre) + tr.children(':nth-child(4)').html(json.pago.identificador) const pesosFormatter = Intl.NumberFormat('es-CL', {style: 'currency', currency: 'CLP'}) - tr.find(':nth-child(5)').html(pesosFormatter.format(json.pago.valor)) + tr.children(':nth-child(5)').html(pesosFormatter.format(json.pago.valor)) const ufFormatter = Intl.NumberFormat('es-CL', {minimumFractionDigits: 2, maximumFractionDigits: 2}) - tr.find(':nth-child(6)').html(ufFormatter.format(json.pago.valor_uf) + ' UF') + tr.children(':nth-child(6)').html(ufFormatter.format(json.pago.valor_uf) + ' UF') }) }) } @@ -320,9 +320,10 @@ $('.edit_cuota').on('click', clickEvent => { const id = $(clickEvent.currentTarget).data('cuota') const tr = $(`tr[data-pago='${id}']`) - const number = tr.find(':nth-child(1)').text().split('<')[0].trim() - const fecha = tr.find(':nth-child(2)').text() - const banco_id = bancos.filter(banco => banco.nombre === tr.find(':nth-child(3)').text())[0].id + const number = tr.children(':nth-child(1)').text().split('<')[0].trim() + const fecha = tr.children(':nth-child(2)').text() + const nombre_banco = tr.children(':nth-child(3)').text() + const banco_id = bancos.filter(banco => banco.nombre === nombre_banco)[0].id const identificador = tr.find(':nth-child(4)').text() const valor = parseInt(tr.find(':nth-child(5)').text().replace('$', '').replaceAll('.', '').trim())