Commit 16a91d94ac50fee6d3eb88765a32f3a5057b8e50

Authored by Jose Pinto
Exists in master and in 1 other branch develop

Merge branch 'develop' into 'master'

Develop

See merge request !9
src/js/controller.js
1 angular.module('focaModalPrecioCondicion') 1 angular.module('focaModalPrecioCondicion')
2 .controller('focaModalPrecioCondicionController', 2 .controller('focaModalPrecioCondicionController',
3 [ 3 [
4 '$timeout', 4 '$timeout',
5 '$filter', 5 '$filter',
6 '$scope', 6 '$scope',
7 '$uibModal', 7 '$uibModal',
8 '$uibModalInstance', 8 '$uibModalInstance',
9 'focaModalService', 9 'focaModalService',
10 'focaModalPrecioCondicionService', 10 'focaModalPrecioCondicionService',
11 'idListaPrecio',
11 function( 12 function(
12 $timeout, $filter, $scope, $uibModal, $uibModalInstance, 13 $timeout, $filter, $scope, $uibModal, $uibModalInstance,
13 focaModalService, focaModalPrecioCondicionService 14 focaModalService, focaModalPrecioCondicionService, idListaPrecio
14 ) { 15 ) {
15 16
16 focaModalPrecioCondicionService.getPreciosCondicionesPlazosPagos().then(
17 function(res) {
18 for(var i = 0; i < res.data.length; i++) {
19 var plazosTemp = '';
20 res.data[i].plazoPago.sort(function(a, b) {
21 return a.dias - b.dias;
22 });
23 for(var j = 0; j < res.data[i].plazoPago.length; j++) {
24 if(j + 1 === res.data[i].plazoPago.length) {
25 plazosTemp += res.data[i].plazoPago[j].dias;
26 }else {
27 plazosTemp += res.data[i].plazoPago[j].dias + ', ';
28 }
29 }
30 res.data[i].plazos = plazosTemp.trim();
31 }
32 $scope.precioCondicion = res.data;
33 $scope.search();
34 }
35 );
36 $scope.filters = ''; 17 $scope.filters = '';
37 $scope.ingreso = false; 18 $scope.ingreso = false;
38 $scope.plazosNuevos = []; 19 $scope.plazosNuevos = [];
39 $scope.plazoACargar = 20 $scope.plazoACargar =
40 { 21 {
41 item: 1 22 item: 1
42 }; 23 };
43 // pagination 24 // pagination
44 $scope.numPerPage = 10; 25 $scope.numPerPage = 10;
45 $scope.currentPage = 1; 26 $scope.currentPage = 1;
46 $scope.filteredPrecioCondicion = []; 27 $scope.filteredPrecioCondicion = [];
47 $scope.currentPagePrecioCondicion = []; 28 $scope.currentPagePrecioCondicion = [];
48 $scope.selectedPrecioCondicion = -1; 29 $scope.selectedPrecioCondicion = -1;
49 30
50 //METODOS 31 var funcionGet = idListaPrecio ? 'getPreciosCondicionesByIdListaPrecio' :
32 'getPreciosCondiciones';
33
34 focaModalPrecioCondicionService
35 [funcionGet](idListaPrecio)
36 .then(function(res) {
37 for (var i = 0; i < res.data.length; i++) {
38 var plazosTemp = '';
39 res.data[i].plazoPago.sort(function(a, b) {
40 return a.dias - b.dias;
41 });
42 for (var j = 0; j < res.data[i].plazoPago.length; j++) {
43 if (j + 1 === res.data[i].plazoPago.length) {
44 plazosTemp += res.data[i].plazoPago[j].dias;
45 } else {
46 plazosTemp += res.data[i].plazoPago[j].dias + ', ';
47 }
48 }
49 res.data[i].plazos = plazosTemp.trim();
50 }
51 $scope.precioCondicion = res.data;
52 $scope.search();
53 });
51 54
55 //METODOS
52 $scope.agregarPlazo = function(key) { 56 $scope.agregarPlazo = function(key) {
53 if(key === 13) { 57 if(key === 13) {
54 if(!$scope.plazoACargar.dias) { 58 if(!$scope.plazoACargar.dias) {
55 focaModalService.alert('Ingrese cantidad de días'); 59 focaModalService.alert('Ingrese cantidad de días');
56 return; 60 return;
57 } 61 }
58 var tieneEseDia = $scope.plazosNuevos.filter(function(a) { 62 var tieneEseDia = $scope.plazosNuevos.filter(function(a) {
59 return a.dias === $scope.plazoACargar.dias; 63 return a.dias === $scope.plazoACargar.dias;
60 }); 64 });
61 if(tieneEseDia.length > 0) { 65 if(tieneEseDia.length > 0) {
62 focaModalService.alert('Ya ha ingresado un plazo con esos días'); 66 focaModalService.alert('Ya ha ingresado un plazo con esos días');
63 return; 67 return;
64 } 68 }
65 $scope.plazosNuevos.push($scope.plazoACargar); 69 $scope.plazosNuevos.push($scope.plazoACargar);
66 $scope.plazoACargar = 70 $scope.plazoACargar =
67 { 71 {
68 item: $scope.plazosNuevos.length + 1 72 item: $scope.plazosNuevos.length + 1
69 }; 73 };
70 } 74 }
71 }; 75 };
72 76
73 $scope.volver = function() { 77 $scope.volver = function() {
74 $scope.ingreso = false; 78 $scope.ingreso = false;
75 $scope.plazosNuevos = []; 79 $scope.plazosNuevos = [];
76 $scope.plazoACargar = 80 $scope.plazoACargar =
77 { 81 {
78 item: $scope.plazosNuevos.length + 1 82 item: $scope.plazosNuevos.length + 1
79 }; 83 };
80 }; 84 };
81 85
82 $scope.quitarPlazo = function(key) { 86 $scope.quitarPlazo = function(key) {
83 $scope.plazosNuevos.splice(key, 1); 87 $scope.plazosNuevos.splice(key, 1);
84 $scope.plazoACargar = 88 $scope.plazoACargar =
85 { 89 {
86 item: $scope.plazosNuevos.length + 1 90 item: $scope.plazosNuevos.length + 1
87 }; 91 };
88 }; 92 };
89 93
90 $scope.search = function(pressed) { 94 $scope.search = function(pressed) {
91 $scope.filteredPrecioCondicion = $filter('filter')( 95 $scope.filteredPrecioCondicion = $filter('filter')(
92 $scope.precioCondicion, 96 $scope.precioCondicion,
93 {$: $scope.filters} 97 {$: $scope.filters}
94 ); 98 );
95 99
96 if(pressed) { 100 if(pressed) {
97 if($scope.filteredPrecioCondicion.length === 0) { 101 if($scope.filteredPrecioCondicion.length === 0) {
98 $timeout(function() { 102 $timeout(function() {
99 angular.element('#search')[0].focus(); 103 angular.element('#search')[0].focus();
100 $scope.filters = ''; 104 $scope.filters = '';
101 }); 105 });
102 }else { 106 }else {
103 primera(); 107 primera();
104 } 108 }
105 } 109 }
106 110
107 $scope.lastPage = Math.ceil( 111 $scope.lastPage = Math.ceil(
108 $scope.filteredPrecioCondicion.length / $scope.numPerPage 112 $scope.filteredPrecioCondicion.length / $scope.numPerPage
109 ); 113 );
110 114
111 $scope.resetPage(); 115 $scope.resetPage();
112 }; 116 };
113 117
114 $scope.resetPage = function() { 118 $scope.resetPage = function() {
115 $scope.currentPage = 1; 119 $scope.currentPage = 1;
116 $scope.selectPage(1); 120 $scope.selectPage(1);
117 }; 121 };
118 122
119 $scope.selectPage = function(page) { 123 $scope.selectPage = function(page) {
120 var start = (page - 1) * $scope.numPerPage; 124 var start = (page - 1) * $scope.numPerPage;
121 var end = start + $scope.numPerPage; 125 var end = start + $scope.numPerPage;
122 $scope.paginas = []; 126 $scope.paginas = [];
123 $scope.paginas = calcularPages(page); 127 $scope.paginas = calcularPages(page);
124 $scope.currentPagePrecioCondicion = 128 $scope.currentPagePrecioCondicion =
125 $scope.filteredPrecioCondicion.slice(start, end); 129 $scope.filteredPrecioCondicion.slice(start, end);
126 $scope.currentPage = page; 130 $scope.currentPage = page;
127 }; 131 };
128 132
129 $scope.select = function(precioCondicion) { 133 $scope.select = function(precioCondicion) {
130 $uibModalInstance.close(precioCondicion); 134 $uibModalInstance.close(precioCondicion);
131 }; 135 };
132 136
133 $scope.cancel = function() { 137 $scope.cancel = function() {
134 $uibModalInstance.dismiss('cancel'); 138 $uibModalInstance.dismiss('cancel');
135 }; 139 };
136 140
137 $scope.busquedaDown = function(key) { 141 $scope.busquedaDown = function(key) {
138 if (key === 40) { 142 if (key === 40) {
139 primera(key); 143 primera(key);
140 } 144 }
141 }; 145 };
142 146
143 $scope.busquedaPress = function(key) { 147 $scope.busquedaPress = function(key) {
144 if (key === 13) { 148 if (key === 13) {
145 $scope.search(true); 149 $scope.search(true);
146 } 150 }
147 }; 151 };
148 152
149 $scope.itemProducto = function(key) { 153 $scope.itemProducto = function(key) {
150 if (key === 38) { 154 if (key === 38) {
151 anterior(key); 155 anterior(key);
152 } 156 }
153 157
154 if (key === 40) { 158 if (key === 40) {
155 siguiente(key); 159 siguiente(key);
156 } 160 }
157 161
158 if (key === 37) { 162 if (key === 37) {
159 retrocederPagina(); 163 retrocederPagina();
160 } 164 }
161 165
162 if (key === 39) { 166 if (key === 39) {
163 avanzarPagina(); 167 avanzarPagina();
164 } 168 }
165 }; 169 };
166 170
167 $scope.verListaPrecio = function(id) { 171 $scope.verListaPrecio = function(id) {
168 $uibModal.open( 172 $uibModal.open(
169 { 173 {
170 ariaLabelledBy: 'Busqueda de Productos', 174 ariaLabelledBy: 'Busqueda de Productos',
171 templateUrl: 'modal-busqueda-productos.html', 175 templateUrl: 'modal-busqueda-productos.html',
172 controller: 'modalBusquedaProductosCtrl', 176 controller: 'modalBusquedaProductosCtrl',
173 resolve: { 177 resolve: {
174 parametroProducto: { 178 parametroProducto: {
175 idLista: id, 179 idLista: id,
176 cotizacion: 1, 180 cotizacion: 1,
177 simbolo: '$', 181 simbolo: '$',
178 soloMostrar: true 182 soloMostrar: true
179 } 183 }
180 }, 184 },
181 size: 'md' 185 size: 'md'
182 } 186 }
183 ); 187 );
184 }; 188 };
185 189
186 function calcularPages(paginaActual) { 190 function calcularPages(paginaActual) {
187 var paginas = []; 191 var paginas = [];
188 paginas.push(paginaActual); 192 paginas.push(paginaActual);
189 193
190 if (paginaActual - 1 > 1) { 194 if (paginaActual - 1 > 1) {
191 195
192 paginas.unshift(paginaActual - 1); 196 paginas.unshift(paginaActual - 1);
193 if (paginaActual - 2 > 1) { 197 if (paginaActual - 2 > 1) {
194 paginas.unshift(paginaActual - 2); 198 paginas.unshift(paginaActual - 2);
195 } 199 }
196 } 200 }
197 201
198 if (paginaActual + 1 < $scope.lastPage) { 202 if (paginaActual + 1 < $scope.lastPage) {
199 paginas.push(paginaActual + 1); 203 paginas.push(paginaActual + 1);
200 if (paginaActual + 2 < $scope.lastPage) { 204 if (paginaActual + 2 < $scope.lastPage) {
201 paginas.push(paginaActual + 2); 205 paginas.push(paginaActual + 2);
202 } 206 }
203 } 207 }
204 208
205 if (paginaActual !== 1) { 209 if (paginaActual !== 1) {
206 paginas.unshift(1); 210 paginas.unshift(1);
207 } 211 }
208 212
209 if (paginaActual !== $scope.lastPage) { 213 if (paginaActual !== $scope.lastPage) {
210 paginas.push($scope.lastPage); 214 paginas.push($scope.lastPage);
211 } 215 }
212 216
213 return paginas; 217 return paginas;
214 } 218 }
215 219
216 function primera() { 220 function primera() {
217 $scope.selectedPrecioCondicion = 0; 221 $scope.selectedPrecioCondicion = 0;
218 } 222 }
219 223
220 function anterior() { 224 function anterior() {
221 if ($scope.selectedPrecioCondicion === 0 && $scope.currentPage > 1) { 225 if ($scope.selectedPrecioCondicion === 0 && $scope.currentPage > 1) {
222 retrocederPagina(); 226 retrocederPagina();
223 } else { 227 } else {
224 $scope.selectedPrecioCondicion--; 228 $scope.selectedPrecioCondicion--;
225 } 229 }
226 } 230 }
227 231
228 function siguiente() { 232 function siguiente() {
229 if ($scope.selectedPrecioCondicion < 233 if ($scope.selectedPrecioCondicion <
230 $scope.currentPagePrecioCondicion.length ) { 234 $scope.currentPagePrecioCondicion.length ) {
231 $scope.selectedPrecioCondicion++; 235 $scope.selectedPrecioCondicion++;
232 } else { 236 } else {
233 avanzarPagina(); 237 avanzarPagina();
1 angular.module('focaModalPrecioCondicion') 1 angular.module('focaModalPrecioCondicion')
2 .service('focaModalPrecioCondicionService', [ 2 .service('focaModalPrecioCondicionService', [
3 '$http', 3 '$http',
4 'API_ENDPOINT', 4 'API_ENDPOINT',
5 function($http, API_ENDPOINT) { 5 function($http, API_ENDPOINT) {
6 return { 6 return {
7 getPreciosCondiciones: function() {
8 return $http.get(API_ENDPOINT.URL + '/precio-condicion');
9 },
10 getPlazosByIdPrecioCondicion: function(id) { 7 getPlazosByIdPrecioCondicion: function(id) {
11 return $http.get(API_ENDPOINT.URL + '/plazo-pago/precio-condicion/' + id); 8 return $http.get(API_ENDPOINT.URL + '/plazo-pago/precio-condicion/' + id);
12 }, 9 },
13 getPreciosCondicionesPlazosPagos: function() { 10 getPreciosCondiciones: function() {
14 return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago'); 11 return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago');
12 },
13 getPreciosCondicionesByIdListaPrecio: function(idListaPrecio) {
14 return $http.get(API_ENDPOINT.URL + '/precio-condicion/plazo-pago/' +
15 idListaPrecio);
15 } 16 }
16 }; 17 };
src/views/modal-precio-condicion.html
1 <div class="modal-header py-1"> 1 <div class="modal-header py-1">
2 <div class="row w-100"> 2 <div class="row w-100">
3 <div class="col-lg-6"> 3 <div class="col-lg-6">
4 <h5 ng-show="!ingreso" class="modal-title my-1">Búsqueda de Precio-Condición</h5> 4 <h5 ng-show="!ingreso" class="modal-title my-1">Búsqueda de Precio-Condición</h5>
5 <h5 ng-show="ingreso" class="modal-title my-1">Nuevos Plazos</h5> 5 <h5 ng-show="ingreso" class="modal-title my-1">Nuevos Plazos</h5>
6 </div> 6 </div>
7 <div class="input-group col-lg-6 pr-0 my-2" ng-show="!ingreso"> 7 <div class="input-group col-lg-6 pr-0 my-2" ng-show="!ingreso">
8 <input 8 <input
9 type="text" 9 type="text"
10 class="form-control form-control-sm" 10 class="form-control form-control-sm"
11 id="search" 11 id="search"
12 placeholder="Busqueda" 12 placeholder="Busqueda"
13 ng-model="filters" 13 ng-model="filters"
14 ng-change="search()" 14 ng-change="search()"
15 ng-keydown="busquedaDown($event.keyCode)" 15 ng-keydown="busquedaDown($event.keyCode)"
16 ng-keypress="busquedaPress($event.keyCode)" 16 ng-keypress="busquedaPress($event.keyCode)"
17 foca-focus="selectedPrecioCondicion == -1" 17 foca-focus="selectedPrecioCondicion == -1"
18 ng-focus="selectedPrecioCondicion = -1" 18 ng-focus="selectedPrecioCondicion = -1"
19 teclado-virtual 19 teclado-virtual
20 > 20 >
21 <div class="input-group-append"> 21 <div class="input-group-append">
22 <button 22 <button
23 class="btn btn-outline-secondary" 23 class="btn btn-outline-secondary"
24 type="button" 24 type="button"
25 title="Buscar" 25 title="Buscar"
26 ng-click="busquedaPress(13)"> 26 ng-click="busquedaPress(13)">
27 <i class="fa fa-search" aria-hidden="true"></i> 27 <i class="fa fa-search" aria-hidden="true"></i>
28 </button> 28 </button>
29 </div> 29 </div>
30 </div> 30 </div>
31 </div> 31 </div>
32 </div> 32 </div>
33 <div class="modal-body" id="modal-body"> 33 <div class="modal-body" id="modal-body">
34 34
35 35
36 <table ng-show="!ingreso" class="table table-striped table-sm"> 36 <table ng-show="!ingreso" class="table table-striped table-sm">
37 <thead> 37 <thead>
38 <tr> 38 <tr>
39 <th>Código</th> 39 <th>Código</th>
40 <th>Nombre</th> 40 <th>Nombre</th>
41 <th>Lista Precio</th> 41 <th>Lista Precio</th>
42 <th>Plazos</th> 42 <th>Plazos</th>
43 <th></th> 43 <th></th>
44 </tr> 44 </tr>
45 </thead> 45 </thead>
46 <tbody> 46 <tbody>
47 <tr ng-show="currentPagePrecioCondicion.length == 0"> 47 <tr ng-show="currentPagePrecioCondicion.length == 0">
48 <td colspan="6"> 48 <td colspan="6">
49 No se encontraron resultados. 49 No se encontraron resultados.
50 </td> 50 </td>
51 </tr> 51 </tr>
52 <tr> 52 <tr>
53 <td colspan="4" ng-show="!ingreso"> 53 <td colspan="4" ng-show="!ingreso">
54 <input 54 <input
55 class="form-control form-control-sm" 55 class="form-control form-control-sm"
56 type="text" 56 type="text"
57 placeholder="Selección manual" 57 placeholder="Selección manual"
58 readonly 58 readonly
59 ng-click="ingreso = !ingreso" 59 ng-click="ingreso = !ingreso"
60 /> 60 />
61 </td> 61 </td>
62 <td colspan="1" ng-show="!ingreso"> 62 <td colspan="1" ng-show="!ingreso">
63 <button 63 <button
64 type="button" 64 type="button"
65 class="btn btn-sm p-1 float-right" 65 class="btn btn-sm p-1 float-right"
66 ng-class="{ 66 ng-class="{
67 'btn-secondary': selectedPrecioCondicion != 0, 67 'btn-secondary': selectedPrecioCondicion != 0,
68 'btn-primary': selectedPrecioCondicion == 0 68 'btn-primary': selectedPrecioCondicion == 0
69 }" 69 }"
70 foca-focus="selectedPrecioCondicion == 0" 70 foca-focus="selectedPrecioCondicion == 0"
71 ng-keydown="itemProducto($event.keyCode)" 71 ng-keydown="itemProducto($event.keyCode)"
72 ng-click="ingreso = !ingreso" 72 ng-click="ingreso = !ingreso"
73 > 73 >
74 <i class="fa fa-circle-thin" aria-hidden="true"></i> 74 <i class="fa fa-circle-thin" aria-hidden="true"></i>
75 </button> 75 </button>
76 </td> 76 </td>
77 </tr> 77 </tr>
78 <tr class="selectable" 78 <tr class="selectable"
79 ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion"> 79 ng-repeat="(key, precioCondicion) in currentPagePrecioCondicion">
80 <td ng-bind="precioCondicion.id | rellenarDigitos: 4: 0" 80 <td ng-bind="precioCondicion.id | rellenarDigitos: 4: 0"
81 ng-click="select(precioCondicion)"></td> 81 ng-click="select(precioCondicion)"></td>
82 <td ng-bind="precioCondicion.nombre" 82 <td ng-bind="precioCondicion.nombre"
83 ng-click="select(precioCondicion)"></td> 83 ng-click="select(precioCondicion)"></td>
84 <td ng-bind="precioCondicion.idListaPrecio" 84 <td ng-bind="precioCondicion.idListaPrecio"
85 ng-click="select(precioCondicion)"></td> 85 ng-click="select(precioCondicion)"></td>
86 <td ng-bind="precioCondicion.plazos" 86 <td ng-bind="precioCondicion.plazos"
87 ng-click="select(precioCondicion)"></td> 87 ng-click="select(precioCondicion)"></td>
88 <td> 88 <td>
89 <button 89 <button
90 type="button" 90 type="button"
91 class="btn btn-sm p-1 float-right" 91 class="btn btn-sm p-1 float-right"
92 title="Seleccionar" 92 title="Seleccionar"
93 ng-class="{ 93 ng-class="{
94 'btn-secondary': selectedPrecioCondicion != key + 1, 94 'btn-secondary': selectedPrecioCondicion != key + 1,
95 'btn-primary': selectedPrecioCondicion == key + 1 95 'btn-primary': selectedPrecioCondicion == key + 1
96 }" 96 }"
97 foca-focus="selectedPrecioCondicion == {{key + 1}}" 97 foca-focus="selectedPrecioCondicion == {{key + 1}}"
98 ng-keydown="itemProducto($event.keyCode)" 98 ng-keydown="itemProducto($event.keyCode)"
99 ng-click="select(precioCondicion)" 99 ng-click="select(precioCondicion)"
100 > 100 >
101 <i class="fa fa-circle-thin" aria-hidden="true"></i> 101 <i class="fa fa-circle-thin" aria-hidden="true"></i>
102 </button> 102 </button>
103 <button 103 <button
104 type="button" 104 type="button"
105 class="btn btn-sm p-1 float-right btn-secondary mr-2" 105 class="btn btn-sm p-1 float-right btn-secondary mr-2"
106 title="Ver lista precio" 106 title="Ver lista precio"
107 ng-click="verListaPrecio(precioCondicion.id)" 107 ng-click="verListaPrecio(precioCondicion.idListaPrecio)"
108 > 108 >
109 <i class="fa fa-eye" aria-hidden="true"></i> 109 <i class="fa fa-eye" aria-hidden="true"></i>
110 </button> 110 </button>
111 </td> 111 </td>
112 </tr> 112 </tr>
113 </tbody> 113 </tbody>
114 </table> 114 </table>
115 115
116 <table class="table table-striped table-sm" ng-show="ingreso"> 116 <table class="table table-striped table-sm" ng-show="ingreso">
117 <thead> 117 <thead>
118 <tr> 118 <tr>
119 <th>Item</th> 119 <th>Item</th>
120 <th>Días</th> 120 <th>Días</th>
121 <th></th> 121 <th></th>
122 </tr> 122 </tr>
123 </thead> 123 </thead>
124 <tbody> 124 <tbody>
125 <tr> 125 <tr>
126 <td> 126 <td>
127 <input 127 <input
128 type="number" 128 type="number"
129 class="form-control text-right" 129 class="form-control text-right"
130 ng-model="plazoACargar.item" 130 ng-model="plazoACargar.item"
131 readonly 131 readonly
132 /> 132 />
133 </td> 133 </td>
134 <td> 134 <td>
135 <input 135 <input
136 type="number" 136 type="number"
137 class="form-control text-right" 137 class="form-control text-right"
138 min="0" 138 min="0"
139 ng-model="plazoACargar.dias" 139 ng-model="plazoACargar.dias"
140 ng-keypress="agregarPlazo($event.keyCode)" 140 ng-keypress="agregarPlazo($event.keyCode)"
141 foca-focus="ingreso" 141 foca-focus="ingreso"
142 /> 142 />
143 </td> 143 </td>
144 <td class="text-center"> 144 <td class="text-center">
145 <button 145 <button
146 class="btn btn-outline-secondary" 146 class="btn btn-outline-secondary"
147 title="Agregar" 147 title="Agregar"
148 ng-click="agregarPlazo(13)" 148 ng-click="agregarPlazo(13)"
149 > 149 >
150 <i class="fa fa-save"></i> 150 <i class="fa fa-save"></i>
151 </button> 151 </button>
152 </td> 152 </td>
153 </tr> 153 </tr>
154 <tr ng-repeat="(key, plazo) in plazosNuevos"> 154 <tr ng-repeat="(key, plazo) in plazosNuevos">
155 <td class="text-right" ng-bind="key + 1"></td> 155 <td class="text-right" ng-bind="key + 1"></td>
156 <td class="text-right" ng-bind="plazo.dias"></td> 156 <td class="text-right" ng-bind="plazo.dias"></td>
157 <td class="text-center"> 157 <td class="text-center">
158 <button 158 <button
159 class="btn btn-outline-secondary" 159 class="btn btn-outline-secondary"
160 title="Eliminar" 160 title="Eliminar"
161 ng-click="quitarPlazo(key)" 161 ng-click="quitarPlazo(key)"
162 > 162 >
163 <i class="fa fa-trash"></i> 163 <i class="fa fa-trash"></i>
164 </button> 164 </button>
165 </td> 165 </td>
166 </tr> 166 </tr>
167 </tbody> 167 </tbody>
168 </table> 168 </table>
169 </div> 169 </div>
170 <div class="modal-footer py-1"> 170 <div class="modal-footer py-1">
171 <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso" class="mr-auto"> 171 <nav ng-show="currentPagePrecioCondicion.length > 0 && !ingreso" class="mr-auto">
172 <ul class="pagination pagination-sm mb-0"> 172 <ul class="pagination pagination-sm mb-0">
173 <li class="page-item" ng-class="{'disabled': currentPage == 1}"> 173 <li class="page-item" ng-class="{'disabled': currentPage == 1}">
174 <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)"> 174 <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage - 1)">
175 <span aria-hidden="true">&laquo;</span> 175 <span aria-hidden="true">&laquo;</span>
176 <span class="sr-only">Anterior</span> 176 <span class="sr-only">Anterior</span>
177 </a> 177 </a>
178 </li> 178 </li>
179 <li 179 <li
180 class="page-item" 180 class="page-item"
181 ng-repeat="pagina in paginas" 181 ng-repeat="pagina in paginas"
182 ng-class="{'active': pagina == currentPage}" 182 ng-class="{'active': pagina == currentPage}"
183 > 183 >
184 <a 184 <a
185 class="page-link" 185 class="page-link"
186 href="javascript:void();" 186 href="javascript:void();"
187 ng-click="selectPage(pagina)" 187 ng-click="selectPage(pagina)"
188 ng-bind="pagina" 188 ng-bind="pagina"
189 ></a> 189 ></a>
190 </li> 190 </li>
191 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> 191 <li class="page-item" ng-class="{'disabled': currentPage == lastPage}">
192 <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)"> 192 <a class="page-link" href="javascript:void();" ng-click="selectPage(currentPage + 1)">
193 <span aria-hidden="true">&raquo;</span> 193 <span aria-hidden="true">&raquo;</span>
194 <span class="sr-only">Siguiente</span> 194 <span class="sr-only">Siguiente</span>
195 </a> 195 </a>
196 </li> 196 </li>
197 </ul> 197 </ul>
198 </nav> 198 </nav>
199 <button 199 <button
200 ng-show="!ingreso" 200 ng-show="!ingreso"
201 class="btn btn-sm btn-secondary" 201 class="btn btn-sm btn-secondary"
202 type="button" 202 type="button"
203 ng-click="cancel()" 203 ng-click="cancel()"
204 >Cancelar 204 >Cancelar
205 </button> 205 </button>
206 <button 206 <button
207 ng-show="ingreso" 207 ng-show="ingreso"
208 ng-disabled="plazosNuevos.length === 0" 208 ng-disabled="plazosNuevos.length === 0"
209 class="btn btn-sm btn-primary" 209 class="btn btn-sm btn-primary"
210 type="button" 210 type="button"
211 ng-click="select(plazosNuevos)" 211 ng-click="select(plazosNuevos)"
212 >Aceptar 212 >Aceptar
213 </button> 213 </button>
214 <button 214 <button
215 ng-show="ingreso" 215 ng-show="ingreso"
216 class="btn btn-sm btn-secondary" 216 class="btn btn-sm btn-secondary"
217 type="button" 217 type="button"
218 ng-click="volver()" 218 ng-click="volver()"
219 >Volver 219 >Volver
220 </button> 220 </button>
221 </div> 221 </div>
222 222