Commit 4cb41e811c29da565df63c4c776d73f49a147ac4
Exists in
master
Merge branch 'master' into 'master'
Master See merge request modulos-npm/foca-crear-nota-pedido!85
Showing
1 changed file
Show diff stats
src/js/controller.js
... | ... | @@ -44,13 +44,8 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
44 | 44 | var monedaPorDefecto; |
45 | 45 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' |
46 | 46 | crearNotaPedidoService.getCotizacionByIdMoneda(1).then(function(res) { |
47 | - monedaPorDefecto = { | |
48 | - id: res.data[0].ID, | |
49 | - detalle: res.data[0].DETALLE, | |
50 | - simbolo: res.data[0].SIMBOLO, | |
51 | - cotizaciones: res.data[0].cotizaciones | |
52 | - }; | |
53 | - addCabecera('Moneda:', monedaPorDefecto.detalle); | |
47 | + monedaPorDefecto = res.data[0]; | |
48 | + addCabecera('Moneda:', monedaPorDefecto.DETALLE); | |
54 | 49 | addCabecera('Fecha cotizacion:', |
55 | 50 | new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); |
56 | 51 | addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].VENDEDOR); |
... | ... | @@ -212,6 +207,16 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', |
212 | 207 | $filter('date')($scope.notaPedido.cotizacion.FECHA, 'dd/MM/yyyy') |
213 | 208 | ); |
214 | 209 | addCabecera('Cotizacion:', $scope.notaPedido.cotizacion.VENDEDOR); |
210 | + crearNotaPedidoService.getNumeroNotaPedido().then( | |
211 | + function(res) { | |
212 | + $scope.puntoVenta = rellenar(res.data.sucursal, 4); | |
213 | + $scope.comprobante = rellenar(res.data.numeroNotaPedido, 8); | |
214 | + }, | |
215 | + function(err) { | |
216 | + focaModalService.alert('La terminal no esta configurada correctamente'); | |
217 | + console.info(err); | |
218 | + } | |
219 | + ); | |
215 | 220 | $scope.notaPedido.vendedor = {}; |
216 | 221 | $scope.notaPedido.cliente = {}; |
217 | 222 | $scope.notaPedido.proveedor = {}; |