Commit 780a9f584b05c2fc609c7197453e22a11bed145c

Authored by Pablo Marco del Pont
1 parent 386044763b
Exists in master

- Cambié el servicio focaAbmPlazoPagoService por el focaAbmPreciosCondicionesService.

- Agregué método para editar plazo de pago.
- Eliminé el servicio focaAbmPlazoPagoService de los servicios.
- Agregué títulos.
- Cambié tipos de datos a numérico.
src/js/controller.js
... ... @@ -26,10 +26,10 @@ angular.module('focaAbmPreciosCondiciones')
26 26 }
27 27 ])
28 28 .controller('focaAbmPrecioCondicionController', [
29   - '$scope', 'focaAbmPreciosCondicionesService', 'focaAbmPlazoPagoService',
  29 + '$scope', 'focaAbmPreciosCondicionesService',
30 30 '$routeParams', '$location',
31 31 function(
32   - $scope, focaAbmPreciosCondicionesService, focaAbmPlazoPagoService,
  32 + $scope, focaAbmPreciosCondicionesService,
33 33 $routeParams, $location
34 34 ) {
35 35 focaAbmPreciosCondicionesService.obtenerPrecioCondicion($routeParams.id)
... ... @@ -44,7 +44,7 @@ angular.module('focaAbmPreciosCondiciones')
44 44 };
45 45 if(datos.data.id) {
46 46 $scope.precioCondicion = datos.data;
47   - focaAbmPlazoPagoService.obtenerPlazoPago(datos.data.id)
  47 + focaAbmPreciosCondicionesService.obtenerPlazoPago(datos.data.id)
48 48 .then(function(datos){
49 49 $scope.precioCondicion.plazos = datos.data;
50 50 });
... ... @@ -59,6 +59,12 @@ angular.module('focaAbmPreciosCondiciones')
59 59 $location.path('/precio-condicion');
60 60 });
61 61 };
  62 + $scope.editarPlazoPago = function(id) {
  63 + $location.path(
  64 + '/precio-condicion/' + $scope.precioCondicion.id +
  65 + '/plazo-pago/' + id
  66 + );
  67 + };
62 68 }
63 69 ])
64 70 .controller('focaAbmPreciosCondicionesModalConfirmarController', [
... ... @@ -17,14 +17,7 @@ angular.module('focaAbmPreciosCondiciones')
17 17 },
18 18 borrarPrecioCondicion: function(id) {
19 19 return $http.delete(API_ENDPOINT.URL + '/precio-condicion/' + id);
20   - }
21   - };
22   - }
23   - ])
24   - .service('focaAbmPlazoPagoService', [
25   - '$http', 'API_ENDPOINT',
26   - function($http, API_ENDPOINT) {
27   - return {
  20 + },
28 21 obtenerPlazoPago: function(idPrecioCondicion) {
29 22 return $http.get(
30 23 API_ENDPOINT.URL + '/plazo-pago/precio-condicion/' + idPrecioCondicion
src/views/foca-abm-precios-condiciones-item.html
  1 +<h4>Precios y Condiciones</h4>
1 2 <form>
2 3 <input type="hidden" name="id" ng-model="precioCondicion.id" />
3 4 <div class="form-group row">
... ... @@ -38,7 +39,7 @@
38 39 <div class="col-sm-4">
39 40 <input
40 41 class="form-control"
41   - type="text"
  42 + type="number"
42 43 name="nombre"
43 44 ng-model="precioCondicion.idListaPrecio"
44 45 />
... ... @@ -52,7 +53,7 @@
52 53 <th>Item</th>
53 54 <th>Dias</th>
54 55 <th colspan="2" class="text-center">
55   - <button class="btn btn-default" ng-click="editar(0)">
  56 + <button class="btn btn-default" ng-click="editarPlazoPago(0)">
56 57 <i class="fa fa-plus"></i>
57 58 </button>
58 59 </th>
... ... @@ -61,12 +62,12 @@
61 62 <td ng-bind="plazo.item"></td>
62 63 <td ng-bind="plazo.dias"></td>
63 64 <td class="text-center">
64   - <button class="btn btn-default" ng-click="editarPlazo(plazo.id)">
  65 + <button class="btn btn-default" ng-click="editarPlazoPago(plazo.id)">
65 66 <i class="fa fa-pencil"></i>
66 67 </button>
67 68 <button
68 69 class="btn btn-default"
69   - ng-click="solicitarConfirmacionPlazo(plazo)"
  70 + ng-click="solicitarConfirmacionPlazoPago(plazo)"
70 71 >
71 72 <i class="fa fa-trash"></i>
72 73 </button>
src/views/foca-abm-precios-condiciones-listado.html
  1 +<h4>Precios y Condiciones</h4>
1 2 <table class="table table-sm table-hover table-nonfluid">
2 3 <tr>
3 4 <th>Código</th>