Commit 60a346fec49ea12bd3b70af3a86293ac0b69459e
Exists in
develop
Merge branch 'develop' of git.focasoftware.com:npm/foca-crear-remito into develop
Showing
2 changed files
Show diff stats
package.json
src/js/controller.js
... | ... | @@ -988,18 +988,23 @@ angular.module('focaCrearRemito').controller('remitoController', |
988 | 988 | $scope.editarArticulo = function (key, articulo, tmpCantidad, tmpPrecio) { |
989 | 989 | if (key === 13) { |
990 | 990 | if (!articulo.cantidad || !articulo.precio || !tmpCantidad || !tmpPrecio) { |
991 | - focaModalService.alert('Los valores deben ser al menos 1'); | |
991 | + focaModalService.alert('Debes introducir algún valor'); | |
992 | 992 | return; |
993 | 993 | } else if (tmpCantidad === '0' || tmpPrecio === '0') { |
994 | 994 | focaModalService.alert('Esta ingresando un producto con valor 0'); |
995 | - } else if (articulo.cantidad < 0 || articulo.precio < 0) { | |
995 | + return; | |
996 | + } else if (tmpCantidad < 0 || tmpPrecio < 0) { | |
996 | 997 | focaModalService.alert('Los valores no pueden ser negativos'); |
997 | 998 | return; |
999 | + } else if (!Number.isInteger(tmpCantidad)) { | |
1000 | + focaModalService.alert('Debes introducir un número entero'); | |
1001 | + return; | |
1002 | + } else { | |
1003 | + articulo.cantidad = tmpCantidad; | |
1004 | + articulo.precio = tmpPrecio; | |
1005 | + $scope.getTotal(); | |
1006 | + articulo.editCantidad = articulo.editPrecio = false; | |
998 | 1007 | } |
999 | - articulo.cantidad = tmpCantidad; | |
1000 | - articulo.precio = tmpPrecio; | |
1001 | - $scope.getTotal(); | |
1002 | - articulo.editCantidad = articulo.editPrecio = false; | |
1003 | 1008 | } |
1004 | 1009 | }; |
1005 | 1010 |