From c53b8ef57359c12fc5bd6d1aebbaf2e67dce2735 Mon Sep 17 00:00:00 2001 From: Luigi Date: Mon, 6 May 2019 15:36:10 -0300 Subject: [PATCH] cotizacion de la base de datos --- src/js/controller.js | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/src/js/controller.js b/src/js/controller.js index 0cd9d9b..e2c3828 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -20,27 +20,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', $rootScope, focaSeguimientoService, APP, focaLoginService, $localStorage) { config(); - - var cotizacionPArgentino = { - COTIZACION: 1, - C_HD: '', - E_HD: '', - FECHA: new Date(), - ID: 20, - ID_MONEDA: 1, - VENDEDOR: 1, - moneda: { - ALIAS_CC: 1091, - CODIGO_AFIP: 'PES', - COTIZACION: 0, - C_HD: '', - DETALLE: 'PESOS ARGENTINOS', - E_HD: '', - FECHA_ULT_COT: new Date(), - ID: 1, - SIMBOLO: '$' - } - }; + var cotizacionPArgentino = {}; function config() { // PARAMETROS INICIALES PARA FUNCIONAMIENTO DEL PROGRAMA @@ -696,12 +676,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', if (moneda.ID !== 1) { $scope.abrirModalCotizacion(moneda); } - moneda = cotizacionPArgentino; - $scope.notaPedido.cotizacion = cotizacionPArgentino; - $scope.notaPedido.cotizacion.moneda = cotizacionPArgentino.moneda; - actualizarCabeceraMoneda(cotizacionPArgentino); - }, function() { - + crearNotaPedidoService.getCotizacionByIdMoneda(1) + .then(function (res){ + cotizacionPArgentino = res.data[0]; + $scope.notaPedido.cotizacion = cotizacionPArgentino; + $scope.notaPedido.cotizacion.moneda = moneda; + actualizarCabeceraMoneda(cotizacionPArgentino); + }); } ); } -- 1.9.1