Commit ebd6bf80647379bbd8145246f149c1383b05d9f9

Authored by Eric Fernandez
1 parent 315870f6d7
Exists in master

fix precios y cantidad +-

Showing 1 changed file with 3 additions and 4 deletions   Show diff stats
src/js/controller.js
... ... @@ -791,9 +791,8 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl',
791 791  
792 792 $scope.agregarATabla = function (key) {
793 793 if (key === 13) {
794   - if ($scope.articuloACargar.cantidad === undefined ||
795   - $scope.articuloACargar.cantidad === 0 ||
796   - $scope.articuloACargar.cantidad === null) {
  794 + if (!$scope.articuloACargar.cantidad || !$scope.articuloACargar.precio)
  795 + {
797 796 focaModalService.alert('El valor debe ser al menos 1');
798 797 return;
799 798 }
... ... @@ -811,7 +810,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl',
811 810  
812 811 $scope.editarArticulo = function (key, articulo, tmpCantidad, tmpPrecio) {
813 812 if (key === 13) {
814   - if (!articulo.cantidad || !articulo.precio) {
  813 + if (!articulo.cantidad || !articulo.precio || !tmpCantidad || !tmpPrecio) {
815 814 focaModalService.alert('Los valores deben ser al menos 1');
816 815 return;
817 816 } else if (articulo.cantidad < 0 || articulo.precio < 0) {