Commit fb875b22e1754f075122f0bbe216d80548aeee04

Authored by Nicolás Guarnieri
1 parent 3641012dc0
Exists in master

refactor para cambio de tabla de vendedores a AVENDCLI

Showing 1 changed file with 13 additions and 13 deletions   Show diff stats
src/js/controller.js
... ... @@ -101,8 +101,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
101 101 var vendedor = res.data;
102 102 $scope.$broadcast('addCabecera', {
103 103 label: 'Vendedor:',
104   - valor: $filter('rellenarDigitos')(vendedor.CodVen, 3) + ' - ' +
105   - vendedor.NomVen
  104 + valor: $filter('rellenarDigitos')(vendedor.NUM, 3) + ' - ' +
  105 + vendedor.NOM
106 106 });
107 107  
108 108 $scope.notaPedido.vendedor = vendedor;
... ... @@ -119,7 +119,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
119 119 }
120 120  
121 121 $scope.crearNotaPedido = function() {
122   - if(!$scope.notaPedido.vendedor.CodVen) {
  122 + if(!$scope.notaPedido.vendedor.id) {
123 123 focaModalService.alert('Ingrese Vendedor');
124 124 return;
125 125 } else if(!$scope.notaPedido.cliente.COD) {
... ... @@ -154,7 +154,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
154 154 var notaPedido = {
155 155 id: $scope.notaPedido.id,
156 156 fechaCarga: $scope.now.toISOString().slice(0, 19).replace('T', ' '),
157   - idVendedor: $scope.notaPedido.vendedor.CodVen,
  157 + idVendedor: $scope.notaPedido.vendedor.id,
158 158 idCliente: $scope.notaPedido.cliente.COD,
159 159 nombreCliente: $scope.notaPedido.cliente.NOM,
160 160 cuitCliente: $scope.notaPedido.cliente.CUIT,
... ... @@ -203,7 +203,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
203 203 }
204 204  
205 205 notaPedidoBusinessService.addEstado(data.data.id,
206   - $scope.notaPedido.vendedor.CodVen);
  206 + $scope.notaPedido.vendedor.id);
207 207  
208 208 focaBotoneraLateralService.endGuardar(true);
209 209 $scope.saveLoading = false;
... ... @@ -229,7 +229,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
229 229 usadoPor: function() {return 'notaPedido';},
230 230 idVendedor: function() {
231 231 if(APP === 'distribuidor')
232   - return $scope.notaPedido.vendedor.CodVen;
  232 + return $scope.notaPedido.vendedor.id;
233 233 else
234 234 return null;
235 235 }
... ... @@ -268,8 +268,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
268 268 },
269 269 {
270 270 label: 'Vendedor:',
271   - valor: $filter('rellenarDigitos')(notaPedido.vendedor.CodVen, 3) +
272   - ' - ' + notaPedido.vendedor.NomVen
  271 + valor: $filter('rellenarDigitos')(notaPedido.vendedor.NUM, 3) +
  272 + ' - ' + notaPedido.vendedor.NOM
273 273 },
274 274 {
275 275 label: 'Proveedor:',
... ... @@ -450,7 +450,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
450 450 query: '/vendedor',
451 451 columnas: [
452 452 {
453   - propiedad: 'CodVen',
  453 + propiedad: 'NUM',
454 454 nombre: 'Código',
455 455 filtro: {
456 456 nombre: 'rellenarDigitos',
... ... @@ -458,7 +458,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
458 458 }
459 459 },
460 460 {
461   - propiedad: 'NomVen',
  461 + propiedad: 'NOM',
462 462 nombre: 'Nombre'
463 463 }
464 464 ],
... ... @@ -468,8 +468,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
468 468 function(vendedor) {
469 469 $scope.$broadcast('addCabecera', {
470 470 label: 'Vendedor:',
471   - valor: $filter('rellenarDigitos')(vendedor.CodVen, 3) + ' - ' +
472   - vendedor.NomVen
  471 + valor: $filter('rellenarDigitos')(vendedor.NUM, 3) + ' - ' +
  472 + vendedor.NOM
473 473 });
474 474 $scope.notaPedido.vendedor = vendedor;
475 475 }, function() {
... ... @@ -521,7 +521,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
521 521 };
522 522  
523 523 $scope.seleccionarCliente = function() {
524   - if(!$scope.notaPedido.vendedor.CodVen) {
  524 + if(!$scope.notaPedido.vendedor.NUM) {
525 525 focaModalService.alert('Primero seleccione un vendedor');
526 526 return;
527 527 }