Commit c53b8ef57359c12fc5bd6d1aebbaf2e67dce2735
1 parent
65f66401b1
Exists in
master
cotizacion de la base de datos
Showing
1 changed file
with
8 additions
and
27 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -20,27 +20,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 20 | 20 | $rootScope, focaSeguimientoService, APP, focaLoginService, $localStorage) |
| 21 | 21 | { |
| 22 | 22 | config(); |
| 23 | - | |
| 24 | - var cotizacionPArgentino = { | |
| 25 | - COTIZACION: 1, | |
| 26 | - C_HD: '', | |
| 27 | - E_HD: '', | |
| 28 | - FECHA: new Date(), | |
| 29 | - ID: 20, | |
| 30 | - ID_MONEDA: 1, | |
| 31 | - VENDEDOR: 1, | |
| 32 | - moneda: { | |
| 33 | - ALIAS_CC: 1091, | |
| 34 | - CODIGO_AFIP: 'PES', | |
| 35 | - COTIZACION: 0, | |
| 36 | - C_HD: '', | |
| 37 | - DETALLE: 'PESOS ARGENTINOS', | |
| 38 | - E_HD: '', | |
| 39 | - FECHA_ULT_COT: new Date(), | |
| 40 | - ID: 1, | |
| 41 | - SIMBOLO: '$' | |
| 42 | - } | |
| 43 | - }; | |
| 23 | + var cotizacionPArgentino = {}; | |
| 44 | 24 | |
| 45 | 25 | function config() { |
| 46 | 26 | // PARAMETROS INICIALES PARA FUNCIONAMIENTO DEL PROGRAMA |
| ... | ... | @@ -696,12 +676,13 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
| 696 | 676 | if (moneda.ID !== 1) { |
| 697 | 677 | $scope.abrirModalCotizacion(moneda); |
| 698 | 678 | } |
| 699 | - moneda = cotizacionPArgentino; | |
| 700 | - $scope.notaPedido.cotizacion = cotizacionPArgentino; | |
| 701 | - $scope.notaPedido.cotizacion.moneda = cotizacionPArgentino.moneda; | |
| 702 | - actualizarCabeceraMoneda(cotizacionPArgentino); | |
| 703 | - }, function() { | |
| 704 | - | |
| 679 | + crearNotaPedidoService.getCotizacionByIdMoneda(1) | |
| 680 | + .then(function (res){ | |
| 681 | + cotizacionPArgentino = res.data[0]; | |
| 682 | + $scope.notaPedido.cotizacion = cotizacionPArgentino; | |
| 683 | + $scope.notaPedido.cotizacion.moneda = moneda; | |
| 684 | + actualizarCabeceraMoneda(cotizacionPArgentino); | |
| 685 | + }); | |
| 705 | 686 | } |
| 706 | 687 | ); |
| 707 | 688 | } |