diff --git a/resources/js/app.js b/resources/js/app.js index 8aad338..9642940 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -42,6 +42,12 @@ Vue.prototype.$toast = function(mensaje, duration = 1000) { animate: { in: 'fadeIn', out: 'fadeOut' } }); } +Vue.prototype.$limpiarFloat = function(unFloat) { + return parseFloat(unFloat.replace(/,/g, '')) +} +Vue.prototype.$limpiarInt = function(unInt) { + return parseInt(unInt.replace(/,/g, '')) +} /** * Next, we will create a fresh Vue application instance and attach it to diff --git a/resources/js/components/Chismosa.vue b/resources/js/components/Chismosa.vue index a6b0206..e03c79f 100644 --- a/resources/js/components/Chismosa.vue +++ b/resources/js/components/Chismosa.vue @@ -20,8 +20,8 @@ B. Transporte - {{ cantidadBonosDeTransporte }} - {{ totalBonosDeTransporte }} + {{ cantidadBonosDeTransporte }} + {{ totalBonosDeTransporte }} @@ -50,19 +50,19 @@ return this.$root.productos }, cantidadBonosDeTransporte: function() { - return this.$root.pedido.subtotal_bonos_de_transporte / 15 + return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte) / 15 }, totalBonosDeTransporte: function() { - return this.$root.pedido.subtotal_bonos_de_transporte + return this.$limpiarInt(this.$root.pedido.subtotal_bonos_de_transporte) }, cantidadBonos: function() { - return this.$root.pedido.subtotal_bonos / 20 + return this.$limpiarInt(this.$root.pedido.subtotal_bonos) / 20 }, totalBonos: function() { - return this.$root.pedido.subtotal_bonos + return this.$limpiarInt(this.$root.pedido.subtotal_bonos) }, total: function() { - return this.$root.pedido.total + return this.$limpiarInt(this.$root.pedido.total) } }, } diff --git a/resources/js/components/ChismosaDropdown.vue b/resources/js/components/ChismosaDropdown.vue index c90c4d0..c50e5f9 100644 --- a/resources/js/components/ChismosaDropdown.vue +++ b/resources/js/components/ChismosaDropdown.vue @@ -5,7 +5,7 @@ - +