Commit 82e7210ad8bbc60ea476bcec1ee3439e4b5f79ec
1 parent
a5a5ed16a8
Exists in
master
and in
1 other branch
linea al final del archivo
Showing
1 changed file
with
1 additions
and
1 deletions
 
Show diff stats
src/js/businessService.js
| 1 | angular.module('focaCrearNotaPedido') | 1 | angular.module('focaCrearNotaPedido') | 
| 2 | .factory('notaPedidoBusinessService', [ | 2 | .factory('notaPedidoBusinessService', [ | 
| 3 | 'crearNotaPedidoService', | 3 | 'crearNotaPedidoService', | 
| 4 | function(crearNotaPedidoService) { | 4 | function(crearNotaPedidoService) { | 
| 5 | return { | 5 | return { | 
| 6 | addArticulos: function(articulosNotaPedido, idNotaPedido, cotizacion) { | 6 | addArticulos: function(articulosNotaPedido, idNotaPedido, cotizacion) { | 
| 7 | for(var i = 0; i < articulosNotaPedido.length; i++) { | 7 | for(var i = 0; i < articulosNotaPedido.length; i++) { | 
| 8 | delete articulosNotaPedido[i].editCantidad; | 8 | delete articulosNotaPedido[i].editCantidad; | 
| 9 | delete articulosNotaPedido[i].editPrecio; | 9 | delete articulosNotaPedido[i].editPrecio; | 
| 10 | articulosNotaPedido[i].idNotaPedido = idNotaPedido; | 10 | articulosNotaPedido[i].idNotaPedido = idNotaPedido; | 
| 11 | articulosNotaPedido[i].precio = articulosNotaPedido[i].precio * cotizacion; | 11 | articulosNotaPedido[i].precio = articulosNotaPedido[i].precio * cotizacion; | 
| 12 | crearNotaPedidoService.crearArticulosParaNotaPedido(articulosNotaPedido[i]); | 12 | crearNotaPedidoService.crearArticulosParaNotaPedido(articulosNotaPedido[i]); | 
| 13 | } | 13 | } | 
| 14 | }, | 14 | }, | 
| 15 | addEstado: function(idNotaPedido, idVendedor) { | 15 | addEstado: function(idNotaPedido, idVendedor) { | 
| 16 | var date = new Date(); | 16 | var date = new Date(); | 
| 17 | var estado = { | 17 | var estado = { | 
| 18 | idNotaPedido: idNotaPedido, | 18 | idNotaPedido: idNotaPedido, | 
| 19 | fecha: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) | 19 | fecha: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) | 
| 20 | .toISOString().slice(0, 19).replace('T', ' '), | 20 | .toISOString().slice(0, 19).replace('T', ' '), | 
| 21 | estado: 0, | 21 | estado: 0, | 
| 22 | idVendedor: idVendedor | 22 | idVendedor: idVendedor | 
| 23 | }; | 23 | }; | 
| 24 | crearNotaPedidoService.crearEstadoParaNotaPedido(estado); | 24 | crearNotaPedidoService.crearEstadoParaNotaPedido(estado); | 
| 25 | } | 25 | } | 
| 26 | }; | 26 | }; | 
| 27 | }]); | ||
| 27 | }]); |