From 4c52cedd85c2e98e1ef60ad526779962fe1c583c Mon Sep 17 00:00:00 2001 From: Luigi Date: Wed, 19 Jun 2019 11:35:32 -0300 Subject: [PATCH] Validacion al ingresar cantidad --- src/js/controller.js | 4 +++- src/views/remito.html | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index ce2ee1c..afa7c1d 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -966,8 +966,10 @@ angular.module('focaCrearRemito').controller('remitoController', $scope.editarArticulo = function (key, articulo, tmpCantidad, tmpPrecio) { if (key === 13) { if (!articulo.cantidad || !articulo.precio || !tmpCantidad || !tmpPrecio) { - focaModalService.alert('Los valores deben ser al menos 1'); + focaModalService.alert('Ingrese cantidad'); return; + } else if (tmpCantidad === "0") { + focaModalService.alert('Esta ingresando un producto con cantidad 0'); } else if (articulo.cantidad < 0 || articulo.precio < 0) { focaModalService.alert('Los valores no pueden ser negativos'); return; diff --git a/src/views/remito.html b/src/views/remito.html index 0677490..50204a3 100644 --- a/src/views/remito.html +++ b/src/views/remito.html @@ -76,9 +76,7 @@ foca-focus="articulo.editCantidad" ng-keypress="editarArticulo($event.keyCode, articulo, tmpCantidad, tmpPrecio);" esc-key="cancelarEditar(articulo)" - ng-focus="selectFocus($event); - tmpCantidad = articulo.cantidad; - tmpPrecio = articulo.precio" + ng-focus="selectFocus($event); tmpCantidad = articulo.cantidad; tmpPrecio = articulo.precio" teclado-virtual >