Commit 3bb31840ec7f41b5d596684eb28b49cf5a108479
Exists in
master
and in
1 other branch
Merge branch 'master' into 'develop'
Master See merge request !52
Showing
2 changed files
Show diff stats
src/js/controller.js
| ... | ... | @@ -869,14 +869,15 @@ angular.module('focaCrearRemito') .controller('remitoController', |
| 869 | 869 | }; |
| 870 | 870 | |
| 871 | 871 | $scope.editarArticulo = function(key, articulo) { |
| 872 | - if(key === 13) { | |
| 873 | - if(articulo.cantidad === null || articulo.cantidad === 0 || | |
| 874 | - articulo.cantidad === undefined) { | |
| 875 | - focaModalService.alert('El valor debe ser al menos 1'); | |
| 872 | + if (key === 13) { | |
| 873 | + if (!articulo.cantidad || !articulo.precio) { | |
| 874 | + focaModalService.alert('Los valores deben ser al menos 1'); | |
| 875 | + return; | |
| 876 | + } else if (articulo.cantidad < 0 || articulo.precio < 0) { | |
| 877 | + focaModalService.alert('Los valores no pueden ser negativos'); | |
| 876 | 878 | return; |
| 877 | 879 | } |
| 878 | - articulo.editCantidad = false; | |
| 879 | - articulo.editPrecio = false; | |
| 880 | + articulo.editCantidad = articulo.editPrecio = false; | |
| 880 | 881 | } |
| 881 | 882 | }; |
| 882 | 883 |
src/views/remito.html