Commit 1543b73f2d25e01ae2d4380ba2d428312a8abed3
1 parent
f66ff6ee5e
Exists in
master
and in
1 other branch
Utilizo proveedor YPF por defecto
Showing
2 changed files
with
14 additions
and
1 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -38,6 +38,15 @@ angular.module('focaCrearRemito') .controller('remitoController', |
38 | 38 | |
39 | 39 | $timeout(function() { getLSRemito(); }); |
40 | 40 | }); |
41 | + //Trabajo con el proveedo YPF, por eso uso siempre la primera | |
42 | + crearRemitoService.getProveedorById(1).then(function(res){ | |
43 | + var proveedorPorDefecto = res.data[0]; | |
44 | + $scope.remito.proveedor = Object.assign( | |
45 | + {proveedor: proveedorPorDefecto} | |
46 | + ); | |
47 | + $scope.inicial.proveedor = $scope.remito.proveedor; | |
48 | + $scope.proveedor = angular.copy($scope.remito.proveedor); | |
49 | + }); | |
41 | 50 | |
42 | 51 | //SETEO BOTONERA LATERAL |
43 | 52 | $timeout(function() { |
... | ... | @@ -46,8 +55,9 @@ angular.module('focaCrearRemito') .controller('remitoController', |
46 | 55 | focaBotoneraLateralService.showGuardar(true, $scope.crearRemito); |
47 | 56 | focaBotoneraLateralService.addCustomButton('Salir', salir); |
48 | 57 | }); |
49 | - | |
58 | + | |
50 | 59 | init(); |
60 | + | |
51 | 61 | } |
52 | 62 | |
53 | 63 | function init() { |
src/js/service.js
... | ... | @@ -29,6 +29,9 @@ angular.module('focaCrearRemito') |
29 | 29 | return $http.post(route + '/articulos/remito', |
30 | 30 | {articuloRemito: articuloRemito}); |
31 | 31 | }, |
32 | + getProveedorById: function(id) { | |
33 | + return $http.get(API_ENDPOINT.URL + '/proveedor/' + id); | |
34 | + }, | |
32 | 35 | getDomiciliosByIdRemito: function(id) { |
33 | 36 | return $http.get(route +'/nota-pedido/'+id+'/domicilios'); |
34 | 37 | }, |