From 345330612339f33beadb8fa5e51755069e154aa7 Mon Sep 17 00:00:00 2001
From: Jaime Jimenez ');
+ const total = (parseFloat(response.precio_u[i]) * parseInt(response.tiradas[i])).toFixed(2) ;
+ const label = "tiradaPrecio" + parseInt(i+1);
+
+ $('#ud_' + label).text(response.tiradas[i] + ' ud.');
+ $('#tot_' + label).text('Total: ' + total + '€');
+ $('#pu_' + label).text(response.precio_u[i] + '€/ud');
+ $('#' + label).show();
}
- $('#precios').show();
+ for (i = response.tiradas.length; i < 4; i++) {
+ const label = "tiradaPrecio" + parseInt(i+1);
+ $('#' + label).hide();
+ }
}
},
error: function (error) {
$('#loader').hide();
- $('#precios > tbody').empty();
- $('#precios').hide();
+ $('#tiradaPrecio1').hide();
+ $('#tiradaPrecio2').hide();
+ $('#tiradaPrecio3').hide();
+ $('#tiradaPrecio4').hide();
}
});
}
\ No newline at end of file
diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cliente/viewPresupuestoclienteForm.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cliente/viewPresupuestoclienteForm.php
index 178b413a..ec6f3530 100644
--- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cliente/viewPresupuestoclienteForm.php
+++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cliente/viewPresupuestoclienteForm.php
@@ -68,17 +68,52 @@
administrador.' + response.tiradas[i] + ' ' + response.precio_u[i] + '€