Commit c95a79e985f16e2de497453e616a6e6e779ea6de

Authored by Luis Suarez
1 parent 59fd4f02c7
Exists in develop

valido crear producto

Showing 1 changed file with 11 additions and 2 deletions   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;
... ... @@ -1238,7 +1247,7 @@ angular.module(&#39;focaCrearRemito&#39;).controller(&#39;remitoController&#39;,
1238 1247 }
1239 1248  
1240 1249 if (remito.idPrecioCondicion > 0) {
1241   - $scope.idLista = remito.precioCondicion.idListaPrecio;
  1250 + $scope.idLista = remito.preci/aoCondicion.idListaPrecio;
1242 1251 } else if (remito.idPrecioCondicion) {
1243 1252 $scope.idLista = -1;
1244 1253 }