Commit 134815dab41df25d88ed82afdcf700991dd47ffe
1 parent
66869d8fc9
Exists in
master
espacio en texto de confirm
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/js/controller.js
1 | angular.module('focaAbmPlazoPago') | 1 | angular.module('focaAbmPlazoPago') |
2 | .controller('focaAbmPlazosPagoController', [ | 2 | .controller('focaAbmPlazosPagoController', [ |
3 | '$scope', 'focaAbmPlazoPagoService', '$location', 'focaModalService', | 3 | '$scope', 'focaAbmPlazoPagoService', '$location', 'focaModalService', |
4 | function($scope, focaAbmPlazoPagoService, $location, focaModalService) { | 4 | function($scope, focaAbmPlazoPagoService, $location, focaModalService) { |
5 | focaAbmPlazoPagoService.obtenerPlazosPago().then(function(datos) { | 5 | focaAbmPlazoPagoService.obtenerPlazosPago().then(function(datos) { |
6 | $scope.plazosPago = datos.data; | 6 | $scope.plazosPago = datos.data; |
7 | }); | 7 | }); |
8 | $scope.editar = function(id) { | 8 | $scope.editar = function(id) { |
9 | $location.path('/plazo-pago/' + id); | 9 | $location.path('/plazo-pago/' + id); |
10 | }; | 10 | }; |
11 | $scope.solicitarConfirmacion = function(plazoPago) { | 11 | $scope.solicitarConfirmacion = function(plazoPago) { |
12 | focaModalService.confirm('¿Está seguro que desea borrar el plazo de pago'+ | 12 | focaModalService.confirm('¿Está seguro que desea borrar el plazo de pago '+ |
13 | plazoPago.item+' '+plazoPago.dias+' ?').then( | 13 | plazoPago.item+' '+plazoPago.dias+' ?').then( |
14 | function(confirm) { | 14 | function(confirm) { |
15 | if(confirm){ | 15 | if(confirm){ |
16 | focaAbmPlazoPagoService.borrarPlazoPago(plazoPago.id); | 16 | focaAbmPlazoPagoService.borrarPlazoPago(plazoPago.id); |
17 | $scope.plazosPago.splice( | 17 | $scope.plazosPago.splice( |
18 | $scope.plazosPago.indexOf(plazoPago), 1 | 18 | $scope.plazosPago.indexOf(plazoPago), 1 |
19 | ); | 19 | ); |
20 | } | 20 | } |
21 | } | 21 | } |
22 | ); | 22 | ); |
23 | }; | 23 | }; |
24 | } | 24 | } |
25 | ]) | 25 | ]) |
26 | .controller('focaAbmPlazoPagoController', [ | 26 | .controller('focaAbmPlazoPagoController', [ |
27 | '$scope', 'focaAbmPlazoPagoService', | 27 | '$scope', 'focaAbmPlazoPagoService', |
28 | '$routeParams', '$location', | 28 | '$routeParams', '$location', |
29 | function( | 29 | function( |
30 | $scope, focaAbmPlazoPagoService, | 30 | $scope, focaAbmPlazoPagoService, |
31 | $routeParams, $location | 31 | $routeParams, $location |
32 | ) { | 32 | ) { |
33 | focaAbmPlazoPagoService.obtenerPlazoPago($routeParams.id) | 33 | focaAbmPlazoPagoService.obtenerPlazoPago($routeParams.id) |
34 | .then(function(datos) { | 34 | .then(function(datos) { |
35 | $scope.plazoPago = { | 35 | $scope.plazoPago = { |
36 | id: 0, | 36 | id: 0, |
37 | idPreciosCondiciones: $routeParams.idPreciosCondiciones, | 37 | idPreciosCondiciones: $routeParams.idPreciosCondiciones, |
38 | item: '', | 38 | item: '', |
39 | dias: '' | 39 | dias: '' |
40 | }; | 40 | }; |
41 | if(datos.data.id) { | 41 | if(datos.data.id) { |
42 | $scope.plazoPago = datos.data; | 42 | $scope.plazoPago = datos.data; |
43 | } | 43 | } |
44 | }); | 44 | }); |
45 | $scope.cancelar = function() { | 45 | $scope.cancelar = function() { |
46 | $location.path('/precio-condicion/' + $routeParams.idPreciosCondiciones); | 46 | $location.path('/precio-condicion/' + $routeParams.idPreciosCondiciones); |
47 | }; | 47 | }; |
48 | $scope.guardar = function(plazoPago) { | 48 | $scope.guardar = function(plazoPago) { |
49 | focaAbmPlazoPagoService.guardarPlazoPago(plazoPago) | 49 | focaAbmPlazoPagoService.guardarPlazoPago(plazoPago) |
50 | .then(function() { | 50 | .then(function() { |
51 | $location.path('/precio-condicion/' + $routeParams.idPreciosCondiciones); | 51 | $location.path('/precio-condicion/' + $routeParams.idPreciosCondiciones); |
52 | }); | 52 | }); |
53 | }; | 53 | }; |
54 | } | 54 | } |
55 | ]); | 55 | ]); |
56 | 56 |