Commit 0a0a9f0c0d9e454677e2a670a23e0be8526fc46d

Authored by Eric Fernandez
Exists in master and in 1 other branch develop

Merge branch 'master' into 'develop'

Master

See merge request !68
src/js/controller.js
... ... @@ -20,7 +20,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
20 20 $rootScope, focaSeguimientoService, APP, focaLoginService, $localStorage)
21 21 {
22 22 config();
23   -
  23 +
24 24 function config() {
25 25 // PARAMETROS INICIALES PARA FUNCIONAMIENTO DEL PROGRAMA
26 26 $scope.notaPedido = {};
... ... @@ -52,16 +52,16 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
52 52 //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]'
53 53 crearNotaPedidoService.getCotizacionByIdMoneda(1).then(function(res) {
54 54 var monedaPorDefecto = res.data[0];
55   -
56 55 $scope.notaPedido.cotizacion = Object.assign(
57 56 {moneda: monedaPorDefecto},
58 57 monedaPorDefecto.cotizaciones[0]
59 58 );
60 59 $scope.inicial.cotizacion = $scope.notaPedido.cotizacion;
  60 + $timeout(function() {getLSNotaPedido();});
61 61 });
62 62  
63 63 init();
64   - $timeout(function() {getLSNotaPedido();});
  64 +
65 65 }
66 66  
67 67 function init() {
... ... @@ -810,7 +810,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
810 810  
811 811 var cabeceras = [];
812 812  
813   - if (notaPedido.cotizacion.moneda.CODIGO_AFIP != 'PES') {
  813 + if (notaPedido.cotizacion.moneda.CODIGO_AFIP !== 'PES') {
814 814 cabeceras.push({
815 815 label: 'Moneda:',
816 816 valor: notaPedido.cotizacion.moneda.DETALLE
... ... @@ -837,7 +837,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
837 837 valor: notaPedido.domicilioStamp
838 838 });
839 839 }
840   -
  840 +
841 841 if (notaPedido.vendedor.NUM) {
842 842 cabeceras.push({
843 843 label: 'Vendedor:',
... ... @@ -910,6 +910,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
910 910  
911 911 $scope.notaPedido.notaPedidoPuntoDescarga =
912 912 formatearPuntosDescarga(notaPedido.notaPedidoPuntoDescarga || []);
  913 +
913 914 addArrayCabecera(cabeceras);
914 915 }
915 916  
... ... @@ -990,8 +991,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
990 991 function getLSNotaPedido() {
991 992 var notaPedido = JSON.parse($localStorage.notaPedido || null);
992 993 if (notaPedido) {
993   - setearNotaPedido(notaPedido);
994 994 delete $localStorage.notaPedido;
  995 + setearNotaPedido(notaPedido);
995 996 }
996 997 }
997 998