Commit f3263065a763276b9771c8a4e8caac94e85f42c5
1 parent
d221b1069a
Exists in
master
refactor busqueda clientes2
Showing
1 changed file
with
10 additions
and
15 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -184,17 +184,17 @@ angular.module('focaParametros') |
| 184 | 184 | templateUrl: 'foca-busqueda-cliente-modal.html', |
| 185 | 185 | controller: 'focaBusquedaClienteModalController', |
| 186 | 186 | resolve: { |
| 187 | - vendedor: function() { return null; }, | |
| 188 | - cobrador: function() { return null; } | |
| 187 | + parametros: function () { | |
| 188 | + return { | |
| 189 | + vendedor: function() { return null; }, | |
| 190 | + cobrador: function() { return null; } | |
| 191 | + }; | |
| 192 | + } | |
| 189 | 193 | }, |
| 190 | 194 | size: 'lg' |
| 191 | 195 | } |
| 192 | 196 | ); |
| 193 | - modalInstance.result.then( | |
| 194 | - function(cliente) { | |
| 195 | - $scope.abrirModalDomicilios(cliente); | |
| 196 | - }, function() { } | |
| 197 | - ); | |
| 197 | + modalInstance.result.then($scope.abrirModalDomicilios); | |
| 198 | 198 | }; |
| 199 | 199 | |
| 200 | 200 | $scope.seleccionarProveedor = function() { |
| ... | ... | @@ -245,7 +245,7 @@ angular.module('focaParametros') |
| 245 | 245 | templateUrl: 'modal-domicilio.html', |
| 246 | 246 | controller: 'focaModalDomicilioController', |
| 247 | 247 | resolve: { |
| 248 | - idCliente: function() { return cliente.cod; }, | |
| 248 | + idCliente: function() { return cliente.COD; }, | |
| 249 | 249 | esNuevo: function() { return cliente.esNuevo; } |
| 250 | 250 | }, |
| 251 | 251 | size: 'lg', |
| ... | ... | @@ -258,11 +258,6 @@ angular.module('focaParametros') |
| 258 | 258 | |
| 259 | 259 | $scope[getModulo()].cliente = cliente; |
| 260 | 260 | |
| 261 | - $scope[getModulo()].cliente.COD = cliente.cod; | |
| 262 | - $scope[getModulo()].cliente.CUIT = cliente.cuit; | |
| 263 | - $scope[getModulo()].cliente.NOM = cliente.nom; | |
| 264 | - $scope[getModulo()].cliente.MOD = cliente.mod; | |
| 265 | - | |
| 266 | 261 | var domicilioStamp = |
| 267 | 262 | domicilio.Calle + ' ' + domicilio.Numero + ', ' + |
| 268 | 263 | domicilio.Localidad + ', ' + domicilio.Provincia; |
| ... | ... | @@ -273,7 +268,7 @@ angular.module('focaParametros') |
| 273 | 268 | $scope.$broadcast('addCabecera', { |
| 274 | 269 | label: 'Cliente:', |
| 275 | 270 | seccion: getModulo('label'), |
| 276 | - valor: $filter('rellenarDigitos')(cliente.cod, 5) + ' - ' + cliente.nom | |
| 271 | + valor: $filter('rellenarDigitos')(cliente.COD, 5) + ' - ' + cliente.NOM | |
| 277 | 272 | }); |
| 278 | 273 | $scope.$broadcast('addCabecera', { |
| 279 | 274 | label: 'Domicilio:', |
| ... | ... | @@ -285,7 +280,7 @@ angular.module('focaParametros') |
| 285 | 280 | $scope.seleccionarPuntosDeDescarga(); |
| 286 | 281 | } else { |
| 287 | 282 | focaParametrosService |
| 288 | - .getPuntosDescargaByClienDom(domicilio.id, cliente.cod) | |
| 283 | + .getPuntosDescargaByClienDom(domicilio.id, cliente.COD) | |
| 289 | 284 | .then(function(res) { |
| 290 | 285 | if (res.data.length) $scope.seleccionarPuntosDeDescarga(); |
| 291 | 286 | }); |