Commit 7cff682eef56c7d4fa5f6bb0ef8491c9c095647a

Authored by Eric
1 parent 8ae2f47312
Exists in master and in 1 other branch develop

proveedor por defecto

Showing 1 changed file with 13 additions and 6 deletions   Show diff stats
src/js/controller.js
... ... @@ -54,22 +54,29 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl',
54 54 //Trabajo con el proveedor YPF, por eso uso siempre la primera
55 55  
56 56 var promiseMoneda = crearNotaPedidoService.getCotizacionByIdMoneda(1);
57   - var promiseProveedor = crearNotaPedidoService.getProveedorById(1);
  57 + var promiseProveedor = crearNotaPedidoService.getProveedorById(98);
58 58  
  59 + //TODO refactor después de demo
59 60 Promise.all([promiseMoneda, promiseProveedor]).then(function(res) {
  61 +
60 62 var monedaPorDefecto = res[0].data[0];
  63 +
61 64 $scope.notaPedido.cotizacion = Object.assign(
62 65 {moneda: monedaPorDefecto},
63 66 monedaPorDefecto.cotizaciones[0]
64 67 );
65 68 $scope.inicial.cotizacion = $scope.notaPedido.cotizacion;
  69 +
66 70 var proveedorPorDefecto = res[1].data[0];
67   - $scope.notaPedido.proveedor = Object.assign(
68   - {proveedor: proveedorPorDefecto}
69   - );
  71 +
  72 + $scope.notaPedido.proveedor = proveedorPorDefecto;
70 73 $scope.inicial.proveedor = $scope.notaPedido.proveedor;
71   -
72   - $timeout(function() {getLSNotaPedido();});
  74 +
  75 + $scope.notaPedido.flete = false;
  76 + $scope.notaPedido.fob = false;
  77 + $scope.notaPedido.bomba = false;
  78 +
  79 + $timeout(function() { getLSNotaPedido();} );
73 80 });
74 81  
75 82 init();