Commit e22a685b3d74898e1d2b80d877a8aacf9a67a9b4

Authored by Eric
1 parent e51d8be247
Exists in master and in 1 other branch develop

fix id

Showing 1 changed file with 8 additions and 16 deletions   Show diff stats
src/js/controller.js
... ... @@ -7,8 +7,9 @@ angular.module('focaParametros')
7 7 'focaModalService',
8 8 '$timeout',
9 9 '$uibModal',
  10 + '$location',
10 11 function($scope, focaParametrosService, focaBotoneraLateralService, $filter,
11   - focaModalService, $timeout, $uibModal)
  12 + focaModalService, $timeout, $uibModal, $location)
12 13 {
13 14  
14 15 $scope.botonera = [];
... ... @@ -34,6 +35,7 @@ angular.module('focaParametros')
34 35  
35 36 focaParametrosService.saveParametros(getObjGuardar()).then(function() {
36 37 focaModalService.alert('Parámetros guardados con éxito');
  38 + $location.url('/');
37 39 });
38 40 };
39 41  
... ... @@ -342,14 +344,6 @@ angular.module('focaParametros')
342 344 );
343 345 modalInstance.result.then(
344 346 function(cotizacion) {
345   - // var articulosTablaTemp = $scope.notaPedido.articulosNotaPedido || [];
346   - // for (var i = 0; i < articulosTablaTemp.length; i++) {
347   - // articulosTablaTemp[i].precio = articulosTablaTemp[i].precio *
348   - // $scope.notaPedido.cotizacion.VENDEDOR;
349   - // articulosTablaTemp[i].precio = (articulosTablaTemp[i].precio /
350   - // cotizacion.VENDEDOR).toFixed(4);
351   - // }
352   - // $scope[getModulo()].articulosNotaPedido = articulosTablaTemp;
353 347 $scope[getModulo()].cotizacion = cotizacion;
354 348 $scope[getModulo()].cotizacion.moneda = moneda;
355 349  
... ... @@ -466,8 +460,8 @@ angular.module(&#39;focaParametros&#39;)
466 460 $scope[botonPincipal.variable + 'String'] = {
467 461 jsonText: JSON.stringify($scope[botonPincipal.variable]),
468 462 modulo: botonPincipal.variable,
469   - id: $scope[botonPincipal.variable] ?
470   - $scope[botonPincipal.variable].id : null
  463 + id: $scope[botonPincipal.variable + 'String'] ?
  464 + $scope[botonPincipal.variable + 'String'].id : undefined
471 465 };
472 466  
473 467 getCheckeds();
... ... @@ -531,7 +525,7 @@ angular.module(&#39;focaParametros&#39;)
531 525 setearEntidad({
532 526 jsonText: JSON.stringify($scope[getModulo()]),
533 527 modulo: getModulo(),
534   - id: $scope[getModulo()].id
  528 + id: $scope[getModulo() + 'String'].id
535 529 });
536 530 });
537 531 };
... ... @@ -554,7 +548,7 @@ angular.module(&#39;focaParametros&#39;)
554 548 function setearEntidad(entidad) {
555 549  
556 550 $scope[entidad.modulo] = JSON.parse(entidad.jsonText) || {};
557   - $scope[entidad.modulo].id = entidad.id;
  551 + $scope[entidad.modulo + 'String'].id = entidad.id;
558 552  
559 553 if (!$scope[entidad.modulo].domicilio) {
560 554 $scope[entidad.modulo].domicilio = {
... ... @@ -564,9 +558,7 @@ angular.module(&#39;focaParametros&#39;)
564 558  
565 559 var cabeceras = [];
566 560  
567   - if ($scope[entidad.modulo].cotizacion &&
568   - $scope[entidad.modulo].cotizacion.moneda.CODIGO_AFIP !== 'PES')
569   - {
  561 + if ($scope[entidad.modulo].cotizacion) {
570 562 cabeceras.push({
571 563 label: 'Moneda:',
572 564 valor: $scope[entidad.modulo].cotizacion.moneda.DETALLE