Commit 161b6cd9a91ae9bac9fa530da6c336c0be3a59dc
Exists in
master
Merge branch 'master' into 'develop'
Master(efernandez) See merge request !92
Showing
2 changed files
Show diff stats
src/js/controller.js
... | ... | @@ -343,7 +343,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
343 | 343 | { |
344 | 344 | puntoDescarga: punto |
345 | 345 | } |
346 | - ) | |
346 | + ); | |
347 | 347 | }); |
348 | 348 | |
349 | 349 | $scope.$broadcast('addCabecera', { |
... | ... | @@ -460,7 +460,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
460 | 460 | } |
461 | 461 | }; |
462 | 462 | |
463 | - $scope.seleccionarCliente = function (ocultarVendedor) { | |
463 | + $scope.seleccionarCliente = function () { | |
464 | 464 | if (validarNotaRemitada()) { |
465 | 465 | var modalInstance = $uibModal.open( |
466 | 466 | { |
... | ... | @@ -554,8 +554,9 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
554 | 554 | $scope.notaPedido.vendedor = res.data; |
555 | 555 | $scope.$broadcast('addCabecera', { |
556 | 556 | label: 'Vendedor:', |
557 | - valor: $filter('rellenarDigitos')($scope.notaPedido.vendedor.NUM, 3) + ' - ' + | |
558 | - $scope.notaPedido.vendedor.NOM | |
557 | + valor: $filter('rellenarDigitos') | |
558 | + ($scope.notaPedido.vendedor.NUM, 3) + | |
559 | + ' - ' + $scope.notaPedido.vendedor.NOM | |
559 | 560 | }); |
560 | 561 | } |
561 | 562 | var domicilioStamp = |
... | ... | @@ -565,7 +566,8 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
565 | 566 | |
566 | 567 | $scope.$broadcast('addCabecera', { |
567 | 568 | label: 'Cliente:', |
568 | - valor: $filter('rellenarDigitos')(cliente.cod, 5) + ' - ' + cliente.nom | |
569 | + valor: $filter('rellenarDigitos')(cliente.cod, 5) + | |
570 | + ' - ' + cliente.nom | |
569 | 571 | }); |
570 | 572 | |
571 | 573 | $scope.$broadcast('addCabecera', { |
... | ... | @@ -579,9 +581,10 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
579 | 581 | } |
580 | 582 | |
581 | 583 | // Seteo checked en botonera |
582 | - $filter('filter')($scope.botonera, { label: 'Cliente' })[0].checked = true; | |
584 | + $filter('filter')($scope.botonera, | |
585 | + { label: 'Cliente' })[0].checked = true; | |
583 | 586 | }) |
584 | - .catch(function (e) { console.log(e); }) | |
587 | + .catch(function (e) { console.log(e); }); | |
585 | 588 | }, function () { |
586 | 589 | $scope.seleccionarCliente(true); |
587 | 590 | return; |
... | ... | @@ -791,9 +794,8 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
791 | 794 | |
792 | 795 | $scope.agregarATabla = function (key) { |
793 | 796 | if (key === 13) { |
794 | - if ($scope.articuloACargar.cantidad === undefined || | |
795 | - $scope.articuloACargar.cantidad === 0 || | |
796 | - $scope.articuloACargar.cantidad === null) { | |
797 | + if (!$scope.articuloACargar.cantidad || !$scope.articuloACargar.precio) | |
798 | + { | |
797 | 799 | focaModalService.alert('El valor debe ser al menos 1'); |
798 | 800 | return; |
799 | 801 | } |
... | ... | @@ -811,7 +813,7 @@ angular.module('focaCrearNotaPedido').controller('notaPedidoCtrl', |
811 | 813 | |
812 | 814 | $scope.editarArticulo = function (key, articulo, tmpCantidad, tmpPrecio) { |
813 | 815 | if (key === 13) { |
814 | - if (!articulo.cantidad || !articulo.precio) { | |
816 | + if (!articulo.cantidad || !articulo.precio || !tmpCantidad || !tmpPrecio) { | |
815 | 817 | focaModalService.alert('Los valores deben ser al menos 1'); |
816 | 818 | return; |
817 | 819 | } else if (articulo.cantidad < 0 || articulo.precio < 0) { |
src/js/service.js
... | ... | @@ -99,7 +99,7 @@ angular.module('focaCrearNotaPedido') |
99 | 99 | return $http.get(API_ENDPOINT.URL + '/proveedor/' + id); |
100 | 100 | }, |
101 | 101 | getParametros: function() { |
102 | - return $http.get(API_ENDPOINT.URL + '/parametros/' + 'notaPedido') | |
102 | + return $http.get(API_ENDPOINT.URL + '/parametros/' + 'notaPedido'); | |
103 | 103 | } |
104 | 104 | }; |
105 | 105 | }]); |