Commit 98ac776ac3ae7ab284b0f23094f3b67662a932d5
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing
5 changed files
Show diff stats
package.json
... | ... | @@ -7,11 +7,11 @@ |
7 | 7 | "test": "echo \"Error: no test specified\" && exit 1", |
8 | 8 | "compile": "gulp uglify", |
9 | 9 | "postinstall": "npm run compile && gulp clean-post-install", |
10 | - "install-dev": "npm install -D angular bootstrap angular-ladda ladda@1.0.6 angular-ui-bootstrap ui-bootstrap4 font-awesome jquery pre-commit jshint pump jasmine-core gulp gulp-connect gulp-angular-templatecache gulp-concat gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify-es gulp-clean gulp-uglify git+https://debo.suite.repo/modulos-npm/foca-directivas.git" | |
10 | + "install-dev": "npm install -D angular bootstrap angular-ladda ladda@1.0.6 angular-ui-bootstrap ui-bootstrap4 font-awesome jquery pre-commit jshint pump jasmine-core gulp gulp-connect gulp-angular-templatecache gulp-concat gulp-htmlmin gulp-jshint gulp-rename gulp-replace gulp-uglify-es gulp-clean gulp-uglify git+http://git.focasoftware.com/npm/foca-directivas.git" | |
11 | 11 | }, |
12 | 12 | "repository": { |
13 | 13 | "type": "git", |
14 | - "url": "https://debo.suite.repo/modulos-npm/foca-busqueda-cliente.git" | |
14 | + "url": "http://git.focasoftware.com/npm/foca-busqueda-cliente.git" | |
15 | 15 | }, |
16 | 16 | "author": "Foca Software", |
17 | 17 | "license": "ISC", |
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | "angular-ladda": "^0.4.3", |
35 | 35 | "angular-ui-bootstrap": "^2.5.6", |
36 | 36 | "bootstrap": "^4.1.3", |
37 | - "foca-directivas": "git+https://debo.suite.repo/modulos-npm/foca-directivas.git", | |
37 | + "foca-directivas": "git+http://git.focasoftware.com/npm/foca-directivas.git", | |
38 | 38 | "font-awesome": "^4.7.0", |
39 | 39 | "gulp": "^3.9.1", |
40 | 40 | "gulp-angular-templatecache": "^2.2.1", |
src/js/app.js
src/js/controller.js
1 | 1 | angular.module('focaBusquedaCliente') |
2 | 2 | .controller('focaBusquedaClienteModalController', [ |
3 | 3 | '$uibModalInstance', 'focaBusquedaClienteService', '$scope', '$filter', |
4 | - function($uibModalInstance, focaBusquedaClienteService, $scope, $filter) { | |
4 | + '$uibModal', 'focaModalService', | |
5 | + function($uibModalInstance, focaBusquedaClienteService, $scope, $filter, | |
6 | + $uibModal, focaModalService) { | |
5 | 7 | |
6 | 8 | $scope.filters = ''; |
7 | 9 | $scope.primerBusqueda = false; |
... | ... | @@ -11,6 +13,36 @@ angular.module('focaBusquedaCliente') |
11 | 13 | $scope.filteredClientes = []; |
12 | 14 | $scope.currentPageClientes = []; |
13 | 15 | $scope.selectedClientes = -1; |
16 | + $scope.ingreso = false; | |
17 | + | |
18 | + $scope.cliente = { | |
19 | + COD: 0, | |
20 | + ES_MAY: true, | |
21 | + provincia: { | |
22 | + NOMBRE: '' | |
23 | + }, | |
24 | + localidad: { | |
25 | + NOMBRE: '' | |
26 | + }, | |
27 | + iva: { | |
28 | + NOMBRE: '' | |
29 | + }, | |
30 | + actividad: { | |
31 | + NOM: '' | |
32 | + }, | |
33 | + zona: { | |
34 | + NOM: '' | |
35 | + }, | |
36 | + tipoFactura: { | |
37 | + NOMBRE: '' | |
38 | + }, | |
39 | + tipoComprobante: { | |
40 | + NOMBRE: '' | |
41 | + }, | |
42 | + formaPago: { | |
43 | + NOMBRE: '' | |
44 | + } | |
45 | + }; | |
14 | 46 | |
15 | 47 | $scope.busquedaPress = function(key) { |
16 | 48 | if (key === 13) { |
... | ... | @@ -19,19 +51,26 @@ angular.module('focaBusquedaCliente') |
19 | 51 | function(res) { |
20 | 52 | $scope.primerBusqueda = true; |
21 | 53 | $scope.clientes = res.data; |
22 | - $scope.search(); | |
54 | + $scope.search(true); | |
23 | 55 | primera(); |
24 | 56 | $scope.searchLoading = false; |
25 | 57 | }); |
26 | 58 | } |
27 | 59 | }; |
28 | 60 | |
29 | - $scope.search = function () { | |
61 | + $scope.search = function (pressed) { | |
30 | 62 | if($scope.primerBusqueda) { |
31 | 63 | $scope.filteredClientes = $filter('filter')( |
32 | 64 | $scope.clientes, {$: $scope.filters} |
33 | 65 | ); |
34 | 66 | |
67 | + if(pressed && $scope.filteredClientes.length === 0){ | |
68 | + $timeout(function() { | |
69 | + angular.element('#search')[0].focus(); | |
70 | + $scope.filters = ''; | |
71 | + }); | |
72 | + } | |
73 | + | |
35 | 74 | $scope.lastPage = Math.ceil( |
36 | 75 | $scope.filteredClientes.length / $scope.numPerPage |
37 | 76 | ); |
... | ... | @@ -54,12 +93,17 @@ angular.module('focaBusquedaCliente') |
54 | 93 | $scope.currentPage = page; |
55 | 94 | }; |
56 | 95 | |
57 | - $scope.select = function(cliente) { | |
96 | + $scope.select = function(cliente, esNuevo = false) { | |
97 | + cliente.esNuevo = esNuevo; | |
58 | 98 | $uibModalInstance.close(cliente); |
59 | 99 | }; |
60 | 100 | |
61 | 101 | $scope.cancel = function() { |
62 | - $uibModalInstance.dismiss('cancel'); | |
102 | + if($scope.ingreso) { | |
103 | + $scope.ingreso = false; | |
104 | + }else { | |
105 | + $uibModalInstance.dismiss('cancel'); | |
106 | + } | |
63 | 107 | }; |
64 | 108 | |
65 | 109 | $scope.busquedaDown = function(key) { |
... | ... | @@ -86,6 +130,204 @@ angular.module('focaBusquedaCliente') |
86 | 130 | } |
87 | 131 | }; |
88 | 132 | |
133 | + $scope.seleccionarProvincia = function(key) { | |
134 | + if(key === 13) { | |
135 | + var modalInstance = $uibModal.open( | |
136 | + { | |
137 | + ariaLabelledBy: 'Búsqueda de provincias', | |
138 | + templateUrl: 'modal-provincias.html', | |
139 | + controller: 'focaModalProvinciaController', | |
140 | + size: 'md', | |
141 | + resolve: {filters: function() { | |
142 | + return $scope.cliente.provincia; | |
143 | + }} | |
144 | + } | |
145 | + ); | |
146 | + modalInstance.result.then(function(provincia) { | |
147 | + $scope.cliente.provincia = provincia; | |
148 | + $scope.focused = 3; | |
149 | + }, function() { | |
150 | + //TODO: función llamada cuando cancela el modal | |
151 | + }); | |
152 | + } | |
153 | + }; | |
154 | + $scope.seleccionarLocalidad = function(key) { | |
155 | + if($scope.cliente.provincia.ID === undefined) { | |
156 | + //TODO: Poner modal alert de foca | |
157 | + alert('Seleccione una provincia'); | |
158 | + return; | |
159 | + } | |
160 | + if(key === 13) { | |
161 | + var modalInstance = $uibModal.open( | |
162 | + { | |
163 | + ariaLabelledBy: 'Búsqueda de localidades', | |
164 | + templateUrl: 'modal-localidades.html', | |
165 | + controller: 'focaModalLocalidadController', | |
166 | + size: 'md', | |
167 | + resolve: { | |
168 | + filters: { | |
169 | + idProvincia: $scope.cliente.provincia.ID, | |
170 | + busqueda: $scope.cliente.localidad.nombre | |
171 | + } | |
172 | + } | |
173 | + } | |
174 | + ); | |
175 | + modalInstance.result.then(function(localidad) { | |
176 | + $scope.cliente.localidad = localidad; | |
177 | + $scope.focused = 4; | |
178 | + }, function() { | |
179 | + //TODO: función llamada cuando cancela el modal | |
180 | + }); | |
181 | + } | |
182 | + }; | |
183 | + $scope.seleccionarIva = function(key) { | |
184 | + if(key === 13) { | |
185 | + var modalInstance = $uibModal.open( | |
186 | + { | |
187 | + ariaLabelledBy: 'Búsqueda de responsabilidad ante el IVA', | |
188 | + templateUrl: 'modal-iva.html', | |
189 | + controller: 'focaModalIvaController', | |
190 | + size: 'md', | |
191 | + resolve: {filters: function() { | |
192 | + return $scope.cliente.iva.NOMBRE; | |
193 | + }} | |
194 | + } | |
195 | + ); | |
196 | + modalInstance.result.then(function(iva) { | |
197 | + $scope.cliente.iva = iva; | |
198 | + }, function() { | |
199 | + //TODO: función llamada cuando cancela el modal | |
200 | + }); | |
201 | + } | |
202 | + }; | |
203 | + $scope.seleccionarActividad = function(key) { | |
204 | + if(key === 13) { | |
205 | + var modalInstance = $uibModal.open( | |
206 | + { | |
207 | + ariaLabelledBy: 'Búsqueda de actividades', | |
208 | + templateUrl: 'modal-actividad.html', | |
209 | + controller: 'focaModalActividadController', | |
210 | + size: 'md', | |
211 | + resolve: {filters: function() { | |
212 | + return $scope.cliente.actividad.NOM; | |
213 | + }} | |
214 | + } | |
215 | + ); | |
216 | + modalInstance.result.then(function(actividad) { | |
217 | + $scope.cliente.actividad = actividad; | |
218 | + }, function() { | |
219 | + //TODO: función llamada cuando cancela el modal | |
220 | + }); | |
221 | + } | |
222 | + }; | |
223 | + $scope.seleccionarZona = function(key) { | |
224 | + if(key === 13) { | |
225 | + var modalInstance = $uibModal.open( | |
226 | + { | |
227 | + ariaLabelledBy: 'Búsqueda de zonas', | |
228 | + templateUrl: 'modal-zona.html', | |
229 | + controller: 'focaModalZonaController', | |
230 | + size: 'md', | |
231 | + resolve: {filters: function() { | |
232 | + return $scope.cliente.zona.NOM; | |
233 | + }} | |
234 | + } | |
235 | + ); | |
236 | + modalInstance.result.then(function(zona) { | |
237 | + $scope.cliente.zona = zona; | |
238 | + }, function() { | |
239 | + //TODO: función llamada cuando cancela el modal | |
240 | + }); | |
241 | + } | |
242 | + }; | |
243 | + $scope.seleccionarTipoFactura = function(key) { | |
244 | + if(key === 13) { | |
245 | + var modalInstance = $uibModal.open( | |
246 | + { | |
247 | + ariaLabelledBy: 'Búsqueda de tipos de factura', | |
248 | + templateUrl: 'modal-tipo-factura.html', | |
249 | + controller: 'focaModalTipoFacturaController', | |
250 | + size: 'md', | |
251 | + resolve: {filters: function() { | |
252 | + return $scope.cliente.tipoFactura.NOMBRE; | |
253 | + }} | |
254 | + } | |
255 | + ); | |
256 | + modalInstance.result.then(function(tipoFactura) { | |
257 | + $scope.cliente.tipoFactura = tipoFactura; | |
258 | + }, function() { | |
259 | + //TODO: función llamada cuando cancela el modal | |
260 | + }); | |
261 | + } | |
262 | + }; | |
263 | + $scope.seleccionarTipoComprobante = function(key) { | |
264 | + if(key === 13) { | |
265 | + var modalInstance = $uibModal.open( | |
266 | + { | |
267 | + ariaLabelledBy: 'Búsqueda de tipos de comprobante', | |
268 | + templateUrl: 'modal-tipo-comprobante.html', | |
269 | + controller: 'focaModalTipoComprobanteController', | |
270 | + size: 'md', | |
271 | + resolve: {filters: function() { | |
272 | + return $scope.cliente.tipoComprobante.NOMBRE; | |
273 | + }} | |
274 | + } | |
275 | + ); | |
276 | + modalInstance.result.then(function(tipoComprobante) { | |
277 | + $scope.cliente.tipoComprobante = tipoComprobante; | |
278 | + }, function() { | |
279 | + //TODO: función llamada cuando cancela el modal | |
280 | + }); | |
281 | + } | |
282 | + }; | |
283 | + $scope.seleccionarFormaPago = function(key) { | |
284 | + if(key === 13) { | |
285 | + var modalInstance = $uibModal.open( | |
286 | + { | |
287 | + ariaLabelledBy: 'Búsqueda de formas de pago', | |
288 | + templateUrl: 'modal-forma-pago.html', | |
289 | + controller: 'focaModalFormaPagoController', | |
290 | + size: 'md', | |
291 | + resolve: {filters: function() { | |
292 | + return $scope.cliente.formaPago.NOMBRE; | |
293 | + }} | |
294 | + } | |
295 | + ); | |
296 | + modalInstance.result.then(function(formaPago) { | |
297 | + $scope.cliente.formaPago = formaPago; | |
298 | + }, function() { | |
299 | + //TODO: función llamada cuando cancela el modal | |
300 | + }); | |
301 | + } | |
302 | + }; | |
303 | + | |
304 | + $scope.guardar = function() { | |
305 | + | |
306 | + if(!validarForm()) return; | |
307 | + | |
308 | + $scope.cliente.PCX = $scope.cliente.provincia.ID; | |
309 | + $scope.cliente.LOX = $scope.cliente.localidad.ID; | |
310 | + $scope.cliente.IVA = $scope.cliente.iva.ID; | |
311 | + $scope.cliente.ACT = $scope.cliente.actividad.ID; | |
312 | + $scope.cliente.ZON = $scope.cliente.zona.ID; | |
313 | + $scope.cliente.TIP = $scope.cliente.tipoFactura.ID; | |
314 | + $scope.cliente.TCO = $scope.cliente.tipoComprobante.ID; | |
315 | + $scope.cliente.FPA = $scope.cliente.formaPago.ID; | |
316 | + | |
317 | + delete $scope.cliente.provincia; | |
318 | + delete $scope.cliente.localidad; | |
319 | + delete $scope.cliente.iva; | |
320 | + delete $scope.cliente.actividad; | |
321 | + delete $scope.cliente.zona; | |
322 | + delete $scope.cliente.tipoFactura; | |
323 | + delete $scope.cliente.tipoComprobante; | |
324 | + delete $scope.cliente.formaPago; | |
325 | + | |
326 | + focaBusquedaClienteService.guardarCliente($scope.cliente).then(function(res) { | |
327 | + $scope.select(res.data, true); | |
328 | + }); | |
329 | + }; | |
330 | + | |
89 | 331 | function calcularPages(paginaActual) { |
90 | 332 | var paginas = []; |
91 | 333 | paginas.push(paginaActual); |
... | ... | @@ -149,5 +391,14 @@ angular.module('focaBusquedaCliente') |
149 | 391 | $scope.selectedClientes = 0; |
150 | 392 | } |
151 | 393 | } |
394 | + | |
395 | + function validarForm() { | |
396 | + var regexCuit = new RegExp(/\b(20|23|24|27|30|33|34)(\D)?[0-9]{8}(\D)?[0-9]/g); | |
397 | + if(!regexCuit.test($scope.cliente.CUIT)) { | |
398 | + focaModalService.alert('Número de CUIT inválido') | |
399 | + return false; | |
400 | + } | |
401 | + return true; | |
402 | + } | |
152 | 403 | } |
153 | 404 | ]); |
src/js/service.js
... | ... | @@ -9,6 +9,9 @@ angular.module('focaBusquedaCliente') |
9 | 9 | }, |
10 | 10 | obtenerClientesPorNombreOCuit: function(nombreOCuit) { |
11 | 11 | return $http.post(API_ENDPOINT.URL + '/cliente', {nombreOCuit: nombreOCuit}); |
12 | + }, | |
13 | + guardarCliente: function(cliente) { | |
14 | + return $http.post(API_ENDPOINT.URL + '/cliente', {cliente: cliente}); | |
12 | 15 | } |
13 | 16 | }; |
14 | 17 | }]); |
src/views/foca-busqueda-cliente-modal.html
1 | 1 | <div class="modal-header py-1"> |
2 | - <h5 class="modal-title">Búsqueda de Cliente</h5> | |
2 | + <div class="row w-100"> | |
3 | + <div class="col-lg-6"> | |
4 | + <h5 class="modal-title my-1" ng-hide="ingreso">Búsqueda de Cliente</h5> | |
5 | + <h5 class="modal-title my-1" ng-show="ingreso">Crear Cliente</h5> | |
6 | + </div> | |
7 | + <div ng-show="ingreso" class="col-lg-6"> | |
8 | + <div class="custom-control custom-checkbox"> | |
9 | + <input | |
10 | + type="checkbox" | |
11 | + class="custom-control-input" | |
12 | + id="checkProspecto" | |
13 | + ng-model="cliente.ES_PROS"> | |
14 | + <label class="custom-control-label" for="checkProspecto">¿Es prospecto?</label> | |
15 | + </div> | |
16 | + </div> | |
17 | + <div class="input-group col-lg-6 pr-0 my-2"> | |
18 | + <button | |
19 | + class="btn btn-outline-primary mr-2" | |
20 | + ng-click="ingreso = true" | |
21 | + ng-show="!ingreso"> | |
22 | + <i class="fa fa-plus" aria-hidden="true"></i> | |
23 | + </button> | |
24 | + <input | |
25 | + ladda="searchLoading" | |
26 | + type="text" | |
27 | + class="form-control form-control-sm" | |
28 | + id="search" | |
29 | + placeholder="Busqueda" | |
30 | + ng-model="filters" | |
31 | + ng-change="search()" | |
32 | + ng-keydown="busquedaDown($event.keyCode)" | |
33 | + ng-keypress="busquedaPress($event.keyCode)" | |
34 | + foca-focus="selectedClientes == -1" | |
35 | + ng-focus="selectedClientes = -1" | |
36 | + teclado-virtual | |
37 | + ng-hide="ingreso" | |
38 | + > | |
39 | + <div class="input-group-append" ng-hide="ingreso"> | |
40 | + <button | |
41 | + ladda="searchLoading" | |
42 | + data-spinner-color="#FF0000" | |
43 | + class="btn btn-outline-secondary" | |
44 | + type="button" | |
45 | + ng-click="busquedaPress(13)"> | |
46 | + <i class="fa fa-search" aria-hidden="true"></i> | |
47 | + </button> | |
48 | + </div> | |
49 | + </div> | |
50 | + </div> | |
3 | 51 | </div> |
4 | 52 | <div class="modal-body" id="modal-body"> |
5 | - <div class="input-group"> | |
6 | - <input | |
7 | - ladda="searchLoading" | |
8 | - type="text" | |
9 | - class="form-control" | |
10 | - placeholder="Busqueda" | |
11 | - ng-model="filters" | |
12 | - ng-change="search()" | |
13 | - ng-keydown="busquedaDown($event.keyCode)" | |
14 | - ng-keypress="busquedaPress($event.keyCode)" | |
15 | - foca-focus="selectedClientes == -1" | |
16 | - ng-focus="selectedClientes = -1" | |
17 | - > | |
18 | - <div class="input-group-append"> | |
19 | - <button | |
20 | - ladda="searchLoading" | |
21 | - class="btn btn-outline-secondary" | |
22 | - type="button" | |
23 | - ng-click="busquedaPress(13)"> | |
24 | - <i class="fa fa-search" aria-hidden="true"></i> | |
25 | - </button> | |
53 | + | |
54 | + <div ng-show="!primerBusqueda && !ingreso"> | |
55 | + Debe realizar una primer búsqueda. | |
26 | 56 | </div> |
27 | -</div> | |
28 | - <table ng-show="primerBusqueda" class="table table-striped table-sm"> | |
57 | + | |
58 | + <table ng-show="primerBusqueda && !ingreso" class="table table-striped table-sm"> | |
29 | 59 | <thead> |
30 | 60 | <tr> |
31 | 61 | <th>Código</th> |
... | ... | @@ -44,7 +74,7 @@ |
44 | 74 | class="selectable" |
45 | 75 | ng-repeat="(key, cliente) in currentPageClientes" |
46 | 76 | ng-click="select(cliente)"> |
47 | - <td ng-bind="cliente.cod"></td> | |
77 | + <td ng-bind="('00000'+cliente.cod).slice(-5)"></td> | |
48 | 78 | <td ng-bind="cliente.nom"></td> |
49 | 79 | <td ng-bind="cliente.cuit"></td> |
50 | 80 | <td> |
... | ... | @@ -59,16 +89,296 @@ |
59 | 89 | foca-focus="selectedClientes == {{key}}" |
60 | 90 | ng-keydown="itemCliente($event.keyCode)" |
61 | 91 | > |
62 | - <i class="fa fa-arrow-right" aria-hidden="true"></i> | |
92 | + <i class="fa fa-circle-thin" aria-hidden="true"></i> | |
63 | 93 | </button> |
64 | 94 | </td> |
65 | 95 | </tr> |
66 | 96 | </tbody> |
67 | 97 | </table> |
68 | - <nav ng-show="currentPageClientes.length > 0 && primerBusqueda"> | |
98 | + | |
99 | + <form name="formCliente"> | |
100 | + <uib-tabset class="tabs-right" ng-show="ingreso"> | |
101 | + <uib-tab heading="Datos clientes"> | |
102 | + <div class="row"> | |
103 | + <div class="col-3"> | |
104 | + <label>Código</label> | |
105 | + <input | |
106 | + type="text" | |
107 | + class="form-control form-control-sm" | |
108 | + ng-model="cliente.codigo" | |
109 | + ng-required="true" | |
110 | + readonly | |
111 | + /> | |
112 | + </div> | |
113 | + <div class="col-9"> | |
114 | + <label>Nombre</label> | |
115 | + <input | |
116 | + type="text" | |
117 | + foca-focus="ingreso" | |
118 | + class="form-control form-control-sm" | |
119 | + ng-model="cliente.NOM" | |
120 | + placeholder="Ingrese nombre" | |
121 | + ng-required="true" | |
122 | + teclado-virtual | |
123 | + /> | |
124 | + </div> | |
125 | + </div> | |
126 | + <div class="row"> | |
127 | + <div class="col-9"> | |
128 | + <label>Domicilio</label> | |
129 | + <input | |
130 | + type="text" | |
131 | + class="form-control form-control-sm" | |
132 | + ng-model="cliente.DOM" | |
133 | + placeholder="Ingrese domicilio" | |
134 | + ng-required="true" | |
135 | + teclado-virtual | |
136 | + /> | |
137 | + </div> | |
138 | + <div class="col-3"> | |
139 | + <label>Código postal</label> | |
140 | + <input | |
141 | + type="text" | |
142 | + class="form-control form-control-sm" | |
143 | + ng-model="cliente.CPO" | |
144 | + placeholder="Ingrese CP" | |
145 | + ng-required="true" | |
146 | + teclado-virtual | |
147 | + /> | |
148 | + </div> | |
149 | + </div> | |
150 | + <div class="row"> | |
151 | + <div class="col-6"> | |
152 | + <label>Provincia</label> | |
153 | + <div class="input-group"> | |
154 | + <input | |
155 | + type="text" | |
156 | + class="form-control form-control-sm" | |
157 | + ng-model="cliente.provincia.NOMBRE" | |
158 | + ng-keypress="seleccionarProvincia($event.keyCode)" | |
159 | + placeholder="Ingrese provincia" | |
160 | + ng-required="true" | |
161 | + teclado-virtual | |
162 | + /> | |
163 | + <div class="input-group-append"> | |
164 | + <button | |
165 | + ladda="searchLoading" | |
166 | + class="btn btn-outline-secondary form-control-sm" | |
167 | + type="button" | |
168 | + ng-click="seleccionarProvincia(13)" | |
169 | + > | |
170 | + <i class="fa fa-search" aria-hidden="true"></i> | |
171 | + </button> | |
172 | + </div> | |
173 | + </div> | |
174 | + </div> | |
175 | + <div class="col-6"> | |
176 | + <label>Localidad</label> | |
177 | + <div class="input-group"> | |
178 | + <input | |
179 | + type="text" | |
180 | + class="form-control form-control-sm" | |
181 | + ng-model="cliente.localidad.NOMBRE" | |
182 | + ng-keypress="seleccionarLocalidad($event.keyCode)" | |
183 | + placeholder="Ingrese localidad" | |
184 | + ng-required="true" | |
185 | + teclado-virtual | |
186 | + /> | |
187 | + <div class="input-group-append"> | |
188 | + <button | |
189 | + ladda="searchLoading" | |
190 | + class="btn btn-outline-secondary form-control-sm" | |
191 | + type="button" | |
192 | + ng-click="seleccionarLocalidad(13)" | |
193 | + > | |
194 | + <i class="fa fa-search" aria-hidden="true"></i> | |
195 | + </button> | |
196 | + </div> | |
197 | + </div> | |
198 | + </div> | |
199 | + </div> | |
200 | + <div class="row"> | |
201 | + <div class="col-6"> | |
202 | + <label>Zona</label> | |
203 | + <div class="input-group"> | |
204 | + <input | |
205 | + type="text" | |
206 | + class="form-control form-control-sm" | |
207 | + ng-model="cliente.zona.NOM" | |
208 | + ng-keypress="seleccionarZona($event.keyCode)" | |
209 | + placeholder="Ingrese zona" | |
210 | + ng-required="true" | |
211 | + teclado-virtual | |
212 | + /> | |
213 | + <div class="input-group-append"> | |
214 | + <button | |
215 | + ladda="searchLoading" | |
216 | + class="btn btn-outline-secondary form-control-sm" | |
217 | + type="button" | |
218 | + ng-click="seleccionarZona(13)" | |
219 | + > | |
220 | + <i class="fa fa-search" aria-hidden="true"></i> | |
221 | + </button> | |
222 | + </div> | |
223 | + </div> | |
224 | + </div> | |
225 | + <div class="col-6"> | |
226 | + <label>Actividad</label> | |
227 | + <div class="input-group"> | |
228 | + <input | |
229 | + type="text" | |
230 | + class="form-control form-control-sm" | |
231 | + ng-model="cliente.actividad.NOM" | |
232 | + ng-keypress="seleccionarActividad($event.keyCode)" | |
233 | + placeholder="Ingrese actividad" | |
234 | + ng-required="true" | |
235 | + teclado-virtual | |
236 | + /> | |
237 | + <div class="input-group-append"> | |
238 | + <button | |
239 | + ladda="searchLoading" | |
240 | + class="btn btn-outline-secondary form-control-sm" | |
241 | + type="button" | |
242 | + ng-click="seleccionarActividad(13)" | |
243 | + > | |
244 | + <i class="fa fa-search" aria-hidden="true"></i> | |
245 | + </button> | |
246 | + </div> | |
247 | + </div> | |
248 | + </div> | |
249 | + </div> | |
250 | + <div class="row"> | |
251 | + <div class="col-6"> | |
252 | + <div class="custom-control custom-checkbox"> | |
253 | + <input | |
254 | + type="checkbox" | |
255 | + class="custom-control-input" | |
256 | + id="checkDistribuidor" | |
257 | + ng-model="cliente.ES_MAY" | |
258 | + checked> | |
259 | + <label class="custom-control-label" for="checkDistribuidor">¿Este cliente es distribuidor?</label> | |
260 | + </div> | |
261 | + </div> | |
262 | + </div> | |
263 | + </uib-tab> | |
264 | + <uib-tab heading="Datos impositivos"> | |
265 | + <div class="row"> | |
266 | + <div class="col-7"> | |
267 | + <label>Responsabilidad ante el IVA</label> | |
268 | + <div class="input-group"> | |
269 | + <input | |
270 | + type="text" | |
271 | + class="form-control form-control-sm" | |
272 | + ng-model="cliente.iva.NOMBRE" | |
273 | + ng-keypress="seleccionarIva($event.keyCode)" | |
274 | + ng-required="true" | |
275 | + teclado-virtual | |
276 | + /> | |
277 | + <div class="input-group-append"> | |
278 | + <button | |
279 | + ladda="searchLoading" | |
280 | + class="btn btn-outline-secondary form-control-sm" | |
281 | + type="button" | |
282 | + ng-click="seleccionarIva(13)" | |
283 | + > | |
284 | + <i class="fa fa-search" aria-hidden="true"></i> | |
285 | + </button> | |
286 | + </div> | |
287 | + </div> | |
288 | + </div> | |
289 | + <div class="col-5"> | |
290 | + <label>Factura que emite</label> | |
291 | + <div class="input-group"> | |
292 | + <input | |
293 | + type="text" | |
294 | + class="form-control form-control-sm" | |
295 | + placeholder="Ingrese factura que emite" | |
296 | + ng-model="cliente.tipoFactura.NOMBRE" | |
297 | + ng-required="true" | |
298 | + ng-keypress="seleccionarTipoFactura(13)" | |
299 | + teclado-virtual> | |
300 | + <div class="input-group-append"> | |
301 | + <button | |
302 | + ladda="searchLoading" | |
303 | + class="btn btn-outline-secondary form-control-sm" | |
304 | + type="button" | |
305 | + ng-click="seleccionarTipoFactura(13)" | |
306 | + > | |
307 | + <i class="fa fa-search" aria-hidden="true"></i> | |
308 | + </button> | |
309 | + </div> | |
310 | + </div> | |
311 | + </div> | |
312 | + </div> | |
313 | + <div class="row"> | |
314 | + <div class="col-4"> | |
315 | + <label>CUIT</label> | |
316 | + <div class="input-group"> | |
317 | + <input | |
318 | + type="text" | |
319 | + class="form-control form-control-sm" | |
320 | + placeholder="Ingrese CUIT" | |
321 | + ng-model="cliente.CUIT" | |
322 | + ng-required="true" | |
323 | + teclado-virtual> | |
324 | + </div> | |
325 | + </div> | |
326 | + <div class="col-4"> | |
327 | + <label>Clase de comprobante</label> | |
328 | + <div class="input-group"> | |
329 | + <input | |
330 | + type="text" | |
331 | + class="form-control form-control-sm" | |
332 | + placeholder="Ingrese clase de comprobante" | |
333 | + ng-keypress="seleccionarTipoComprobante($event.keyCode)" | |
334 | + ng-model="cliente.tipoComprobante.NOMBRE" | |
335 | + ng-required="true" | |
336 | + teclado-virtual> | |
337 | + <div class="input-group-append"> | |
338 | + <button | |
339 | + ladda="searchLoading" | |
340 | + class="btn btn-outline-secondary form-control-sm" | |
341 | + type="button" | |
342 | + ng-click="seleccionarTipoComprobante(13)" | |
343 | + > | |
344 | + <i class="fa fa-search" aria-hidden="true"></i> | |
345 | + </button> | |
346 | + </div> | |
347 | + </div> | |
348 | + </div> | |
349 | + <div class="col-4"> | |
350 | + <label>Forma de pago</label> | |
351 | + <div class="input-group"> | |
352 | + <input | |
353 | + type="text" | |
354 | + class="form-control form-control-sm" | |
355 | + placeholder="Ingrese forma de pago" | |
356 | + ng-model="cliente.formaPago.NOMBRE" | |
357 | + ng-required="true" | |
358 | + ng-keypress="seleccionarFormaPago($event.keyCode)" | |
359 | + teclado-virtual> | |
360 | + <div class="input-group-append"> | |
361 | + <button | |
362 | + ladda="searchLoading" | |
363 | + class="btn btn-outline-secondary form-control-sm" | |
364 | + type="button" | |
365 | + ng-click="seleccionarFormaPago(13)" | |
366 | + > | |
367 | + <i class="fa fa-search" aria-hidden="true"></i> | |
368 | + </button> | |
369 | + </div> | |
370 | + </div> | |
371 | + </div> | |
372 | + </div> | |
373 | + </uib-tab> | |
374 | + </uib-tabset> | |
375 | + </form> | |
376 | +</div> | |
377 | +<div class="modal-footer py-1"> | |
378 | + <nav ng-show="currentPageClientes.length > 0 && primerBusqueda && !ingreso" class="mr-auto"> | |
69 | 379 | <ul class="pagination pagination-sm mb-0"> |
70 | 380 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
71 | - <a class="page-link" href="#" ng-click="selectPage(currentPage - 1)"> | |
381 | + <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage - 1)"> | |
72 | 382 | <span aria-hidden="true">«</span> |
73 | 383 | <span class="sr-only">Anterior</span> |
74 | 384 | </a> |
... | ... | @@ -80,20 +390,19 @@ |
80 | 390 | > |
81 | 391 | <a |
82 | 392 | class="page-link" |
83 | - href="#" | |
393 | + href="javascript:void()" | |
84 | 394 | ng-click="selectPage(pagina)" |
85 | 395 | ng-bind="pagina" |
86 | 396 | ></a> |
87 | 397 | </li> |
88 | 398 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
89 | - <a class="page-link" href="#" ng-click="selectPage(currentPage + 1)"> | |
399 | + <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage + 1)"> | |
90 | 400 | <span aria-hidden="true">»</span> |
91 | 401 | <span class="sr-only">Siguiente</span> |
92 | 402 | </a> |
93 | 403 | </li> |
94 | 404 | </ul> |
95 | 405 | </nav> |
96 | -</div> | |
97 | -<div class="modal-footer py-1"> | |
98 | 406 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
407 | + <button class="btn btn-sm btn-primary" type="button" ng-show="ingreso" ng-click="guardar()">Guardar</button> | |
99 | 408 | </div> |