Commit 92bf19da4465e2fc505b1c7fd68602b2fc94bb6a
1 parent
0ddc35a93f
Exists in
master
todo
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
src/js/controller.js
| 1 | angular.module('focaModalDetalleHojaRuta') | 1 | angular.module('focaModalDetalleHojaRuta') |
| 2 | .controller('focaModalDetalleHojaRutaController', | 2 | .controller('focaModalDetalleHojaRutaController', |
| 3 | [ | 3 | [ |
| 4 | '$filter', | 4 | '$filter', |
| 5 | '$scope', | 5 | '$scope', |
| 6 | '$uibModalInstance', | 6 | '$uibModalInstance', |
| 7 | 'parametros', | 7 | 'parametros', |
| 8 | 'focaModalDetalleHojaRutaService', | 8 | 'focaModalDetalleHojaRutaService', |
| 9 | 'focaModalService', | 9 | 'focaModalService', |
| 10 | 'focaSeguimientoService', | 10 | 'focaSeguimientoService', |
| 11 | '$uibModal', | 11 | '$uibModal', |
| 12 | function($filter, $scope, $uibModalInstance, parametros, focaModalDetalleHojaRutaService, | 12 | function($filter, $scope, $uibModalInstance, parametros, focaModalDetalleHojaRutaService, |
| 13 | focaModalService, focaSeguimientoService, $uibModal) | 13 | focaModalService, focaSeguimientoService, $uibModal) |
| 14 | { | 14 | { |
| 15 | //Seteo variables | 15 | //Seteo variables |
| 16 | $scope.remito = parametros.remito; | 16 | $scope.remito = parametros.remito; |
| 17 | $scope.cisternas = parametros.remito.cisternas; | 17 | $scope.cisternas = parametros.remito.cisternas; |
| 18 | $scope.articuloSeleccionado = {}; | 18 | $scope.articuloSeleccionado = {}; |
| 19 | $scope.aDescargar = []; | 19 | $scope.aDescargar = []; |
| 20 | $scope.cargando = false; | 20 | $scope.cargando = false; |
| 21 | 21 | ||
| 22 | //Datos | 22 | //Datos |
| 23 | // var promesaRemito = focaModalDetalleHojaRutaService | 23 | // var promesaRemito = focaModalDetalleHojaRutaService |
| 24 | // .getRemitoById(idRemito); | 24 | // .getRemitoById(idRemito); |
| 25 | // var promesaCisternas = focaModalDetalleHojaRutaService | 25 | // var promesaCisternas = focaModalDetalleHojaRutaService |
| 26 | // .getCisternasByIdRemito(idRemito); | 26 | // .getCisternasByIdRemito(idRemito); |
| 27 | 27 | ||
| 28 | // Promise.all([promesaRemito, promesaCisternas]).then(function(res) { | 28 | // Promise.all([promesaRemito, promesaCisternas]).then(function(res) { |
| 29 | // $scope.cargando = false; | 29 | // $scope.cargando = false; |
| 30 | // $scope.remito = res[0].data; | 30 | // $scope.remito = res[0].data; |
| 31 | // $scope.cisternas = res[1].data; | 31 | // $scope.cisternas = res[1].data; |
| 32 | // var articuloAChequear = $scope.remito.articulosRemito.filter( | 32 | // var articuloAChequear = $scope.remito.articulosRemito.filter( |
| 33 | // function(articulo) { | 33 | // function(articulo) { |
| 34 | // return !articulo.descargado; | 34 | // return !articulo.descargado; |
| 35 | // }); | 35 | // }); |
| 36 | // if(!articuloAChequear.length || $scope.remito.rechazado) { | 36 | // if(!articuloAChequear.length || $scope.remito.rechazado) { |
| 37 | // $scope.readonly = true; | 37 | // $scope.readonly = true; |
| 38 | // $scope.cambio($scope.remito.articulosRemito[0]); | 38 | // $scope.cambio($scope.remito.articulosRemito[0]); |
| 39 | // }else { | 39 | // }else { |
| 40 | // $scope.cambio(articuloAChequear[0]); | 40 | // $scope.cambio(articuloAChequear[0]); |
| 41 | // } | 41 | // } |
| 42 | // $scope.$digest(); | 42 | // $scope.$digest(); |
| 43 | // }, function() { | 43 | // }, function() { |
| 44 | // focaModalService.alert('El servicio no responde intente más tarde'); | 44 | // focaModalService.alert('El servicio no responde intente más tarde'); |
| 45 | // $uibModalInstance.dismiss(); | 45 | // $uibModalInstance.dismiss(); |
| 46 | // }); | 46 | // }); |
| 47 | $scope.cambio = function(articulo) { | 47 | $scope.cambio = function(articulo) { |
| 48 | if(!$scope.articuloSeleccionado.descargado) { | 48 | if(!$scope.articuloSeleccionado.descargado) { |
| 49 | $scope.articuloSeleccionado.cantidadDescargada = 0; | 49 | $scope.articuloSeleccionado.cantidadDescargada = 0; |
| 50 | } | 50 | } |
| 51 | $scope.aDescargar = []; | 51 | $scope.aDescargar = []; |
| 52 | $scope.articuloSeleccionado = articulo; | 52 | $scope.articuloSeleccionado = articulo; |
| 53 | }; | 53 | }; |
| 54 | $scope.descargar = function(key) { | 54 | $scope.descargar = function(key) { |
| 55 | if(key === 13) { | 55 | if(key === 13) { |
| 56 | $scope.cargando = true; | 56 | $scope.cargando = true; |
| 57 | var hojaRutaMovimientos = []; | 57 | var hojaRutaMovimientos = []; |
| 58 | var cisternaMovimientos = []; | 58 | var cisternaMovimientos = []; |
| 59 | var cisternaCargas = []; | 59 | var cisternaCargas = []; |
| 60 | var totalADescargar = 0; | 60 | var totalADescargar = 0; |
| 61 | for(var i = 0; i < $scope.aDescargar.length; i++) { | 61 | for(var i = 0; i < $scope.aDescargar.length; i++) { |
| 62 | totalADescargar += $scope.aDescargar[i] || 0; | 62 | totalADescargar += $scope.aDescargar[i] || 0; |
| 63 | } | 63 | } |
| 64 | focaModalService | 64 | focaModalService |
| 65 | .confirm('¿Desea descargar ' + totalADescargar + ' litros de ' + | 65 | .confirm('¿Desea descargar ' + totalADescargar + ' litros de ' + |
| 66 | $scope.articuloSeleccionado.descripcion + '?') | 66 | $scope.articuloSeleccionado.descripcion + '?') |
| 67 | .then(descargar, function() { | 67 | .then(descargar, function() { |
| 68 | $scope.cargando = false; | 68 | $scope.cargando = false; |
| 69 | }); | 69 | }); |
| 70 | } | 70 | } |
| 71 | function descargar() { | 71 | function descargar() { |
| 72 | for(var i = 0; i < $scope.cisternas.length; i++) { | 72 | for(var i = 0; i < $scope.cisternas.length; i++) { |
| 73 | var descarga = $scope.aDescargar[i]; | 73 | var descarga = $scope.aDescargar[i]; |
| 74 | var cisternaCarga = $scope.cisternas[i].cisternaCarga; | 74 | var cisternaCarga = $scope.cisternas[i].cisternaCarga; |
| 75 | if(!descarga) continue; | 75 | if(!descarga) continue; |
| 76 | if(descarga > cisternaCarga.cantidad) { | 76 | if(descarga > cisternaCarga.cantidad) { |
| 77 | focaModalService.alert('La cantidad a descargar no debe ser ' + | 77 | focaModalService.alert('La cantidad a descargar no debe ser ' + |
| 78 | 'mayor a la cantidad de la cisterna'); | 78 | 'mayor a la cantidad de la cisterna'); |
| 79 | $scope.cargando = false; | 79 | $scope.cargando = false; |
| 80 | return; | 80 | return; |
| 81 | } | 81 | } |
| 82 | cisternaCarga.cantidad -= descarga; | 82 | cisternaCarga.cantidad -= descarga; |
| 83 | 83 | ||
| 84 | //Guardar | 84 | //Guardar |
| 85 | var now = new Date(); | 85 | var now = new Date(); |
| 86 | var cisternaMovimiento = { | 86 | var cisternaMovimiento = { |
| 87 | fecha: now.toISOString().slice(0, 19).replace('T', ' '), | 87 | fecha: now.toISOString().slice(0, 19).replace('T', ' '), |
| 88 | cantidad: descarga, | 88 | cantidad: descarga, |
| 89 | metodo: 'descarga', | 89 | metodo: 'descarga', |
| 90 | idCisternaCarga: cisternaCarga.id, | 90 | idCisternaCarga: cisternaCarga.id, |
| 91 | idRemito: $scope.remito.id | 91 | idRemito: $scope.remito.id |
| 92 | }; | 92 | }; |
| 93 | var hojaRutaMovimiento = { | 93 | var hojaRutaMovimiento = { |
| 94 | reciboDescarga: $scope.numeroRecibo, | 94 | reciboDescarga: $scope.numeroRecibo, |
| 95 | idRemito: $scope.remito.id | 95 | idRemito: $scope.remito.id |
| 96 | }; | 96 | }; |
| 97 | delete cisternaCarga.articulo; | 97 | delete cisternaCarga.articulo; |
| 98 | cisternaCargas.push(cisternaCarga); | 98 | cisternaCargas.push(cisternaCarga); |
| 99 | cisternaMovimientos.push(cisternaMovimiento); | 99 | cisternaMovimientos.push(cisternaMovimiento); |
| 100 | hojaRutaMovimientos.push(hojaRutaMovimiento); | 100 | hojaRutaMovimientos.push(hojaRutaMovimiento); |
| 101 | } | 101 | } |
| 102 | var save = { | 102 | var save = { |
| 103 | cisternaCargas: cisternaCargas, | 103 | cisternaCargas: cisternaCargas, |
| 104 | cisternaMovimientos: cisternaMovimientos, | 104 | cisternaMovimientos: cisternaMovimientos, |
| 105 | hojaRutaMovimientos: hojaRutaMovimientos, | 105 | hojaRutaMovimientos: hojaRutaMovimientos, |
| 106 | articulo: $scope.articuloSeleccionado | 106 | articulo: $scope.articuloSeleccionado |
| 107 | }; | 107 | }; |
| 108 | 108 | ||
| 109 | focaSeguimientoService.obtenerPosicion(getPosition) | 109 | focaSeguimientoService.obtenerPosicion(getPosition) |
| 110 | 110 | ||
| 111 | var posicion; | 111 | var posicion; |
| 112 | 112 | ||
| 113 | function getPosition(position) { | 113 | function getPosition(position) { |
| 114 | 114 | ||
| 115 | posicion = { | 115 | posicion = { |
| 116 | latitud: position.coords.latitude, | 116 | latitud: position.coords.latitude, |
| 117 | longitud: position.coords.longitude, | 117 | longitud: position.coords.longitude, |
| 118 | actividad: 'Entrega de producto', | 118 | actividad: 'Entrega de producto', |
| 119 | observaciones: $scope.remito.observaciones | 119 | observaciones: $scope.remito.observaciones |
| 120 | } | 120 | } |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | $scope.aDescargar = []; | 123 | $scope.aDescargar = []; |
| 124 | $scope.remito.observaciones = ''; | 124 | $scope.remito.observaciones = ''; |
| 125 | 125 | ||
| 126 | if ($scope.articuloSeleccionado.cantidadDescargada === | 126 | if ($scope.articuloSeleccionado.cantidadDescargada === |
| 127 | $scope.articuloSeleccionado.cantidad ) { | 127 | $scope.articuloSeleccionado.cantidad ) { |
| 128 | 128 | ||
| 129 | $scope.articuloSeleccionado.descargado = true; | 129 | $scope.articuloSeleccionado.descargado = true; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | var siguienteArticulo = $scope.remito.articulosRemito.filter( | 132 | var siguienteArticulo = $scope.remito.articulosRemito.filter( |
| 133 | function(articulo) { | 133 | function(articulo) { |
| 134 | return articulo.id != $scope.articuloSeleccionado.id; | 134 | return articulo.id != $scope.articuloSeleccionado.id; |
| 135 | } | 135 | } |
| 136 | ); | 136 | ); |
| 137 | 137 | ||
| 138 | if (siguienteArticulo.length) { | 138 | if (siguienteArticulo.length) { |
| 139 | $scope.cambio(siguienteArticulo[0]); | 139 | $scope.cambio(siguienteArticulo[0]); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | $scope.actualizarPuntoDescarga(); | 142 | //TODO: enviar puntos de descarga, se quita para la demo. |
| 143 | // $scope.actualizarPuntoDescarga(); | ||
| 143 | 144 | ||
| 144 | focaModalDetalleHojaRutaService | 145 | focaModalDetalleHojaRutaService |
| 145 | .postMovimientoHojaRuta(save) | 146 | .postMovimientoHojaRuta(save) |
| 146 | .then(guardarSeguimiento); | 147 | .then(guardarSeguimiento); |
| 147 | 148 | ||
| 148 | |||
| 149 | function guardarSeguimiento(res) { | 149 | function guardarSeguimiento(res) { |
| 150 | 150 | ||
| 151 | posicion.idComprobante = res.data[0].id; | 151 | posicion.idComprobante = res.data[0].id; |
| 152 | focaModalDetalleHojaRutaService.guardarPosicion({ posicion: posicion }); | 152 | focaModalDetalleHojaRutaService.guardarPosicion({ posicion: posicion }); |
| 153 | } | 153 | } |
| 154 | } | 154 | } |
| 155 | }; | 155 | }; |
| 156 | 156 | ||
| 157 | $scope.cancel = function() { | 157 | $scope.cancel = function() { |
| 158 | $uibModalInstance.dismiss('cancel'); | 158 | $uibModalInstance.dismiss('cancel'); |
| 159 | }; | 159 | }; |
| 160 | 160 | ||
| 161 | $scope.distribucionDisponible = function() { | 161 | $scope.distribucionDisponible = function() { |
| 162 | return $scope.articuloSeleccionado.cantidadDescargada && | 162 | return $scope.articuloSeleccionado.cantidadDescargada && |
| 163 | $scope.articuloSeleccionado.cantidadDescargada <= | 163 | $scope.articuloSeleccionado.cantidadDescargada <= |
| 164 | $scope.articuloSeleccionado.cantidad; | 164 | $scope.articuloSeleccionado.cantidad; |
| 165 | }; | 165 | }; |
| 166 | 166 | ||
| 167 | $scope.actualizarArticulo = function() { | 167 | $scope.actualizarArticulo = function() { |
| 168 | $scope.articuloSeleccionado.cantidadDescargada = 0; | 168 | $scope.articuloSeleccionado.cantidadDescargada = 0; |
| 169 | for(var i = 0; i < $scope.aDescargar.length; i++) { | 169 | for(var i = 0; i < $scope.aDescargar.length; i++) { |
| 170 | $scope.articuloSeleccionado.cantidadDescargada += | 170 | $scope.articuloSeleccionado.cantidadDescargada += |
| 171 | parseFloat($scope.aDescargar[i]) || 0; | 171 | parseFloat($scope.aDescargar[i]) || 0; |
| 172 | } | 172 | } |
| 173 | }; | 173 | }; |
| 174 | 174 | ||
| 175 | $scope.actualizarPuntoDescarga = function() { | 175 | $scope.actualizarPuntoDescarga = function() { |
| 176 | var modalInstance = $uibModal.open( | 176 | var modalInstance = $uibModal.open( |
| 177 | { | 177 | { |
| 178 | ariaLabelledBy: 'Actualizar punto de descarga', | 178 | ariaLabelledBy: 'Actualizar punto de descarga', |
| 179 | templateUrl: 'modal-actualizar-punto-descarga.html', | 179 | templateUrl: 'modal-actualizar-punto-descarga.html', |
| 180 | controller: 'focaModalActualizarPuntoDescargaController', | 180 | controller: 'focaModalActualizarPuntoDescargaController', |
| 181 | resolve: { | 181 | resolve: { |
| 182 | notaPedido: function() { | 182 | notaPedido: function() { |
| 183 | return $scope.remito.notaPedido; | 183 | return $scope.remito.notaPedido; |
| 184 | } | 184 | } |
| 185 | }, | 185 | }, |
| 186 | size: 'lg' | 186 | size: 'lg' |
| 187 | } | 187 | } |
| 188 | ); | 188 | ); |
| 189 | modalInstance.result.then(function() { | 189 | modalInstance.result.then(function() { |
| 190 | success().then(function() { | 190 | success().then(function() { |
| 191 | $uibModalInstance.close($scope.remito); | 191 | $uibModalInstance.close($scope.remito); |
| 192 | }); | 192 | }); |
| 193 | }, function() { | 193 | }, function() { |
| 194 | success().then(function() { | 194 | success().then(function() { |
| 195 | $uibModalInstance.close($scope.remito); | 195 | $uibModalInstance.close($scope.remito); |
| 196 | }); | 196 | }); |
| 197 | }); | 197 | }); |
| 198 | }; | 198 | }; |
| 199 | 199 | ||
| 200 | $scope.rechazar = function() { | 200 | $scope.rechazar = function() { |
| 201 | focaModalService | 201 | focaModalService |
| 202 | .prompt({ | 202 | .prompt({ |
| 203 | titulo: 'Aclare el motivo de rechazo' | 203 | titulo: 'Aclare el motivo de rechazo' |
| 204 | }) | 204 | }) |
| 205 | .then(function(motivo) { | 205 | .then(function(motivo) { |
| 206 | $scope.cargando = true; | 206 | $scope.cargando = true; |
| 207 | var remitoRechazado = $.extend(true, {}, $scope.remito); | 207 | var remitoRechazado = $.extend(true, {}, $scope.remito); |
| 208 | delete remitoRechazado.articulosRemito; | 208 | delete remitoRechazado.articulosRemito; |
| 209 | delete remitoRechazado.notaPedido; | 209 | delete remitoRechazado.notaPedido; |
| 210 | remitoRechazado.rechazado = true; | 210 | remitoRechazado.rechazado = true; |
| 211 | remitoRechazado.motivoRechazo = motivo; | 211 | remitoRechazado.motivoRechazo = motivo; |
| 212 | remitoRechazado.fechaRemito = | 212 | remitoRechazado.fechaRemito = |
| 213 | remitoRechazado.fechaRemito.slice(0, 19).replace('T', ' '); | 213 | remitoRechazado.fechaRemito.slice(0, 19).replace('T', ' '); |
| 214 | focaModalDetalleHojaRutaService.rechazarRemito(remitoRechazado) | 214 | focaModalDetalleHojaRutaService.rechazarRemito(remitoRechazado) |
| 215 | .then(function(res) { | 215 | .then(function(res) { |
| 216 | focaSeguimientoService.guardarPosicion( | 216 | focaSeguimientoService.guardarPosicion( |
| 217 | 'Entrega de producto', | 217 | 'Entrega de producto', |
| 218 | res.data[1].id, | 218 | res.data[1].id, |
| 219 | motivo); | 219 | motivo); |
| 220 | success(); | 220 | success(); |
| 221 | }) | 221 | }) |
| 222 | .catch(error); | 222 | .catch(error); |
| 223 | $scope.readonly = true; | 223 | $scope.readonly = true; |
| 224 | }); | 224 | }); |
| 225 | }; | 225 | }; |
| 226 | 226 | ||
| 227 | //funciones | 227 | //funciones |
| 228 | function error(error) { | 228 | function error(error) { |
| 229 | focaModalService.alert('Hubo un error ' + error); | 229 | focaModalService.alert('Hubo un error ' + error); |
| 230 | } | 230 | } |
| 231 | function success() { | 231 | function success() { |
| 232 | $scope.cargando = false; | 232 | $scope.cargando = false; |
| 233 | return focaModalService.alert('Operación realizada con éxito'); | 233 | return focaModalService.alert('Operación realizada con éxito'); |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | var articuloAChequear = $scope.remito.articulosRemito.filter( | 236 | var articuloAChequear = $scope.remito.articulosRemito.filter( |
| 237 | function(articulo) { | 237 | function(articulo) { |
| 238 | return !articulo.descargado; | 238 | return !articulo.descargado; |
| 239 | }); | 239 | }); |
| 240 | 240 | ||
| 241 | if (!articuloAChequear.length || $scope.remito.rechazado) { | 241 | if (!articuloAChequear.length || $scope.remito.rechazado) { |
| 242 | $scope.readonly = true; | 242 | $scope.readonly = true; |
| 243 | $scope.cambio($scope.remito.articulosRemito[0]); | 243 | $scope.cambio($scope.remito.articulosRemito[0]); |
| 244 | } else { | 244 | } else { |
| 245 | $scope.cambio(articuloAChequear[0]); | 245 | $scope.cambio(articuloAChequear[0]); |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | } | 248 | } |
| 249 | ]) | 249 | ]) |
| 250 | .controller('focaModalActualizarPuntoDescargaController', | 250 | .controller('focaModalActualizarPuntoDescargaController', |
| 251 | [ | 251 | [ |
| 252 | '$scope', | 252 | '$scope', |
| 253 | '$uibModalInstance', | 253 | '$uibModalInstance', |
| 254 | 'focaSeguimientoService', | 254 | 'focaSeguimientoService', |
| 255 | 'focaModalService', | 255 | 'focaModalService', |
| 256 | 'notaPedido', | 256 | 'notaPedido', |
| 257 | 'focaModalDetalleHojaRutaService', | 257 | 'focaModalDetalleHojaRutaService', |
| 258 | function($scope, $uibModalInstance, focaSeguimientoService, | 258 | function($scope, $uibModalInstance, focaSeguimientoService, |
| 259 | focaModalService, notaPedido, focaModalDetalleHojaRutaService) | 259 | focaModalService, notaPedido, focaModalDetalleHojaRutaService) |
| 260 | { | 260 | { |
| 261 | $scope.notaPedido = notaPedido; | 261 | $scope.notaPedido = notaPedido; |
| 262 | $scope.descripcion = ''; | 262 | $scope.descripcion = ''; |
| 263 | focaSeguimientoService.obtenerPosicion(function(res) { | 263 | focaSeguimientoService.obtenerPosicion(function(res) { |
| 264 | $scope.posicion = res.coords; | 264 | $scope.posicion = res.coords; |
| 265 | }); | 265 | }); |
| 266 | 266 | ||
| 267 | $scope.cancel = function() { | 267 | $scope.cancel = function() { |
| 268 | if ($scope.ingreso) { | 268 | if ($scope.ingreso) { |
| 269 | $scope.ingreso = false; | 269 | $scope.ingreso = false; |
| 270 | } else { | 270 | } else { |
| 271 | $uibModalInstance.dismiss(); | 271 | $uibModalInstance.dismiss(); |
| 272 | } | 272 | } |
| 273 | }; | 273 | }; |
| 274 | 274 | ||
| 275 | $scope.select = function(puntoDescarga) { | 275 | $scope.select = function(puntoDescarga) { |
| 276 | if (!$scope.posicion) { | 276 | if (!$scope.posicion) { |
| 277 | focaModalService.alert('No se pudo obtener la ubicación'); | 277 | focaModalService.alert('No se pudo obtener la ubicación'); |
| 278 | return; | 278 | return; |
| 279 | } | 279 | } |
| 280 | puntoDescarga.latitud = $scope.posicion.latitude; | 280 | puntoDescarga.latitud = $scope.posicion.latitude; |
| 281 | puntoDescarga.longitud = $scope.posicion.longitude; | 281 | puntoDescarga.longitud = $scope.posicion.longitude; |
| 282 | focaModalDetalleHojaRutaService.guardarPuntoDescarga(puntoDescarga); | 282 | focaModalDetalleHojaRutaService.guardarPuntoDescarga(puntoDescarga); |
| 283 | $uibModalInstance.close(); | 283 | $uibModalInstance.close(); |
| 284 | }; | 284 | }; |
| 285 | 285 | ||
| 286 | $scope.guardar = function() { | 286 | $scope.guardar = function() { |
| 287 | if (!$scope.posicion) { | 287 | if (!$scope.posicion) { |
| 288 | focaModalService.alert('No se pudo obtener la ubicación'); | 288 | focaModalService.alert('No se pudo obtener la ubicación'); |
| 289 | return; | 289 | return; |
| 290 | } | 290 | } |
| 291 | focaModalDetalleHojaRutaService | 291 | focaModalDetalleHojaRutaService |
| 292 | .guardarPuntoDescarga({ | 292 | .guardarPuntoDescarga({ |
| 293 | id: 0, | 293 | id: 0, |
| 294 | id_cliente: $scope.notaPedido.idCliente, | 294 | id_cliente: $scope.notaPedido.idCliente, |
| 295 | id_da_config_0: $scope.notaPedido.idDomicilio, | 295 | id_da_config_0: $scope.notaPedido.idDomicilio, |
| 296 | descripcion: $scope.descripcion, | 296 | descripcion: $scope.descripcion, |
| 297 | latitud: $scope.posicion.latitude, | 297 | latitud: $scope.posicion.latitude, |
| 298 | longitud: $scope.posicion.longitude | 298 | longitud: $scope.posicion.longitude |
| 299 | }) | 299 | }) |
| 300 | .then(function(res) { | 300 | .then(function(res) { |
| 301 | $uibModalInstance.close(res.data); | 301 | $uibModalInstance.close(res.data); |
| 302 | }); | 302 | }); |
| 303 | }; | 303 | }; |
| 304 | 304 | ||
| 305 | } | 305 | } |
| 306 | ] | 306 | ] |
| 307 | ); | 307 | ); |