diff --git a/src/js/controller.js b/src/js/controller.js index b40565c..e402036 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -112,6 +112,19 @@ angular.module('focaHojaRuta') $scope.salir = function() { $location.path('/'); }; + + $scope.terminarHojaRuta = function() { + hojaRutaService.terminarHojaRuta($scope.hojasRuta.id).then( + function() { + focaModalService.alert( + 'Hoja de ruta ' + + $filter('comprobante')([$scope.puntoVenta, $scope.comprobante]) + + ' cerrada con éxito' + ); + $location.path('/'); + } + ); + }; } ]); diff --git a/src/js/service.js b/src/js/service.js index 3b6b176..8cd3f37 100644 --- a/src/js/service.js +++ b/src/js/service.js @@ -7,6 +7,9 @@ angular.module('focaHojaRuta') }, postMovimientoHojaRuta: function(datos) { return $http.post(route + '/hoja-ruta/movimiento', datos); + }, + terminarHojaRuta: function(hojaRuta) { + return $http.get(route + '/hoja-ruta/terminar/' + hojaRuta); } }; }]); diff --git a/src/views/lista-hoja-ruta.html b/src/views/lista-hoja-ruta.html index 5d68fac..eb53cae 100644 --- a/src/views/lista-hoja-ruta.html +++ b/src/views/lista-hoja-ruta.html @@ -101,6 +101,12 @@