Commit 3bb31840ec7f41b5d596684eb28b49cf5a108479

Authored by Eric Fernandez
Exists in master and in 1 other branch develop

Merge branch 'master' into 'develop'

Master

See merge request !52
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
... ... @@ -107,7 +107,6 @@
107 107 <button
108 108 class="btn btn-outline-light"
109 109 ng-click="quitarArticulo(key)"
110   - ng-hide="articulo.editCantidad || articulo.editPrecio"
111 110 >
112 111 <i class="fa fa-trash"></i>
113 112 </button>