From ebd6bf80647379bbd8145246f149c1383b05d9f9 Mon Sep 17 00:00:00 2001 From: Eric Fernandez Date: Fri, 24 May 2019 11:36:23 -0300 Subject: [PATCH] fix precios y cantidad +- --- src/js/controller.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index 5e171a2..9841a2c 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -791,9 +791,8 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', $scope.agregarATabla = function (key) { if (key === 13) { - if ($scope.articuloACargar.cantidad === undefined || - $scope.articuloACargar.cantidad === 0 || - $scope.articuloACargar.cantidad === null) { + if (!$scope.articuloACargar.cantidad || !$scope.articuloACargar.precio) + { focaModalService.alert('El valor debe ser al menos 1'); return; } @@ -811,7 +810,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', $scope.editarArticulo = function (key, articulo, tmpCantidad, tmpPrecio) { if (key === 13) { - if (!articulo.cantidad || !articulo.precio) { + if (!articulo.cantidad || !articulo.precio || !tmpCantidad || !tmpPrecio) { focaModalService.alert('Los valores deben ser al menos 1'); return; } else if (articulo.cantidad < 0 || articulo.precio < 0) { -- 1.9.1