Commit 93d7038a98d798a565c6a1a8c050f41252a6febd
1 parent
09d136ebff
Exists in
master
and in
2 other branches
número de orden para cisterna carga
Showing
1 changed file
with
8 additions
and
5 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -53,8 +53,6 @@ angular.module('focaModalDetalleCisternas') |
53 | 53 | $scope.vehiculo = res[0].data; |
54 | 54 | $scope.cisternas = res[1].data; |
55 | 55 | |
56 | - aplicarOrden($scope.cisternas, $scope.orden); | |
57 | - | |
58 | 56 | if (!$scope.cisternas.length) { |
59 | 57 | focaModalService.alert('El vehículo no tiene cisternas') |
60 | 58 | .then(function () { |
... | ... | @@ -87,7 +85,7 @@ angular.module('focaModalDetalleCisternas') |
87 | 85 | focaModalService.alert('El remito no tiene articulos').then(function() { |
88 | 86 | |
89 | 87 | $uibModalInstance.dismiss(); |
90 | - }) | |
88 | + }); | |
91 | 89 | return; |
92 | 90 | } |
93 | 91 | |
... | ... | @@ -318,12 +316,15 @@ angular.module('focaModalDetalleCisternas') |
318 | 316 | return false; |
319 | 317 | } |
320 | 318 | for(var i = 0; i < $scope.cisternas.length; i++) { |
321 | - if($scope.aCargar[i] > $scope.cisternas[i].disponible) { | |
319 | + if ($scope.aCargar[i] > $scope.cisternas[i].disponible && | |
320 | + !$scope.cisternas[i].disabled) | |
321 | + { | |
322 | 322 | return false; |
323 | 323 | } |
324 | 324 | } |
325 | 325 | return true; |
326 | 326 | }; |
327 | + | |
327 | 328 | $scope.tieneArticulosPendientes = function() { |
328 | 329 | var algunValorNegativo = $scope.aCargar.filter(function(p) { |
329 | 330 | return p < 0; |
... | ... | @@ -387,7 +388,7 @@ angular.module('focaModalDetalleCisternas') |
387 | 388 | cisterna.disponible = cisterna.capacidad; |
388 | 389 | } |
389 | 390 | |
390 | - if (cisterna.cisternaCarga.orden != orden) { | |
391 | + if (cisterna.cisternaCarga.orden !== orden) { | |
391 | 392 | cisterna.cisternaCarga = { orden: orden }; |
392 | 393 | cisterna.disponible = cisterna.capacidad; |
393 | 394 | } |
... | ... | @@ -398,6 +399,8 @@ angular.module('focaModalDetalleCisternas') |
398 | 399 | |
399 | 400 | function validarCargas(cis, remito) { |
400 | 401 | |
402 | + aplicarOrden(cis, $scope.orden); | |
403 | + | |
401 | 404 | var result = true; |
402 | 405 | var cisternas = angular.copy(cis); |
403 | 406 | var articulos = angular.copy(remito.articulosRemito); |