Commit 77c44c008b5c6054c460a785548bc4badd29b473
1 parent
26316adfa7
Exists in
master
guarda bien los datos
Showing
1 changed file
with
10 additions
and
21 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -43,13 +43,8 @@ angular.module('focaCrearRemito') .controller('remitoController', |
43 | 43 | var monedaPorDefecto; |
44 | 44 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' |
45 | 45 | crearRemitoService.getCotizacionByIdMoneda(1).then(function(res) { |
46 | - monedaPorDefecto = { | |
47 | - id: res.data[0].ID, | |
48 | - detalle: res.data[0].DETALLE, | |
49 | - simbolo: res.data[0].SIMBOLO, | |
50 | - cotizaciones: res.data[0].cotizaciones | |
51 | - }; | |
52 | - addCabecera('Moneda:', monedaPorDefecto.detalle); | |
46 | + monedaPorDefecto = res.data[0]; | |
47 | + addCabecera('Moneda:', monedaPorDefecto.DETALLE); | |
53 | 48 | addCabecera('Fecha cotizacion:', |
54 | 49 | new Date(monedaPorDefecto.cotizaciones[0].FECHA).toLocaleDateString()); |
55 | 50 | addCabecera('Cotizacion:', monedaPorDefecto.cotizaciones[0].COTIZACION); |
... | ... | @@ -176,8 +171,8 @@ angular.module('focaCrearRemito') .controller('remitoController', |
176 | 171 | $scope.idLista = -1; |
177 | 172 | } |
178 | 173 | delete notaPedido.id; |
179 | - $scope.remito.domicilioStamp = notaPedido.domicilioStamp; | |
180 | 174 | $scope.remito = notaPedido; |
175 | + $scope.remito.domicilioStamp = notaPedido.domicilioStamp; | |
181 | 176 | $scope.remito.vendedor = notaPedido.vendedor[0]; |
182 | 177 | $scope.remito.cliente = notaPedido.cliente[0]; |
183 | 178 | $scope.remito.proveedor = notaPedido.proveedor[0]; |
... | ... | @@ -365,9 +360,9 @@ angular.module('focaCrearRemito') .controller('remitoController', |
365 | 360 | fechaRemito: |
366 | 361 | new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) |
367 | 362 | .toISOString().slice(0, 19).replace('T', ' '),//TODO$filter |
368 | - idCliente: $scope.remito.idCliente, | |
369 | - nombreCliente: $scope.remito.nombreCliente, | |
370 | - cuitCliente: $scope.remito.cuitCliente, | |
363 | + idCliente: $scope.remito.cliente.COD, | |
364 | + nombreCliente: $scope.remito.cliente.NOM, | |
365 | + cuitCliente: $scope.remito.cliente.CUIT, | |
371 | 366 | responsabilidadIvaCliente: 0,//TODO, |
372 | 367 | descuento: 0,//TODO, |
373 | 368 | importeNeto: 0,//TODO |
... | ... | @@ -395,10 +390,12 @@ angular.module('focaCrearRemito') .controller('remitoController', |
395 | 390 | idProveedor: $scope.remito.idProveedor, |
396 | 391 | idDomicilio: 0,//TODO |
397 | 392 | idCotizacion: $scope.remito.idCotizacion, |
393 | + idPrecioCondicion: $scope.remito.idPrecioCondicion, | |
398 | 394 | flete: $scope.remito.flete, |
399 | 395 | fob: $scope.remito.fob, |
400 | 396 | bomba: $scope.remito.bomba, |
401 | 397 | kilometros: $scope.remito.kilometros, |
398 | + domicilioStamp: $scope.remito.domicilioStamp, | |
402 | 399 | estado: 0,//TODO |
403 | 400 | destinoVenta: 0,//TODO |
404 | 401 | operacionTipo: 0//TODO |
... | ... | @@ -743,16 +740,8 @@ angular.module('focaCrearRemito') .controller('remitoController', |
743 | 740 | cotizacion.COTIZACION; |
744 | 741 | } |
745 | 742 | $scope.articulosTabla = articulosTablaTemp; |
746 | - $scope.remito.moneda = { | |
747 | - id: moneda.ID, | |
748 | - detalle: moneda.DETALLE, | |
749 | - simbolo: moneda.SIMBOLO | |
750 | - }; | |
751 | - $scope.remito.cotizacion = { | |
752 | - ID: cotizacion.ID, | |
753 | - COTIZACION: cotizacion.COTIZACION, | |
754 | - FECHA: cotizacion.FECHA | |
755 | - }; | |
743 | + $scope.remito.moneda = moneda; | |
744 | + $scope.remito.cotizacion = cotizacion; | |
756 | 745 | addCabecera('Moneda:', moneda.DETALLE); |
757 | 746 | addCabecera( |
758 | 747 | 'Fecha cotizacion:', |