Commit 782fe6bb54c8a054099b81c58247122a573dc028
1 parent
f14db6c534
Exists in
master
terminar Hoja Ruta
Showing
3 changed files
with
22 additions
and
0 deletions
Show diff stats
src/js/controller.js
... | ... | @@ -112,6 +112,19 @@ angular.module('focaHojaRuta') |
112 | 112 | $scope.salir = function() { |
113 | 113 | $location.path('/'); |
114 | 114 | }; |
115 | + | |
116 | + $scope.terminarHojaRuta = function() { | |
117 | + hojaRutaService.terminarHojaRuta($scope.hojasRuta.id).then( | |
118 | + function() { | |
119 | + focaModalService.alert( | |
120 | + 'Hoja de ruta ' + | |
121 | + $filter('comprobante')([$scope.puntoVenta, $scope.comprobante]) + | |
122 | + ' cerrada con éxito' | |
123 | + ); | |
124 | + $location.path('/'); | |
125 | + } | |
126 | + ); | |
127 | + }; | |
115 | 128 | } |
116 | 129 | ]); |
117 | 130 |
src/js/service.js
... | ... | @@ -7,6 +7,9 @@ angular.module('focaHojaRuta') |
7 | 7 | }, |
8 | 8 | postMovimientoHojaRuta: function(datos) { |
9 | 9 | return $http.post(route + '/hoja-ruta/movimiento', datos); |
10 | + }, | |
11 | + terminarHojaRuta: function(hojaRuta) { | |
12 | + return $http.get(route + '/hoja-ruta/terminar/' + hojaRuta); | |
10 | 13 | } |
11 | 14 | }; |
12 | 15 | }]); |
src/views/lista-hoja-ruta.html
... | ... | @@ -101,6 +101,12 @@ |
101 | 101 | <div class="row d-md-none fixed-bottom"> |
102 | 102 | <div class="w-100 bg-dark d-flex px-3 acciones-mobile"> |
103 | 103 | <span class="ml-3 text-muted" ng-click="salir()">Salir</span> |
104 | + <span | |
105 | + class="mr-3 ml-auto" | |
106 | + ng-click="terminarHojaRuta()" | |
107 | + ladda="saveLoading" | |
108 | + data-style="expand-left" | |
109 | + >Terminar</span> | |
104 | 110 | </div> |
105 | 111 | </div> |
106 | 112 | </div> |