Commit f8b1fd103b8880eabfb967ea6a0ecae5d4b764f2
1 parent
00361964f1
Exists in
master
Fix cargar fecha de la nota de pedido seleccionada.
Showing
1 changed file
with
2 additions
and
3 deletions
 
Show diff stats
src/js/controller.js
| ... | ... | @@ -151,11 +151,9 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', | 
| 151 | 151 | focaModalService.alert('Debe cargar al menos un articulo'); | 
| 152 | 152 | return; | 
| 153 | 153 | } | 
| 154 | - var date = new Date(); | |
| 155 | 154 | var notaPedido = { | 
| 156 | 155 | id: $scope.notaPedido.id, | 
| 157 | - fechaCarga: new Date(date.getTime() - (date.getTimezoneOffset() * 60000)) | |
| 158 | - .toISOString().slice(0, 19).replace('T', ' '), | |
| 156 | + fechaCarga: $scope.now.toISOString().slice(0, 19).replace('T', ' '), | |
| 159 | 157 | idVendedor: $scope.notaPedido.vendedor.CodVen, | 
| 160 | 158 | idCliente: $scope.notaPedido.cliente.COD, | 
| 161 | 159 | nombreCliente: $scope.notaPedido.cliente.NOM, | 
| ... | ... | @@ -249,6 +247,7 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', | 
| 249 | 247 | ); | 
| 250 | 248 | modalInstance.result.then( | 
| 251 | 249 | function(notaPedido) { | 
| 250 | + $scope.now = new Date(notaPedido.fechaCarga); | |
| 252 | 251 | //añado cabeceras | 
| 253 | 252 | $scope.notaPedido.id = notaPedido.id; | 
| 254 | 253 | removeCabecera('Moneda:'); | 
