Commit 2723a81a4692351f209c4599dfc28f581f86e467
1 parent
4f696483ae
Exists in
master
seteo fecha en el servicio
Showing
1 changed file
with
9 additions
and
6 deletions
Show diff stats
src/js/controllerDetalleVehiculo.js
| ... | ... | @@ -7,9 +7,8 @@ angular.module('focaLogisticaPedidoRuta') |
| 7 | 7 | 'focaModalService', |
| 8 | 8 | '$filter', |
| 9 | 9 | 'focaLogisticaPedidoRutaService', |
| 10 | - 'fechaReparto', | |
| 11 | 10 | function($scope, $uibModalInstance, idVehiculo, idRemito, focaModalService, $filter, |
| 12 | - focaLogisticaPedidoRutaService, fechaReparto | |
| 11 | + focaLogisticaPedidoRutaService | |
| 13 | 12 | ) { |
| 14 | 13 | //seteo variables |
| 15 | 14 | $scope.cargandoDatos = true; |
| ... | ... | @@ -24,7 +23,7 @@ angular.module('focaLogisticaPedidoRuta') |
| 24 | 23 | var promesaRemito; |
| 25 | 24 | var promesaVehiculo = focaLogisticaPedidoRutaService.obtenerVehiculoById(idVehiculo); |
| 26 | 25 | var promesaCisternas = focaLogisticaPedidoRutaService |
| 27 | - .obtenerCisternasPorFecha(idVehiculo, fechaReparto); | |
| 26 | + .obtenerCisternasPorFecha(idVehiculo); | |
| 28 | 27 | if(idRemito !== -1) { |
| 29 | 28 | promesaRemito = focaLogisticaPedidoRutaService.obtenerRemitoById(idRemito); |
| 30 | 29 | } |
| ... | ... | @@ -77,6 +76,7 @@ angular.module('focaLogisticaPedidoRuta') |
| 77 | 76 | for(var i = 0; i < $scope.cisternas.length; i++) { |
| 78 | 77 | var cisterna = $scope.cisternas[i]; |
| 79 | 78 | var aCargar = parseFloat($scope.aCargar[i]); |
| 79 | + var fechaReparto = focaLogisticaPedidoRutaService.fecha; | |
| 80 | 80 | //validaciones |
| 81 | 81 | if(!aCargar) { |
| 82 | 82 | continue; |
| ... | ... | @@ -121,8 +121,10 @@ angular.module('focaLogisticaPedidoRuta') |
| 121 | 121 | } |
| 122 | 122 | }; |
| 123 | 123 | $scope.calcularPorcentaje = function(cisterna) { |
| 124 | - if(!cisterna.cisternaCarga.cantidad) { | |
| 125 | - cisterna.cisternaCarga.cantidad = 0; | |
| 124 | + if(!cisterna.cisternaCarga) { | |
| 125 | + cisterna.cisternaCarga = { | |
| 126 | + cantidad: 0 | |
| 127 | + }; | |
| 126 | 128 | } |
| 127 | 129 | var porcentaje = (cisterna.cisternaCarga.cantidad * 100 / |
| 128 | 130 | cisterna.capacidad) + '%'; |
| ... | ... | @@ -156,7 +158,8 @@ angular.module('focaLogisticaPedidoRuta') |
| 156 | 158 | $scope.cisternas[i].disabled = true; |
| 157 | 159 | continue; |
| 158 | 160 | } |
| 159 | - if($scope.cisternas[i].cisternaCarga.idProducto && | |
| 161 | + if($scope.cisternas[i].cisternaCarga && | |
| 162 | + $scope.cisternas[i].cisternaCarga.idProducto && | |
| 160 | 163 | $scope.articuloSeleccionado.idArticulo !== |
| 161 | 164 | $scope.cisternas[i].cisternaCarga.idProducto) |
| 162 | 165 | { |