Commit ddeb376051514167200dbd8e3785b3e4ed9af948
Exists in
develop
Merge branch 'develop' into 'develop'
Develop See merge request !144
Showing
1 changed file
Show diff stats
src/js/controller.js
... | ... | @@ -957,7 +957,16 @@ angular.module('focaCrearRemito').controller('remitoController', |
957 | 957 | $scope.agregarATabla = function (key) { |
958 | 958 | if (key === 13) { |
959 | 959 | if (!$scope.articuloACargar.cantidad || !$scope.articuloACargar.precio) { |
960 | - focaModalService.alert('El valor debe ser al menos 1'); | |
960 | + focaModalService.alert('Debes introducir algún valor'); | |
961 | + return; | |
962 | + } else if (scope.articuloACargar.cantidad === '0' || scope.articuloACargar.precio === '0') { | |
963 | + focaModalService.alert('Esta ingresando un producto con valor 0'); | |
964 | + return; | |
965 | + } else if ($scope.articuloACargar.cantidad < 0 || $scope.articuloACargar.precio < 0) { | |
966 | + focaModalService.alert('Los valores no pueden ser negativos'); | |
967 | + return; | |
968 | + } else if (!Number.isInteger($scope.articuloACargar.cantidad)) { | |
969 | + focaModalService.alert('Debes introducir un número entero'); | |
961 | 970 | return; |
962 | 971 | } |
963 | 972 | delete $scope.articuloACargar.sectorCodigo; |