Commit 03c151cf85e25f472a138af6a269235bdf9973c2
Exists in
master
and in
1 other branch
Merge branch 'master' into 'develop'
Master See merge request !75
Showing
2 changed files
 
Show diff stats
src/js/controller.js
| ... | ... | @@ -50,20 +50,27 @@ angular.module('focaCrearNotaPedido') .controller('notaPedidoCtrl', | 
| 50 | 50 | if (APP === 'distribuidor') { | 
| 51 | 51 | $scope.idVendedor = focaLoginService.getLoginData().vendedorCobrador; | 
| 52 | 52 | } | 
| 53 | - | |
| 54 | 53 | //Trabajo con la cotización más reciente, por eso uso siempre la primera '[0]' | 
| 55 | 54 | crearNotaPedidoService.getCotizacionByIdMoneda(1).then(function(res) { | 
| 56 | 55 | var monedaPorDefecto = res.data[0]; | 
| 57 | 56 | $scope.notaPedido.cotizacion = Object.assign( | 
| 58 | 57 | {moneda: monedaPorDefecto}, | 
| 59 | 58 | monedaPorDefecto.cotizaciones[0] | 
| 59 | + ); | |
| 60 | + $scope.inicial.cotizacion = $scope.notaPedido.cotizacion; | |
| 61 | + $timeout(function() {getLSNotaPedido();}); | |
| 62 | + }); | |
| 63 | + //Trabajo con el proveedor YPF, por eso uso siempre la primera | |
| 64 | + crearNotaPedidoService.getProveedorById(1).then(function (res){ | |
| 65 | + var proveedorPorDefecto = res.data[0]; | |
| 66 | + $scope.notaPedido.proveedor = Object.assign( | |
| 67 | + {proveedor: proveedorPorDefecto} | |
| 60 | 68 | ); | 
| 61 | - $scope.inicial.cotizacion = $scope.notaPedido.cotizacion; | |
| 62 | - $timeout(function() {getLSNotaPedido();}); | |
| 69 | + $scope.inicial.proveedor = $scope.notaPedido.proveedor; | |
| 63 | 70 | }); | 
| 64 | 71 | |
| 65 | 72 | init(); | 
| 66 | - | |
| 73 | + | |
| 67 | 74 | } | 
| 68 | 75 | |
| 69 | 76 | function init() { | 
src/js/service.js
| ... | ... | @@ -94,6 +94,10 @@ angular.module('focaCrearNotaPedido') | 
| 94 | 94 | }, | 
| 95 | 95 | getVendedorById: function(id) { | 
| 96 | 96 | return $http.get(API_ENDPOINT.URL + '/vendedor-cobrador/' + id); | 
| 97 | + }, | |
| 98 | + getProveedorById: function(id) { | |
| 99 | + return $http.get(API_ENDPOINT.URL + '/proveedor/' + id); | |
| 97 | 100 | } | 
| 101 | + | |
| 98 | 102 | }; | 
| 99 | 103 | }]); |