Commit 4c52cedd85c2e98e1ef60ad526779962fe1c583c

Authored by Luigi
1 parent 4d8b804210
Exists in master and in 1 other branch develop

Validacion al ingresar cantidad

Showing 2 changed files with 4 additions and 4 deletions   Show diff stats
src/js/controller.js
... ... @@ -966,8 +966,10 @@ angular.module('focaCrearRemito').controller('remitoController',
966 966 $scope.editarArticulo = function (key, articulo, tmpCantidad, tmpPrecio) {
967 967 if (key === 13) {
968 968 if (!articulo.cantidad || !articulo.precio || !tmpCantidad || !tmpPrecio) {
969   - focaModalService.alert('Los valores deben ser al menos 1');
  969 + focaModalService.alert('Ingrese cantidad');
970 970 return;
  971 + } else if (tmpCantidad === "0") {
  972 + focaModalService.alert('Esta ingresando un producto con cantidad 0');
971 973 } else if (articulo.cantidad < 0 || articulo.precio < 0) {
972 974 focaModalService.alert('Los valores no pueden ser negativos');
973 975 return;
src/views/remito.html
... ... @@ -76,9 +76,7 @@
76 76 foca-focus="articulo.editCantidad"
77 77 ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad, tmpPrecio);"
78 78 esc-key="cancelarEditar(articulo)"
79   - ng-focus="selectFocus($event);
80   - tmpCantidad = articulo.cantidad;
81   - tmpPrecio = articulo.precio"
  79 + ng-focus="selectFocus($event); tmpCantidad = articulo.cantidad; tmpPrecio = articulo.precio"
82 80 teclado-virtual
83 81 >
84 82 <i