Commit 60a686d0d36a6a547ca0f396d5eb496ae33bee6f
Exists in
master
and in
1 other branch
Merge branch 'develop' into 'master'
Develop See merge request !34
Showing
2 changed files
Show diff stats
src/js/controller.js
1 | angular.module('focaBusquedaCliente') | 1 | angular.module('focaBusquedaCliente') |
2 | .controller('focaBusquedaClienteModalController', [ | 2 | .controller('focaBusquedaClienteModalController', [ |
3 | '$uibModalInstance', 'focaBusquedaClienteService', '$scope', '$filter', | 3 | '$uibModalInstance', 'focaBusquedaClienteService', '$scope', '$filter', |
4 | '$uibModal', 'focaModalService', '$timeout', 'vendedor', 'cobrador', | 4 | '$uibModal', 'focaModalService', '$timeout', 'vendedor', 'cobrador', |
5 | function($uibModalInstance, focaBusquedaClienteService, $scope, $filter, | 5 | function($uibModalInstance, focaBusquedaClienteService, $scope, $filter, |
6 | $uibModal, focaModalService, $timeout, vendedor, cobrador) { | 6 | $uibModal, focaModalService, $timeout, vendedor, cobrador) { |
7 | 7 | ||
8 | $scope.cobrador = cobrador ? cobrador : {}; | 8 | $scope.cobrador = cobrador ? cobrador : {}; |
9 | $scope.vendedor = vendedor ? vendedor : {}; | 9 | $scope.vendedor = vendedor ? vendedor : {}; |
10 | $scope.filters = ''; | 10 | $scope.filters = ''; |
11 | $scope.primerBusqueda = false; | 11 | $scope.primerBusqueda = false; |
12 | // pagination | 12 | // pagination |
13 | $scope.numPerPage = 10; | 13 | $scope.numPerPage = 10; |
14 | $scope.currentPage = 1; | 14 | $scope.currentPage = 1; |
15 | $scope.filteredClientes = []; | 15 | $scope.filteredClientes = []; |
16 | $scope.currentPageClientes = []; | 16 | $scope.currentPageClientes = []; |
17 | $scope.selectedClientes = -1; | 17 | $scope.selectedClientes = -1; |
18 | $scope.ingreso = false; | 18 | $scope.ingreso = false; |
19 | $scope.regexCuit = new RegExp(/\b(20|23|24|27|30|33|34)(\D)?[0-9]{8}(\D)?[0-9]/); | 19 | $scope.regexCuit = new RegExp(/\b(20|23|24|27|30|33|34)(\D)?[0-9]{8}(\D)?[0-9]/); |
20 | $scope.focused = 1; | 20 | $scope.focused = 1; |
21 | 21 | ||
22 | $scope.cliente = { | 22 | $scope.cliente = { |
23 | COD: 0, | 23 | COD: 0, |
24 | ES_MAY: true, | 24 | ES_MAY: true, |
25 | cuit1: '', | 25 | cuit1: '', |
26 | cuit2: '', | 26 | cuit2: '', |
27 | cuit3: '', | 27 | cuit3: '', |
28 | provincia: { | 28 | provincia: { |
29 | NOMBRE: '' | 29 | NOMBRE: '' |
30 | }, | 30 | }, |
31 | localidad: { | 31 | localidad: { |
32 | NOMBRE: '' | 32 | NOMBRE: '' |
33 | }, | 33 | }, |
34 | iva: { | 34 | iva: { |
35 | NOMBRE: '' | 35 | NOMBRE: '' |
36 | }, | 36 | }, |
37 | actividad: { | 37 | actividad: { |
38 | NOM: '' | 38 | NOM: '' |
39 | }, | 39 | }, |
40 | zona: { | 40 | zona: { |
41 | NOM: '' | 41 | NOM: '' |
42 | }, | 42 | }, |
43 | tipoFactura: { | 43 | tipoFactura: { |
44 | NOMBRE: '' | 44 | NOMBRE: '' |
45 | }, | 45 | }, |
46 | tipoComprobante: { | 46 | tipoComprobante: { |
47 | NOMBRE: '' | 47 | NOMBRE: '' |
48 | }, | 48 | }, |
49 | formaPago: { | 49 | formaPago: { |
50 | NOMBRE: '' | 50 | NOMBRE: '' |
51 | }, | 51 | }, |
52 | cobrador: { | 52 | cobrador: { |
53 | NomVen: '' | 53 | NomVen: '' |
54 | } | 54 | } |
55 | }; | 55 | }; |
56 | 56 | ||
57 | $scope.busquedaPress = function(key) { | 57 | $scope.busquedaPress = function(key) { |
58 | if (key === 13) { | 58 | if (key === 13) { |
59 | var funcion; | 59 | var funcion; |
60 | if ($scope.vendedor.id) { | 60 | if ($scope.vendedor.id) { |
61 | funcion = 'obtenerClientesPorNombreOCuitByVendedor'; | 61 | funcion = 'obtenerClientesPorNombreOCuitByVendedor'; |
62 | } else if ($scope.cobrador.id) { | 62 | } else if ($scope.cobrador.id) { |
63 | funcion = 'obtenerClientesPorNombreOCuitByCobrador'; | 63 | funcion = 'obtenerClientesPorNombreOCuitByCobrador'; |
64 | } else { | 64 | } else { |
65 | funcion = 'obtenerClientesPorNombreOCuit'; | 65 | funcion = 'obtenerClientesPorNombreOCuit'; |
66 | } | 66 | } |
67 | 67 | ||
68 | |||
69 | $scope.searchLoading = true; | 68 | $scope.searchLoading = true; |
70 | focaBusquedaClienteService | 69 | focaBusquedaClienteService |
71 | [funcion]($scope.filters, $scope.vendedor.id || $scope.cobrador.id) | 70 | [funcion]($scope.filters, $scope.vendedor.id || $scope.cobrador.id) |
72 | .then( | 71 | .then( |
73 | function(res) { | 72 | function(res) { |
74 | $scope.primerBusqueda = true; | 73 | $scope.primerBusqueda = true; |
75 | $scope.clientes = res.data; | 74 | $scope.clientes = res.data; |
76 | $scope.search(true); | 75 | $scope.search(true); |
77 | primera(); | 76 | primera(); |
78 | $scope.searchLoading = false; | 77 | $scope.searchLoading = false; |
79 | }); | 78 | }); |
80 | } | 79 | } |
81 | }; | 80 | }; |
82 | 81 | ||
83 | $scope.search = function (pressed) { | 82 | $scope.search = function (pressed) { |
84 | if ($scope.primerBusqueda) { | 83 | if ($scope.primerBusqueda) { |
85 | $scope.filteredClientes = $filter('filter')( | 84 | $scope.filteredClientes = $filter('filter')( |
86 | $scope.clientes, {$: $scope.filters} | 85 | $scope.clientes, {$: $scope.filters} |
87 | ); | 86 | ); |
88 | 87 | ||
89 | if (pressed && $scope.filteredClientes.length === 0) { | 88 | if (pressed && $scope.filteredClientes.length === 0) { |
90 | $timeout(function() { | 89 | $timeout(function() { |
91 | angular.element('#search')[0].focus(); | 90 | angular.element('#search')[0].focus(); |
92 | $scope.filters = ''; | 91 | $scope.filters = ''; |
93 | }); | 92 | }); |
94 | } | 93 | } |
95 | 94 | ||
96 | $scope.lastPage = Math.ceil( | 95 | $scope.lastPage = Math.ceil( |
97 | $scope.filteredClientes.length / $scope.numPerPage | 96 | $scope.filteredClientes.length / $scope.numPerPage |
98 | ); | 97 | ); |
99 | 98 | ||
100 | $scope.resetPage(); | 99 | $scope.resetPage(); |
101 | } | 100 | } |
102 | }; | 101 | }; |
103 | 102 | ||
104 | $scope.resetPage = function () { | 103 | $scope.resetPage = function () { |
105 | $scope.currentPage = 1; | 104 | $scope.currentPage = 1; |
106 | $scope.selectPage(1); | 105 | $scope.selectPage(1); |
107 | }; | 106 | }; |
108 | 107 | ||
109 | $scope.selectPage = function (page) { | 108 | $scope.selectPage = function (page) { |
110 | var start = (page - 1) * $scope.numPerPage; | 109 | var start = (page - 1) * $scope.numPerPage; |
111 | var end = start + $scope.numPerPage; | 110 | var end = start + $scope.numPerPage; |
112 | $scope.paginas = []; | 111 | $scope.paginas = []; |
113 | $scope.paginas = calcularPages(page); | 112 | $scope.paginas = calcularPages(page); |
114 | $scope.currentPageClientes = $scope.filteredClientes.slice(start, end); | 113 | $scope.currentPageClientes = $scope.filteredClientes.slice(start, end); |
115 | $scope.currentPage = page; | 114 | $scope.currentPage = page; |
116 | }; | 115 | }; |
117 | 116 | ||
118 | $scope.select = function(cliente, esNuevo = false) { | 117 | $scope.select = function(cliente, esNuevo = false) { |
119 | cliente.esNuevo = esNuevo; | 118 | cliente.esNuevo = esNuevo; |
120 | $uibModalInstance.close(cliente); | 119 | $uibModalInstance.close(cliente); |
121 | }; | 120 | }; |
122 | 121 | ||
123 | $scope.cancel = function() { | 122 | $scope.cancel = function() { |
124 | if ($scope.ingreso) { | 123 | if ($scope.ingreso) { |
125 | $scope.ingreso = false; | 124 | $scope.ingreso = false; |
126 | } else { | 125 | } else { |
127 | $uibModalInstance.dismiss('cancel'); | 126 | $uibModalInstance.dismiss('cancel'); |
128 | } | 127 | } |
129 | }; | 128 | }; |
130 | 129 | ||
131 | $scope.busquedaDown = function(key) { | 130 | $scope.busquedaDown = function(key) { |
132 | if (key === 40) { | 131 | if (key === 40) { |
133 | primera(key); | 132 | primera(key); |
134 | } | 133 | } |
135 | }; | 134 | }; |
136 | 135 | ||
137 | $scope.itemCliente = function(key) { | 136 | $scope.itemCliente = function(key) { |
138 | if (key === 38) { | 137 | if (key === 38) { |
139 | anterior(key); | 138 | anterior(key); |
140 | } | 139 | } |
141 | 140 | ||
142 | if (key === 40) { | 141 | if (key === 40) { |
143 | siguiente(key); | 142 | siguiente(key); |
144 | } | 143 | } |
145 | 144 | ||
146 | if (key === 37) { | 145 | if (key === 37) { |
147 | retrocederPagina(); | 146 | retrocederPagina(); |
148 | } | 147 | } |
149 | 148 | ||
150 | if (key === 39) { | 149 | if (key === 39) { |
151 | avanzarPagina(); | 150 | avanzarPagina(); |
152 | } | 151 | } |
153 | }; | 152 | }; |
154 | 153 | ||
155 | $scope.focus = function(val) { | 154 | $scope.focus = function(val) { |
156 | $scope.focused = val; | 155 | $scope.focused = val; |
157 | }; | 156 | }; |
158 | 157 | ||
159 | $scope.next = function(key) { | 158 | $scope.next = function(key) { |
160 | if (key === 13) $scope.focused++; | 159 | if (key === 13) $scope.focused++; |
161 | }; | 160 | }; |
162 | 161 | ||
163 | $scope.seleccionarProvincia = function(key) { | 162 | $scope.seleccionarProvincia = function(key) { |
164 | if (key === 13) { | 163 | if (key === 13) { |
165 | var parametrosModal = { | 164 | var parametrosModal = { |
166 | searchText: $scope.cliente.provincia.NOMBRE, | 165 | searchText: $scope.cliente.provincia.NOMBRE, |
167 | query: '/provincia', | 166 | query: '/provincia', |
168 | columnas: [ | 167 | columnas: [ |
169 | { | 168 | { |
170 | propiedad: 'ID', | 169 | propiedad: 'ID', |
171 | nombre: 'Codigo', | 170 | nombre: 'Codigo', |
172 | filtro: { | 171 | filtro: { |
173 | nombre: 'rellenarDigitos', | 172 | nombre: 'rellenarDigitos', |
174 | parametro: 3 | 173 | parametro: 3 |
175 | } | 174 | } |
176 | }, | 175 | }, |
177 | { | 176 | { |
178 | propiedad: 'NOMBRE', | 177 | propiedad: 'NOMBRE', |
179 | nombre: 'Nombre' | 178 | nombre: 'Nombre' |
180 | } | 179 | } |
181 | ], | 180 | ], |
182 | titulo:'Búsqueda de provincias', | 181 | titulo:'Búsqueda de provincias', |
183 | size: 'md' | 182 | size: 'md' |
184 | }; | 183 | }; |
185 | focaModalService.modal(parametrosModal).then(function(provincia) { | 184 | focaModalService.modal(parametrosModal).then(function(provincia) { |
186 | $scope.cliente.provincia = provincia; | 185 | $scope.cliente.provincia = provincia; |
187 | $timeout(function() { | 186 | $timeout(function() { |
188 | $scope.focused = 4; | 187 | $scope.focused = 4; |
189 | }); | 188 | }); |
190 | }, function() { | 189 | }, function() { |
191 | //TODO: función llamada cuando cancela el modal | 190 | //TODO: función llamada cuando cancela el modal |
192 | }); | 191 | }); |
193 | } | 192 | } |
194 | }; | 193 | }; |
195 | $scope.seleccionarLocalidad = function(key) { | 194 | $scope.seleccionarLocalidad = function(key) { |
196 | if ($scope.cliente.provincia.ID === undefined) { | 195 | if ($scope.cliente.provincia.ID === undefined) { |
197 | focaModalService.alert('Seleccione una provincia'); | 196 | focaModalService.alert('Seleccione una provincia'); |
198 | return; | 197 | return; |
199 | } | 198 | } |
200 | if (key === 13) { | 199 | if (key === 13) { |
201 | var parametrosModal = { | 200 | var parametrosModal = { |
202 | searchText: $scope.cliente.localidad.NOMBRE, | 201 | searchText: $scope.cliente.localidad.NOMBRE, |
203 | query: '/localidad/' + $scope.cliente.provincia.ID, | 202 | query: '/localidad/' + $scope.cliente.provincia.ID, |
204 | columnas: [ | 203 | columnas: [ |
205 | { | 204 | { |
206 | propiedad: 'ID', | 205 | propiedad: 'ID', |
207 | nombre: 'Código', | 206 | nombre: 'Código', |
208 | filtro: { | 207 | filtro: { |
209 | nombre: 'rellenarDigitos', | 208 | nombre: 'rellenarDigitos', |
210 | parametro: 3 | 209 | parametro: 3 |
211 | } | 210 | } |
212 | }, | 211 | }, |
213 | { | 212 | { |
214 | propiedad: 'NOMBRE', | 213 | propiedad: 'NOMBRE', |
215 | nombre: 'Nombre' | 214 | nombre: 'Nombre' |
216 | } | 215 | } |
217 | ], | 216 | ], |
218 | titulo:'Búsqueda de localidades', | 217 | titulo:'Búsqueda de localidades', |
219 | size: 'md' | 218 | size: 'md' |
220 | }; | 219 | }; |
221 | focaModalService.modal(parametrosModal).then(function(localidad) { | 220 | focaModalService.modal(parametrosModal).then(function(localidad) { |
222 | $scope.cliente.localidad = localidad; | 221 | $scope.cliente.localidad = localidad; |
223 | $timeout(function() { | 222 | $timeout(function() { |
224 | $scope.focused = 5; | 223 | $scope.focused = 5; |
225 | }); | 224 | }); |
226 | }, function() { | 225 | }, function() { |
227 | //TODO: función llamada cuando cancela el modal | 226 | //TODO: función llamada cuando cancela el modal |
228 | }); | 227 | }); |
229 | } | 228 | } |
230 | }; | 229 | }; |
231 | $scope.seleccionarIva = function(key) { | 230 | $scope.seleccionarIva = function(key) { |
232 | if (key === 13) { | 231 | if (key === 13) { |
233 | var parametrosModal = { | 232 | var parametrosModal = { |
234 | query: '/iva', | 233 | query: '/iva', |
235 | searchText: $scope.cliente.iva.NOMBRE, | 234 | searchText: $scope.cliente.iva.NOMBRE, |
236 | columnas: [ | 235 | columnas: [ |
237 | { | 236 | { |
238 | propiedad: 'ID', | 237 | propiedad: 'ID', |
239 | nombre: 'Código', | 238 | nombre: 'Código', |
240 | filtro: { | 239 | filtro: { |
241 | nombre: 'rellenarDigitos', | 240 | nombre: 'rellenarDigitos', |
242 | parametro: 3 | 241 | parametro: 3 |
243 | } | 242 | } |
244 | }, | 243 | }, |
245 | { | 244 | { |
246 | propiedad: 'NOMBRE', | 245 | propiedad: 'NOMBRE', |
247 | nombre: 'Nombre' | 246 | nombre: 'Nombre' |
248 | } | 247 | } |
249 | ], | 248 | ], |
250 | titulo:'Búsqueda de responsabilidad ante el IVA', | 249 | titulo:'Búsqueda de responsabilidad ante el IVA', |
251 | size: 'md' | 250 | size: 'md' |
252 | }; | 251 | }; |
253 | focaModalService.modal(parametrosModal).then( | 252 | focaModalService.modal(parametrosModal).then( |
254 | function(iva) { | 253 | function(iva) { |
254 | if (iva) { | ||
255 | delete $scope.cliente.tipoFactura.NOMBRE; | ||
256 | } | ||
255 | $scope.cliente.iva = iva; | 257 | $scope.cliente.iva = iva; |
256 | $timeout(function() { | 258 | $timeout(function() { |
257 | $scope.focused = 12; | 259 | $scope.focused = 12; |
258 | }); | 260 | }); |
259 | }, function() { | 261 | }, function() { |
260 | // funcion ejecutada cuando se cancela el modal | 262 | // funcion ejecutada cuando se cancela el modal |
261 | }); | 263 | }); |
262 | } | 264 | } |
263 | }; | 265 | }; |
264 | $scope.seleccionarActividad = function(key) { | 266 | $scope.seleccionarActividad = function(key) { |
265 | if (key === 13) { | 267 | if (key === 13) { |
266 | var parametrosModal = { | 268 | var parametrosModal = { |
267 | searchText: $scope.cliente.actividad.NOM, | 269 | searchText: $scope.cliente.actividad.NOM, |
268 | query: '/actividad', | 270 | query: '/actividad', |
269 | columnas: [ | 271 | columnas: [ |
270 | { | 272 | { |
271 | propiedad: 'ID', | 273 | propiedad: 'ID', |
272 | nombre: 'Código', | 274 | nombre: 'Código', |
273 | filtro: { | 275 | filtro: { |
274 | nombre: 'rellenarDigitos', | 276 | nombre: 'rellenarDigitos', |
275 | parametro: 3 | 277 | parametro: 3 |
276 | } | 278 | } |
277 | }, | 279 | }, |
278 | { | 280 | { |
279 | propiedad: 'NOM', | 281 | propiedad: 'NOM', |
280 | nombre: 'Nombre' | 282 | nombre: 'Nombre' |
281 | } | 283 | } |
282 | ], | 284 | ], |
283 | titulo: 'Búsqueda de actividades', | 285 | titulo: 'Búsqueda de actividades', |
284 | size: 'md' | 286 | size: 'md' |
285 | }; | 287 | }; |
286 | focaModalService.modal(parametrosModal).then( | 288 | focaModalService.modal(parametrosModal).then( |
287 | function(actividad) { | 289 | function(actividad) { |
288 | $scope.cliente.actividad = actividad; | 290 | $scope.cliente.actividad = actividad; |
289 | $timeout(function() { | 291 | $timeout(function() { |
290 | $scope.focused = 7; | 292 | $scope.focused = 7; |
291 | }); | 293 | }); |
292 | }, function() { | 294 | }, function() { |
293 | // funcion ejecutada cuando se cancela el modal | 295 | // funcion ejecutada cuando se cancela el modal |
294 | }); | 296 | }); |
295 | } | 297 | } |
296 | }; | 298 | }; |
297 | $scope.seleccionarZona = function(key) { | 299 | $scope.seleccionarZona = function(key) { |
298 | if (key === 13) { | 300 | if (key === 13) { |
299 | var parametrosModal = { | 301 | var parametrosModal = { |
300 | searchText: $scope.cliente.zona.NOM, | 302 | searchText: $scope.cliente.zona.NOM, |
301 | query: '/zona', | 303 | query: '/zona', |
302 | columnas: [ | 304 | columnas: [ |
303 | { | 305 | { |
304 | propiedad: 'ID', | 306 | propiedad: 'ID', |
305 | nombre: 'Código', | 307 | nombre: 'Código', |
306 | filtro: { | 308 | filtro: { |
307 | nombre: 'rellenarDigitos', | 309 | nombre: 'rellenarDigitos', |
308 | parametro: 3 | 310 | parametro: 3 |
309 | } | 311 | } |
310 | }, | 312 | }, |
311 | { | 313 | { |
312 | propiedad: 'NOM', | 314 | propiedad: 'NOM', |
313 | nombre: 'Nombre' | 315 | nombre: 'Nombre' |
314 | } | 316 | } |
315 | ], | 317 | ], |
316 | titulo: 'Búsqueda de zonas', | 318 | titulo: 'Búsqueda de zonas', |
317 | size: 'md' | 319 | size: 'md' |
318 | }; | 320 | }; |
319 | focaModalService.modal(parametrosModal).then( | 321 | focaModalService.modal(parametrosModal).then( |
320 | function(zona) { | 322 | function(zona) { |
321 | $scope.cliente.zona = zona; | 323 | $scope.cliente.zona = zona; |
322 | $timeout(function() { | 324 | $timeout(function() { |
323 | $scope.focused = 6; | 325 | $scope.focused = 6; |
324 | }); | 326 | }); |
325 | }, function() { | 327 | }, function() { |
326 | // funcion ejecutada cuando se cancela el modal | 328 | // funcion ejecutada cuando se cancela el modal |
327 | }); | 329 | }); |
328 | } | 330 | } |
329 | }; | 331 | }; |
330 | $scope.seleccionarTipoFactura = function(key) { | 332 | $scope.seleccionarTipoFactura = function(key) { |
333 | |||
334 | if ($scope.cliente.iva.NOMBRE == '') { | ||
335 | focaModalService.alert('Seleccione una responsabilidad ante el IVA'); | ||
336 | return; | ||
337 | } | ||
338 | |||
331 | if (key === 13) { | 339 | if (key === 13) { |
332 | var datos; | 340 | var datos; |
333 | if ($scope.cliente.iva.ID == 1) { | 341 | if ($scope.cliente.iva.ID == 1) { |
334 | datos = [ | 342 | datos = [ |
335 | { | 343 | { |
336 | ID: 'A', | 344 | ID: 'A', |
337 | NOMBRE: 'Factura A' | 345 | NOMBRE: 'Factura A' |
338 | }, | 346 | }, |
339 | { | 347 | { |
340 | ID: 'M', | 348 | ID: 'M', |
341 | NOMBRE: 'Factura M' | 349 | NOMBRE: 'Factura M' |
342 | }, | 350 | }, |
343 | { | 351 | { |
344 | ID: 'R', | 352 | ID: 'R', |
345 | NOMBRE: 'Remito' | 353 | NOMBRE: 'Remito' |
346 | } | 354 | } |
347 | ]; | 355 | ]; |
348 | } else { | 356 | } else { |
349 | datos = [ | 357 | datos = [ |
350 | { | 358 | { |
351 | ID: 'B', | 359 | ID: 'B', |
352 | NOMBRE: 'Factura B' | 360 | NOMBRE: 'Factura B' |
353 | }, | 361 | }, |
354 | { | 362 | { |
355 | ID: 'R', | 363 | ID: 'R', |
356 | NOMBRE: 'Remito' | 364 | NOMBRE: 'Remito' |
357 | } | 365 | } |
358 | ]; | 366 | ]; |
359 | } | 367 | } |
360 | focaModalService.modal({ | 368 | focaModalService.modal({ |
361 | titulo: 'Seleccionar Factura', | 369 | titulo: 'Seleccionar Factura', |
362 | data: datos, | 370 | data: datos, |
363 | size: 'md', | 371 | size: 'md', |
364 | columnas: [ | 372 | columnas: [ |
365 | { | 373 | { |
366 | propiedad: 'ID', | 374 | propiedad: 'ID', |
367 | NOMBRE: 'Codigo' | 375 | NOMBRE: 'Codigo' |
368 | }, | 376 | }, |
369 | { | 377 | { |
370 | propiedad: 'NOMBRE', | 378 | propiedad: 'NOMBRE', |
371 | NOMBRE: 'Factura' | 379 | NOMBRE: 'Factura' |
372 | } | 380 | } |
373 | ], | 381 | ], |
374 | }).then(function(res) { | 382 | }).then(function(res) { |
375 | $scope.cliente.tipoFactura = res; | 383 | $scope.cliente.tipoFactura = res; |
376 | }); | 384 | }); |
377 | } | 385 | } |
378 | }; | 386 | }; |
379 | $scope.seleccionarTipoComprobante = function(key) { | 387 | $scope.seleccionarTipoComprobante = function(key) { |
380 | if (key === 13) { | 388 | if (key === 13) { |
381 | var parametrosModal = { | 389 | var parametrosModal = { |
382 | searchText: $scope.cliente.tipoComprobante.NOMBRE, | 390 | searchText: $scope.cliente.tipoComprobante.NOMBRE, |
383 | query: '/tipo-comprobante', | 391 | query: '/tipo-comprobante', |
384 | columnas: [ | 392 | columnas: [ |
385 | { | 393 | { |
386 | propiedad: 'ID', | 394 | propiedad: 'ID', |
387 | nombre: 'Código' | 395 | nombre: 'Código' |
388 | }, | 396 | }, |
389 | { | 397 | { |
390 | propiedad: 'NOMBRE', | 398 | propiedad: 'NOMBRE', |
391 | nombre: 'Nombre' | 399 | nombre: 'Nombre' |
392 | } | 400 | } |
393 | ], | 401 | ], |
394 | titulo: 'Búsqueda de tipos de comprobante', | 402 | titulo: 'Búsqueda de tipos de comprobante', |
395 | size: 'md' | 403 | size: 'md' |
396 | }; | 404 | }; |
397 | focaModalService.modal(parametrosModal).then( | 405 | focaModalService.modal(parametrosModal).then( |
398 | function(tipoComprobante) { | 406 | function(tipoComprobante) { |
399 | $scope.cliente.tipoComprobante = tipoComprobante; | 407 | $scope.cliente.tipoComprobante = tipoComprobante; |
400 | $timeout(function() { | 408 | $timeout(function() { |
401 | $scope.focused = 17; | 409 | $scope.focused = 17; |
402 | }); | 410 | }); |
403 | }, function() { | 411 | }, function() { |
404 | // funcion ejecutada cuando se cancela el modal | 412 | // funcion ejecutada cuando se cancela el modal |
405 | }); | 413 | }); |
406 | } | 414 | } |
407 | }; | 415 | }; |
408 | $scope.seleccionarFormaPago = function(key) { | 416 | $scope.seleccionarFormaPago = function(key) { |
409 | if (key === 13) { | 417 | if (key === 13) { |
410 | var parametrosModal = { | 418 | var parametrosModal = { |
411 | searchText: $scope.cliente.formaPago.NOMBRE, | 419 | searchText: $scope.cliente.formaPago.NOMBRE, |
412 | query: '/forma-pago', | 420 | query: '/forma-pago', |
413 | columnas: [ | 421 | columnas: [ |
414 | { | 422 | { |
415 | propiedad: 'ID', | 423 | propiedad: 'ID', |
416 | nombre: 'Código', | 424 | nombre: 'Código', |
417 | filtro: { | 425 | filtro: { |
418 | nombre: 'rellenarDigitos', | 426 | nombre: 'rellenarDigitos', |
419 | parametro: 3 | 427 | parametro: 3 |
420 | } | 428 | } |
421 | }, | 429 | }, |
422 | { | 430 | { |
423 | propiedad: 'NOMBRE', | 431 | propiedad: 'NOMBRE', |
424 | nombre: 'Nombre' | 432 | nombre: 'Nombre' |
425 | } | 433 | } |
426 | ], | 434 | ], |
427 | titulo: 'Búsqueda de formas de pago', | 435 | titulo: 'Búsqueda de formas de pago', |
428 | size: 'md' | 436 | size: 'md' |
429 | }; | 437 | }; |
430 | focaModalService.modal(parametrosModal).then( | 438 | focaModalService.modal(parametrosModal).then( |
431 | function(formaPago) { | 439 | function(formaPago) { |
432 | $scope.cliente.formaPago = formaPago; | 440 | $scope.cliente.formaPago = formaPago; |
433 | }, function() { | 441 | }, function() { |
434 | // funcion ejecutada cuando se cancela el modal | 442 | // funcion ejecutada cuando se cancela el modal |
435 | }); | 443 | }); |
436 | } | 444 | } |
437 | }; | 445 | }; |
438 | $scope.seleccionarCobrador = function(key) { | 446 | $scope.seleccionarCobrador = function(key) { |
439 | if (key === 13) { | 447 | if (key === 13) { |
440 | var parametrosModal = { | 448 | var parametrosModal = { |
441 | searchText: $scope.cliente.cobrador.NOM, | 449 | searchText: $scope.cliente.cobrador.NOM, |
442 | query: '/cobrador', | 450 | query: '/cobrador', |
443 | columnas: [ | 451 | columnas: [ |
444 | { | 452 | { |
445 | propiedad: 'NUM', | 453 | propiedad: 'NUM', |
446 | nombre: 'Código' | 454 | nombre: 'Código' |
447 | }, | 455 | }, |
448 | { | 456 | { |
449 | propiedad: 'NOM', | 457 | propiedad: 'NOM', |
450 | nombre: 'Nombre' | 458 | nombre: 'Nombre' |
451 | } | 459 | } |
452 | ], | 460 | ], |
453 | titulo: 'Búsqueda de cobradores', | 461 | titulo: 'Búsqueda de cobradores', |
454 | size: 'md' | 462 | size: 'md' |
455 | }; | 463 | }; |
456 | focaModalService.modal(parametrosModal).then( | 464 | focaModalService.modal(parametrosModal).then( |
457 | function(cobrador) { | 465 | function(cobrador) { |
458 | $scope.cliente.cobrador = cobrador; | 466 | $scope.cliente.cobrador = cobrador; |
459 | }, function() { | 467 | }, function() { |
460 | // funcion ejecutada cuando se cancela el modal | 468 | // funcion ejecutada cuando se cancela el modal |
461 | }); | 469 | }); |
462 | } | 470 | } |
463 | }; | 471 | }; |
464 | 472 | ||
465 | $scope.pasarCampoCuit = function(numeroCuit) { | 473 | $scope.pasarCampoCuit = function(numeroCuit) { |
466 | |||
467 | if (numeroCuit === 1 && $scope.cliente.cuit1.length === 2) { | 474 | if (numeroCuit === 1 && $scope.cliente.cuit1.length === 2) { |
468 | $scope.cuitActivo = 2; | 475 | $scope.cuitActivo = 2; |
469 | } else if ( numeroCuit === 2 && $scope.cliente.cuit2.length === 8) { | 476 | } else if ( numeroCuit === 2 && $scope.cliente.cuit2.length === 8) { |
470 | $scope.cuitActivo = 3; | 477 | $scope.cuitActivo = 3; |
471 | } | 478 | } |
472 | }; | 479 | }; |
473 | 480 | ||
474 | $scope.guardar = function() { | 481 | $scope.guardar = function() { |
475 | if (!$scope.cliente.NOM) { | 482 | if (!$scope.cliente.NOM) { |
476 | focaModalService.alert('Ingrese Nombre'); | 483 | focaModalService.alert('Ingrese Nombre'); |
477 | return; | 484 | return; |
478 | } else if (!$scope.cliente.CPO) { | 485 | } else if (!$scope.cliente.CPO) { |
479 | focaModalService.alert('Ingrese Codigo Postal'); | 486 | focaModalService.alert('Ingrese Codigo Postal'); |
480 | return; | 487 | return; |
481 | } else if (!$scope.cliente.provincia.NOMBRE) { | 488 | } else if (!$scope.cliente.provincia.NOMBRE) { |
482 | focaModalService.alert('Seleccione una provincia'); | 489 | focaModalService.alert('Seleccione una provincia'); |
483 | return; | 490 | return; |
484 | } else if (!$scope.cliente.DOM) { | 491 | } else if (!$scope.cliente.DOM) { |
485 | focaModalService.alert('Ingrese Domicilio'); | 492 | focaModalService.alert('Ingrese Domicilio'); |
486 | return; | 493 | return; |
487 | } else if (!$scope.cliente.localidad.NOMBRE) { | 494 | } else if (!$scope.cliente.localidad.NOMBRE) { |
488 | focaModalService.alert('Seleccione una localidad'); | 495 | focaModalService.alert('Seleccione una localidad'); |
489 | return; | 496 | return; |
490 | } else if (!$scope.cliente.zona.NOM) { | 497 | } else if (!$scope.cliente.zona.NOM) { |
491 | focaModalService.alert('Seleccione una zona'); | 498 | focaModalService.alert('Seleccione una zona'); |
492 | return; | 499 | return; |
493 | } else if (!$scope.cliente.actividad.NOM) { | 500 | } else if (!$scope.cliente.actividad.NOM) { |
494 | focaModalService.alert('Seleccione actividad'); | 501 | focaModalService.alert('Seleccione actividad'); |
495 | return; | 502 | return; |
496 | } else if (!$scope.cliente.cobrador.NUM) { | 503 | } else if (!$scope.cliente.cobrador.NUM) { |
497 | focaModalService.alert('Seleccione un cobrador'); | 504 | focaModalService.alert('Seleccione un cobrador'); |
498 | return; | 505 | return; |
506 | } else if ($scope.cliente.MAIL && !validateEmails($scope.cliente.MAIL)) { | ||
507 | focaModalService.alert('Ingrese un formato de email válido'); | ||
508 | return; | ||
499 | } else if (!$scope.cliente.TEL) { | 509 | } else if (!$scope.cliente.TEL) { |
500 | focaModalService.alert('Ingrese un numero de telefono'); | 510 | focaModalService.alert('Ingrese un numero de telefono'); |
501 | return; | 511 | return; |
502 | } else if (!$scope.cliente.iva.NOMBRE) { | 512 | } else if (!$scope.cliente.iva.NOMBRE) { |
503 | focaModalService.alert('Seleccione responsabilidad ante el IVA'); | 513 | focaModalService.alert('Seleccione responsabilidad ante el IVA'); |
504 | return; | 514 | return; |
505 | } else if (!$scope.cliente.tipoFactura.NOMBRE) { | 515 | } else if (!$scope.cliente.tipoFactura.NOMBRE) { |
506 | focaModalService.alert('Seleccione tipo de Factura'); | 516 | focaModalService.alert('Seleccione tipo de Factura'); |
507 | return; | 517 | return; |
508 | } else if (!$scope.cliente.cuit1 && !$scope.cliente.cuit2 && !$scope.cliente.cuit3) { | 518 | } else if (!$scope.cliente.cuit1 && !$scope.cliente.cuit2 && !$scope.cliente.cuit3) { |
509 | focaModalService.alert('Ingrese CUIT'); | 519 | focaModalService.alert('Ingrese CUIT'); |
510 | return; | 520 | return; |
511 | } else if (!$scope.cliente.cuit1 || !$scope.cliente.cuit2 || !$scope.cliente.cuit3){ | 521 | } else if (!$scope.cliente.cuit1 || !$scope.cliente.cuit2 || !$scope.cliente.cuit3){ |
512 | focaModalService.alert('Ingrese CUIT válido'); | 522 | focaModalService.alert('Ingrese CUIT válido'); |
513 | return; | 523 | return; |
514 | } else if (!$scope.regexCuit.test($scope.cliente.cuit1 + $scope.cliente.cuit2 + $scope.cliente.cuit3) ) { | 524 | } else if (!$scope.regexCuit.test($scope.cliente.cuit1 + $scope.cliente.cuit2 + $scope.cliente.cuit3) ) { |
515 | focaModalService.alert('Ingrese CUIT con formato: XX-XXXXXXXX-X'); | 525 | focaModalService.alert('Ingrese CUIT con formato: XX-XXXXXXXX-X'); |
516 | return; | 526 | return; |
517 | } else if (!$scope.cliente.tipoComprobante.NOMBRE) { | 527 | } else if (!$scope.cliente.tipoComprobante.NOMBRE) { |
518 | focaModalService.alert('Seleccione un Comprobante'); | 528 | focaModalService.alert('Seleccione un Comprobante'); |
519 | return; | 529 | return; |
520 | } else if (!$scope.cliente.formaPago.NOMBRE) { | 530 | } else if (!$scope.cliente.formaPago.NOMBRE) { |
521 | focaModalService.alert('Seleccione una forma de pago'); | 531 | focaModalService.alert('Seleccione una forma de pago'); |
522 | return; | 532 | return; |
523 | } | 533 | } |
524 | 534 | ||
525 | var cliente = crearCopia(); | 535 | var cliente = crearCopia(); |
526 | 536 | ||
527 | focaBusquedaClienteService | 537 | focaBusquedaClienteService |
528 | .guardarCliente(cliente) | 538 | .guardarCliente(cliente) |
529 | .then(function(res) { | 539 | .then(function(res) { |
530 | var cliente = { | 540 | var cliente = { |
531 | cod: res.data.COD, | 541 | cod: res.data.COD, |
532 | cuit: res.data.CUIT, | 542 | cuit: res.data.CUIT, |
533 | esNuevo: res.data.esNuevo, | 543 | esNuevo: res.data.esNuevo, |
534 | nom: res.data.NOM | 544 | nom: res.data.NOM |
535 | }; | 545 | }; |
536 | $scope.select(cliente, true); | 546 | $scope.select(cliente, true); |
537 | }); | 547 | }); |
538 | }; | 548 | }; |
539 | 549 | ||
540 | function crearCopia(){ | 550 | function crearCopia(){ |
541 | var cliente = angular.copy($scope.cliente); | 551 | var cliente = angular.copy($scope.cliente); |
542 | 552 | ||
543 | cliente.PCX = cliente.provincia.ID; | 553 | cliente.PCX = cliente.provincia.ID; |
544 | cliente.LOX = cliente.localidad.ID; | 554 | cliente.LOX = cliente.localidad.ID; |
545 | cliente.IVA = cliente.iva.ID; | 555 | cliente.IVA = cliente.iva.ID; |
546 | cliente.ACT = cliente.actividad.ID; | 556 | cliente.ACT = cliente.actividad.ID; |
547 | cliente.ZON = cliente.zona.ID; | 557 | cliente.ZON = cliente.zona.ID; |
548 | cliente.TIP = cliente.tipoFactura.ID; | 558 | cliente.TIP = cliente.tipoFactura.ID; |
549 | cliente.TCO = cliente.tipoComprobante.ID; | 559 | cliente.TCO = cliente.tipoComprobante.ID; |
550 | cliente.FPA = cliente.formaPago.ID; | 560 | cliente.FPA = cliente.formaPago.ID; |
551 | cliente.VEN = vendedor.ID; | 561 | cliente.VEN = vendedor.ID; |
552 | cliente.CUIT = cliente.cuit1 + cliente.cuit2 + cliente.cuit3; | 562 | cliente.CUIT = cliente.cuit1 + cliente.cuit2 + cliente.cuit3; |
553 | cliente.idCobrador = cliente.cobrador.ID; | 563 | cliente.idCobrador = cliente.cobrador.ID; |
554 | 564 | ||
555 | delete cliente.provincia; | 565 | delete cliente.provincia; |
556 | delete cliente.localidad; | 566 | delete cliente.localidad; |
557 | delete cliente.iva; | 567 | delete cliente.iva; |
558 | delete cliente.actividad; | 568 | delete cliente.actividad; |
559 | delete cliente.zona; | 569 | delete cliente.zona; |
560 | delete cliente.tipoFactura; | 570 | delete cliente.tipoFactura; |
561 | delete cliente.tipoComprobante; | 571 | delete cliente.tipoComprobante; |
562 | delete cliente.formaPago; | 572 | delete cliente.formaPago; |
563 | delete cliente.cobrador; | 573 | delete cliente.cobrador; |
564 | delete cliente.cuit1; | 574 | delete cliente.cuit1; |
565 | delete cliente.cuit2; | 575 | delete cliente.cuit2; |
566 | delete cliente.cuit3; | 576 | delete cliente.cuit3; |
567 | 577 | ||
568 | return cliente; | 578 | return cliente; |
569 | } | 579 | } |
570 | 580 | ||
571 | function calcularPages(paginaActual) { | 581 | function calcularPages(paginaActual) { |
572 | var paginas = []; | 582 | var paginas = []; |
573 | paginas.push(paginaActual); | 583 | paginas.push(paginaActual); |
574 | 584 | ||
575 | if (paginaActual - 1 > 1) { | 585 | if (paginaActual - 1 > 1) { |
576 | 586 | ||
577 | paginas.unshift(paginaActual - 1); | 587 | paginas.unshift(paginaActual - 1); |
578 | if (paginaActual - 2 > 1) { | 588 | if (paginaActual - 2 > 1) { |
579 | paginas.unshift(paginaActual - 2); | 589 | paginas.unshift(paginaActual - 2); |
580 | } | 590 | } |
581 | } | 591 | } |
582 | 592 | ||
583 | if (paginaActual + 1 < $scope.lastPage) { | 593 | if (paginaActual + 1 < $scope.lastPage) { |
584 | paginas.push(paginaActual + 1); | 594 | paginas.push(paginaActual + 1); |
585 | if (paginaActual + 2 < $scope.lastPage) { | 595 | if (paginaActual + 2 < $scope.lastPage) { |
586 | paginas.push(paginaActual + 2); | 596 | paginas.push(paginaActual + 2); |
587 | } | 597 | } |
588 | } | 598 | } |
589 | 599 | ||
590 | if (paginaActual !== 1) { | 600 | if (paginaActual !== 1) { |
591 | paginas.unshift(1); | 601 | paginas.unshift(1); |
592 | } | 602 | } |
593 | 603 | ||
594 | if (paginaActual !== $scope.lastPage) { | 604 | if (paginaActual !== $scope.lastPage) { |
595 | paginas.push($scope.lastPage); | 605 | paginas.push($scope.lastPage); |
596 | } | 606 | } |
597 | 607 | ||
598 | return paginas; | 608 | return paginas; |
599 | } | 609 | } |
600 | 610 | ||
601 | function primera() { | 611 | function primera() { |
602 | $scope.selectedClientes = 0; | 612 | $scope.selectedClientes = 0; |
603 | } | 613 | } |
604 | 614 | ||
605 | function anterior() { | 615 | function anterior() { |
606 | if ($scope.selectedClientes === 0 && $scope.currentPage > 1) { | 616 | if ($scope.selectedClientes === 0 && $scope.currentPage > 1) { |
607 | retrocederPagina(); | 617 | retrocederPagina(); |
608 | } else { | 618 | } else { |
609 | $scope.selectedClientes--; | 619 | $scope.selectedClientes--; |
610 | } | 620 | } |
611 | } | 621 | } |
612 | 622 | ||
613 | function siguiente() { | 623 | function siguiente() { |
614 | if ($scope.selectedClientes < $scope.currentPageClientes.length - 1 ) { | 624 | if ($scope.selectedClientes < $scope.currentPageClientes.length - 1 ) { |
615 | $scope.selectedClientes++; | 625 | $scope.selectedClientes++; |
616 | } else { | 626 | } else { |
617 | avanzarPagina(); | 627 | avanzarPagina(); |
618 | } | 628 | } |
619 | } | 629 | } |
620 | 630 | ||
621 | function retrocederPagina() { | 631 | function retrocederPagina() { |
622 | if ($scope.currentPage > 1) { | 632 | if ($scope.currentPage > 1) { |
623 | $scope.selectPage($scope.currentPage - 1); | 633 | $scope.selectPage($scope.currentPage - 1); |
624 | $scope.selectedClientes = $scope.numPerPage - 1; | 634 | $scope.selectedClientes = $scope.numPerPage - 1; |
625 | } | 635 | } |
626 | } | 636 | } |
627 | 637 | ||
628 | function avanzarPagina() { | 638 | function avanzarPagina() { |
629 | if ($scope.currentPage < $scope.lastPage) { | 639 | if ($scope.currentPage < $scope.lastPage) { |
630 | $scope.selectPage($scope.currentPage + 1); | 640 | $scope.selectPage($scope.currentPage + 1); |
631 | $scope.selectedClientes = 0; | 641 | $scope.selectedClientes = 0; |
632 | } | 642 | } |
633 | } | 643 | } |
634 | 644 | function validateEmails(emails) { | |
645 | var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | ||
646 | var arr = emails.split(','); | ||
647 | var result = true; | ||
648 | arr.forEach(function(email) { | ||
649 | var val = String(email).trim().toLowerCase(); | ||
650 | if (!re.test(val)) result = false; | ||
651 | }); | ||
652 | return result; | ||
653 | } | ||
635 | } | 654 | } |
src/views/foca-busqueda-cliente-modal.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-4 col-7"> | 3 | <div class="col-lg-4 col-7"> |
4 | <h5 class="modal-title my-1" ng-hide="ingreso">Búsqueda de Cliente</h5> | 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> | 5 | <h5 class="modal-title my-1" ng-show="ingreso">Crear Cliente</h5> |
6 | </div> | 6 | </div> |
7 | <div ng-show="ingreso" class="col-lg-6 col-5 front-index"> | 7 | <div ng-show="ingreso" class="col-lg-6 col-5 front-index"> |
8 | <div class="custom-control custom-checkbox mt-2"> | 8 | <div class="custom-control custom-checkbox mt-2"> |
9 | <input | 9 | <input |
10 | type="checkbox" | 10 | type="checkbox" |
11 | class="custom-control-input" | 11 | class="custom-control-input" |
12 | id="checkProspecto" | 12 | id="checkProspecto" |
13 | ng-model="cliente.ES_PROS"> | 13 | ng-model="cliente.ES_PROS"> |
14 | <label class="custom-control-label" for="checkProspecto">¿Es prospecto?</label> | 14 | <label class="custom-control-label" for="checkProspecto">¿Es prospecto?</label> |
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | <div class="input-group col-lg-6 offset-lg-2 pr-0 my-2"> | 17 | <div class="input-group col-lg-6 offset-lg-2 pr-0 my-2"> |
18 | <button | 18 | <button |
19 | class="btn btn-outline-primary mr-2" | 19 | class="btn btn-outline-debo mr-2" |
20 | ng-click="ingreso = true" | 20 | ng-click="ingreso = true" |
21 | ng-show="!ingreso && vendedor.NUM" | 21 | ng-show="!ingreso && vendedor.NUM" |
22 | title="Nuevo"> | 22 | title="Nuevo"> |
23 | <i class="fa fa-plus" aria-hidden="true"></i> | 23 | <i class="fa fa-plus" aria-hidden="true"></i> |
24 | </button> | 24 | </button> |
25 | <input | 25 | <input |
26 | ladda="searchLoading" | 26 | ladda="searchLoading" |
27 | type="text" | 27 | type="text" |
28 | class="form-control form-control-sm" | 28 | class="form-control form-control-sm" |
29 | id="search" | 29 | id="search" |
30 | placeholder="Busqueda" | 30 | placeholder="Busqueda" |
31 | ng-model="filters" | 31 | ng-model="filters" |
32 | ng-change="search()" | 32 | ng-change="search()" |
33 | ng-keydown="busquedaDown($event.keyCode)" | 33 | ng-keydown="busquedaDown($event.keyCode)" |
34 | ng-keypress="busquedaPress($event.keyCode)" | 34 | ng-keypress="busquedaPress($event.keyCode)" |
35 | foca-focus="selectedClientes == -1" | 35 | foca-focus="selectedClientes == -1" |
36 | ng-focus="selectedClientes = -1" | 36 | ng-focus="selectedClientes = -1" |
37 | teclado-virtual | 37 | teclado-virtual |
38 | ng-hide="ingreso" | 38 | ng-hide="ingreso" |
39 | > | 39 | > |
40 | <button | ||
41 | ng-show="filters.length >= 1" | ||
42 | type="button" | ||
43 | class="clear-input" | ||
44 | ng-click="filters = ''" | ||
45 | > | ||
46 | <i class="fa fa-times"></i> | ||
47 | </button> | ||
40 | <div class="input-group-append" ng-hide="ingreso"> | 48 | <div class="input-group-append" ng-hide="ingreso"> |
41 | <button | 49 | <button |
42 | ladda="searchLoading" | 50 | ladda="searchLoading" |
43 | data-spinner-color="#FF0000" | 51 | data-spinner-color="#FF0000" |
44 | class="btn btn-outline-secondary" | 52 | class="btn btn-outline-secondary" |
45 | type="button" | 53 | type="button" |
46 | ng-click="busquedaPress(13)"> | 54 | ng-click="busquedaPress(13)"> |
47 | <i class="fa fa-search" aria-hidden="true"></i> | 55 | <i class="fa fa-search" aria-hidden="true"></i> |
48 | </button> | 56 | </button> |
49 | </div> | 57 | </div> |
50 | </div> | 58 | </div> |
51 | </div> | 59 | </div> |
52 | </div> | 60 | </div> |
53 | <div class="modal-body" id="modal-body"> | 61 | <div class="modal-body" id="modal-body"> |
54 | 62 | ||
55 | <div ng-show="!primerBusqueda && !ingreso"> | 63 | <div ng-show="!primerBusqueda && !ingreso"> |
56 | Debe realizar una primer búsqueda. | 64 | Debe realizar una primer búsqueda. |
57 | </div> | 65 | </div> |
58 | 66 | ||
59 | <table ng-show="primerBusqueda && !ingreso" class="table table-striped table-sm"> | 67 | <table ng-show="primerBusqueda && !ingreso" class="table table-striped table-sm"> |
60 | <thead> | 68 | <thead> |
61 | <tr> | 69 | <tr> |
62 | <th>Código</th> | 70 | <th>Código</th> |
63 | <th>Nombre</th> | 71 | <th>Nombre</th> |
64 | <th>CUIT</th> | 72 | <th>CUIT</th> |
65 | <th></th> | 73 | <th></th> |
66 | </tr> | 74 | </tr> |
67 | </thead> | 75 | </thead> |
68 | <tbody> | 76 | <tbody> |
69 | <tr ng-show="currentPageClientes.length == 0 && primerBusqueda"> | 77 | <tr ng-show="currentPageClientes.length == 0 && primerBusqueda"> |
70 | <td colspan="4"> | 78 | <td colspan="4"> |
71 | No se encontraron resultados. | 79 | No se encontraron resultados. |
72 | </td> | 80 | </td> |
73 | </tr> | 81 | </tr> |
74 | <tr | 82 | <tr |
75 | class="selectable" | 83 | class="selectable" |
76 | ng-repeat="(key, cliente) in currentPageClientes" | 84 | ng-repeat="(key, cliente) in currentPageClientes" |
77 | ng-click="select(cliente)"> | 85 | ng-click="select(cliente)"> |
78 | <td ng-bind="('00000'+cliente.cod).slice(-5)"></td> | 86 | <td ng-bind="('00000'+cliente.cod).slice(-5)"></td> |
79 | <td ng-bind="cliente.nom"></td> | 87 | <td ng-bind="cliente.nom"></td> |
80 | <td ng-bind="cliente.cuit"></td> | 88 | <td ng-bind="cliente.cuit"></td> |
81 | <td> | 89 | <td> |
82 | <button | 90 | <button |
83 | type="button" | 91 | type="button" |
84 | class="btn btn-xs p-1 float-right" | 92 | class="btn btn-xs p-1 float-right" |
85 | ng-class="{ | 93 | ng-class="{ |
86 | 'btn-secondary': selectedClientes != key, | 94 | 'btn-secondary': selectedClientes != key, |
87 | 'btn-primary': selectedClientes == key | 95 | 'btn-primary': selectedClientes == key |
88 | }" | 96 | }" |
89 | ng-click="select(cliente)" | 97 | ng-click="select(cliente)" |
90 | foca-focus="selectedClientes == {{key}}" | 98 | foca-focus="selectedClientes == {{key}}" |
91 | ng-keydown="itemCliente($event.keyCode)" | 99 | ng-keydown="itemCliente($event.keyCode)" |
92 | > | 100 | > |
93 | <i class="fa fa-circle-thin" aria-hidden="true"></i> | 101 | <i class="fa fa-circle-thin" aria-hidden="true"></i> |
94 | </button> | 102 | </button> |
95 | </td> | 103 | </td> |
96 | </tr> | 104 | </tr> |
97 | </tbody> | 105 | </tbody> |
98 | </table> | 106 | </table> |
99 | 107 | ||
100 | <form name="formCliente"> | 108 | <form name="formCliente"> |
101 | <uib-tabset class="tabs-right" ng-show="ingreso"> | 109 | <uib-tabset class="tabs-right" ng-show="ingreso"> |
102 | <uib-tab heading="Datos cliente"> | 110 | <uib-tab heading="Datos cliente"> |
103 | <div class="row"> | 111 | <div class="row"> |
104 | <div class="col-3"> | 112 | <div class="col-3"> |
105 | <label>Código</label> | 113 | <label>Código</label> |
106 | <input | 114 | <input |
107 | type="text" | 115 | type="text" |
108 | class="form-control form-control-sm" | 116 | class="form-control form-control-sm" |
109 | ng-model="cliente.codigo" | 117 | ng-model="cliente.codigo" |
110 | readonly | 118 | readonly |
111 | /> | 119 | /> |
112 | </div> | 120 | </div> |
113 | <div class="col-9"> | 121 | <div class="col-9"> |
114 | <label>Nombre</label> | 122 | <label>Nombre</label> |
115 | <input | 123 | <input |
116 | type="text" | 124 | type="text" |
117 | class="form-control form-control-sm" | 125 | class="form-control form-control-sm" |
118 | ng-model="cliente.NOM" | 126 | ng-model="cliente.NOM" |
119 | teclado-virtual | 127 | teclado-virtual |
120 | placeholder="Ingrese nombre" | 128 | placeholder="Ingrese nombre" |
121 | ng-required="true" | 129 | ng-required="true" |
122 | foca-focus="focused == 1 || ingreso" | 130 | foca-focus="focused == 1 || ingreso" |
123 | ng-focus="focus(1)" | 131 | ng-focus="focus(1)" |
124 | ng-keypress="next($event.keyCode)" | 132 | ng-keypress="next($event.keyCode)" |
125 | /> | 133 | /> |
126 | </div> | 134 | </div> |
127 | </div> | 135 | </div> |
128 | <div class="row"> | 136 | <div class="row"> |
129 | <div class="col-md-9 col-12"> | 137 | <div class="col-md-9 col-12"> |
130 | <label>Domicilio</label> | 138 | <label>Domicilio</label> |
131 | <input | 139 | <input |
132 | type="text" | 140 | type="text" |
133 | class="form-control form-control-sm" | 141 | class="form-control form-control-sm" |
134 | ng-model="cliente.DOM" | 142 | ng-model="cliente.DOM" |
135 | teclado-virtual | 143 | teclado-virtual |
136 | placeholder="Ingrese domicilio" | 144 | placeholder="Ingrese domicilio" |
137 | ng-required="true" | 145 | ng-required="true" |
138 | ng-focus="focus(2)" | 146 | ng-focus="focus(2)" |
139 | foca-focus="focused == 2" | 147 | foca-focus="focused == 2" |
140 | ng-keypress="next($event.keyCode)" | 148 | ng-keypress="next($event.keyCode)" |
141 | /> | 149 | /> |
142 | </div> | 150 | </div> |
143 | <div class="col-md-3 col-12"> | 151 | <div class="col-md-3 col-12"> |
144 | <label>Código postal</label> | 152 | <label>Código postal</label> |
145 | <input | 153 | <input |
146 | type="text" | 154 | type="text" |
147 | class="form-control form-control-sm" | 155 | class="form-control form-control-sm" |
148 | ng-model="cliente.CPO" | 156 | ng-model="cliente.CPO" |
149 | placeholder="Ingrese CP" | 157 | placeholder="Ingrese CP" |
150 | ng-required="true" | 158 | ng-required="true" |
151 | ng-focus="focus(3)" | 159 | ng-focus="focus(3)" |
152 | foca-focus="focused == 3" | 160 | foca-focus="focused == 3" |
153 | ng-keypress="next($event.keyCode)" | 161 | ng-keypress="next($event.keyCode)" |
154 | teclado-virtual | 162 | teclado-virtual |
155 | /> | 163 | /> |
156 | </div> | 164 | </div> |
157 | </div> | 165 | </div> |
158 | <div class="row"> | 166 | <div class="row"> |
159 | <div class="col-md-6 col-12"> | 167 | <div class="col-md-6 col-12"> |
160 | <label>Provincia</label> | 168 | <label>Provincia</label> |
161 | <div class="input-group"> | 169 | <div class="input-group"> |
162 | <input | 170 | <input |
163 | type="text" | 171 | type="text" |
164 | class="form-control form-control-sm" | 172 | class="form-control form-control-sm" |
165 | ng-model="cliente.provincia.NOMBRE" | 173 | ng-model="cliente.provincia.NOMBRE" |
166 | ng-keypress="seleccionarProvincia($event.keyCode)" | 174 | ng-keypress="seleccionarProvincia($event.keyCode)" |
167 | placeholder="Seleccione provincia" | 175 | placeholder="Seleccione provincia" |
168 | ng-required="true" | 176 | ng-required="true" |
169 | ng-focus="focus(4)" | 177 | ng-focus="focus(4)" |
170 | foca-focus="focused == 4" | 178 | foca-focus="focused == 4" |
171 | teclado-virtual | 179 | teclado-virtual |
172 | /> | 180 | /> |
181 | <button | ||
182 | ng-show="cliente.provincia.NOMBRE.length >= 1" | ||
183 | type="button" | ||
184 | class="clear-input" | ||
185 | ng-click="cliente.provincia.NOMBRE = ''" | ||
186 | > | ||
187 | <i class="fa fa-times"></i> | ||
188 | </button> | ||
173 | <div class="input-group-append"> | 189 | <div class="input-group-append"> |
174 | <button | 190 | <button |
175 | ladda="searchLoading" | 191 | ladda="searchLoading" |
176 | class="btn btn-outline-secondary form-control-sm" | 192 | class="btn btn-outline-secondary" |
177 | type="button" | 193 | type="button" |
178 | ng-click="seleccionarProvincia(13)" | 194 | ng-click="seleccionarProvincia(13)" |
179 | > | 195 | > |
180 | <i class="fa fa-search" aria-hidden="true"></i> | 196 | <i class="fa fa-search" aria-hidden="true"></i> |
181 | </button> | 197 | </button> |
182 | </div> | 198 | </div> |
183 | </div> | 199 | </div> |
184 | </div> | 200 | </div> |
185 | <div class="col-md-6 col-12"> | 201 | <div class="col-md-6 col-12"> |
186 | <label>Localidad</label> | 202 | <label>Localidad</label> |
187 | <div class="input-group"> | 203 | <div class="input-group"> |
188 | <input | 204 | <input |
189 | type="text" | 205 | type="text" |
190 | class="form-control form-control-sm" | 206 | class="form-control form-control-sm" |
191 | ng-model="cliente.localidad.NOMBRE" | 207 | ng-model="cliente.localidad.NOMBRE" |
192 | ng-keypress="seleccionarLocalidad($event.keyCode)" | 208 | ng-keypress="seleccionarLocalidad($event.keyCode)" |
193 | placeholder="Seleccione localidad" | 209 | placeholder="Seleccione localidad" |
194 | ng-required="true" | 210 | ng-required="true" |
195 | foca-focus="focused == 5" | 211 | foca-focus="focused == 5" |
196 | ng-focus="focus(5)" | 212 | ng-focus="focus(5)" |
197 | teclado-virtual | 213 | teclado-virtual |
198 | /> | 214 | /> |
215 | <button | ||
216 | ng-show="cliente.localidad.NOMBRE.length >= 1" | ||
217 | type="button" | ||
218 | class="clear-input" | ||
219 | ng-click="cliente.localidad.NOMBRE = ''" | ||
220 | > | ||
221 | <i class="fa fa-times"></i> | ||
222 | </button> | ||
199 | <div class="input-group-append"> | 223 | <div class="input-group-append"> |
200 | <button | 224 | <button |
201 | ladda="searchLoading" | 225 | ladda="searchLoading" |
202 | class="btn btn-outline-secondary form-control-sm" | 226 | class="btn btn-outline-secondary" |
203 | type="button" | 227 | type="button" |
204 | ng-click="seleccionarLocalidad(13)" | 228 | ng-click="seleccionarLocalidad(13)" |
205 | > | 229 | > |
206 | <i class="fa fa-search" aria-hidden="true"></i> | 230 | <i class="fa fa-search" aria-hidden="true"></i> |
207 | </button> | 231 | </button> |
208 | </div> | 232 | </div> |
209 | </div> | 233 | </div> |
210 | </div> | 234 | </div> |
211 | </div> | 235 | </div> |
212 | <div class="row"> | 236 | <div class="row"> |
213 | <div class="col-md-6 col-12"> | 237 | <div class="col-md-6 col-12"> |
214 | <label>Zona</label> | 238 | <label>Zona</label> |
215 | <div class="input-group"> | 239 | <div class="input-group"> |
216 | <input | 240 | <input |
217 | type="text" | 241 | type="text" |
218 | class="form-control form-control-sm" | 242 | class="form-control form-control-sm" |
219 | ng-model="cliente.zona.NOM" | 243 | ng-model="cliente.zona.NOM" |
220 | ng-keypress="seleccionarZona($event.keyCode)" | 244 | ng-keypress="seleccionarZona($event.keyCode)" |
221 | placeholder="Seleccione zona" | 245 | placeholder="Seleccione zona" |
222 | ng-required="true" | 246 | ng-required="true" |
223 | ng-focus="focus(6)" | 247 | ng-focus="focus(6)" |
224 | foca-focus="focused == 6" | 248 | foca-focus="focused == 6" |
225 | teclado-virtual | 249 | teclado-virtual |
226 | /> | 250 | /> |
251 | <button | ||
252 | ng-show="cliente.zona.NOM.length >= 1" | ||
253 | type="button" | ||
254 | class="clear-input" | ||
255 | ng-click="cliente.zona.NOM = ''" | ||
256 | > | ||
257 | <i class="fa fa-times"></i> | ||
258 | </button> | ||
227 | <div class="input-group-append"> | 259 | <div class="input-group-append"> |
228 | <button | 260 | <button |
229 | ladda="searchLoading" | 261 | ladda="searchLoading" |
230 | class="btn btn-outline-secondary form-control-sm" | 262 | class="btn btn-outline-secondary" |
231 | type="button" | 263 | type="button" |
232 | ng-click="seleccionarZona(13)" | 264 | ng-click="seleccionarZona(13)" |
233 | > | 265 | > |
234 | <i class="fa fa-search" aria-hidden="true"></i> | 266 | <i class="fa fa-search" aria-hidden="true"></i> |
235 | </button> | 267 | </button> |
236 | </div> | 268 | </div> |
237 | </div> | 269 | </div> |
238 | </div> | 270 | </div> |
239 | <div class="col-md-6 col-12"> | 271 | <div class="col-md-6 col-12"> |
240 | <label> Actividad </label> | 272 | <label> Actividad </label> |
241 | <div class="input-group"> | 273 | <div class="input-group"> |
242 | <input | 274 | <input |
243 | type="text" | 275 | type="text" |
244 | class="form-control form-control-sm" | 276 | class="form-control form-control-sm" |
245 | ng-model="cliente.actividad.NOM" | 277 | ng-model="cliente.actividad.NOM" |
246 | ng-keypress="seleccionarActividad($event.keyCode)" | 278 | ng-keypress="seleccionarActividad($event.keyCode)" |
247 | placeholder="Seleccione actividad" | 279 | placeholder="Seleccione actividad" |
248 | ng-required="true" | 280 | ng-required="true" |
249 | ng-focus="focus(7)" | 281 | ng-focus="focus(7)" |
250 | foca-focus="focused == 7" | 282 | foca-focus="focused == 7" |
251 | teclado-virtual | 283 | teclado-virtual |
252 | /> | 284 | /> |
285 | <button | ||
286 | ng-show="cliente.actividad.NOM.length >= 1" | ||
287 | type="button" | ||
288 | class="clear-input" | ||
289 | ng-click="cliente.actividad.NOM = ''" | ||
290 | > | ||
291 | <i class="fa fa-times"></i> | ||
292 | </button> | ||
253 | <div class="input-group-append"> | 293 | <div class="input-group-append"> |
254 | <button | 294 | <button |
255 | ladda="searchLoading" | 295 | ladda="searchLoading" |
256 | class="btn btn-outline-secondary form-control-sm" | 296 | class="btn btn-outline-secondary" |
257 | type="button" | 297 | type="button" |
258 | ng-click="seleccionarActividad(13)" | 298 | ng-click="seleccionarActividad(13)" |
259 | > | 299 | > |
260 | <i class="fa fa-search" aria-hidden="true"></i> | 300 | <i class="fa fa-search" aria-hidden="true"></i> |
261 | </button> | 301 | </button> |
262 | </div> | 302 | </div> |
263 | </div> | 303 | </div> |
264 | </div> | 304 | </div> |
265 | </div> | 305 | </div> |
266 | <div class="row"> | 306 | <div class="row"> |
267 | <div class="col-md-6 col-12"> | 307 | <div class="col-md-6 col-12"> |
268 | <label>Cobrador</label> | 308 | <label>Cobrador</label> |
269 | <div class="input-group"> | 309 | <div class="input-group"> |
270 | <input | 310 | <input |
271 | type="text" | 311 | type="text" |
272 | class="form-control form-control-sm" | 312 | class="form-control form-control-sm" |
273 | ng-model="cliente.cobrador.NOM" | 313 | ng-model="cliente.cobrador.NOM" |
274 | ng-keypress="seleccionarCobrador($event.keyCode)" | 314 | ng-keypress="seleccionarCobrador($event.keyCode)" |
275 | placeholder="Seleccione cobrador" | 315 | placeholder="Seleccione cobrador" |
276 | ng-focus="focus(8)" | 316 | ng-focus="focus(8)" |
277 | foca-focus="focused == 8" | 317 | foca-focus="focused == 8" |
278 | teclado-virtual | 318 | teclado-virtual |
279 | /> | 319 | /> |
320 | <button | ||
321 | ng-show="cliente.cobrador.NOM.length >= 1" | ||
322 | type="button" | ||
323 | class="clear-input" | ||
324 | ng-click="cliente.cobrador.NOM = ''" | ||
325 | > | ||
326 | <i class="fa fa-times"></i> | ||
327 | </button> | ||
280 | <div class="input-group-append"> | 328 | <div class="input-group-append"> |
281 | <button | 329 | <button |
282 | ladda="searchLoading" | 330 | ladda="searchLoading" |
283 | class="btn btn-outline-secondary form-control-sm" | 331 | class="btn btn-outline-secondary" |
284 | type="button" | 332 | type="button" |
285 | ng-click="seleccionarCobrador(13)" | 333 | ng-click="seleccionarCobrador(13)" |
286 | > | 334 | > |
287 | <i class="fa fa-search" aria-hidden="true"></i> | 335 | <i class="fa fa-search" aria-hidden="true"></i> |
288 | </button> | 336 | </button> |
289 | </div> | 337 | </div> |
290 | </div> | 338 | </div> |
291 | </div> | 339 | </div> |
292 | <div class="col-md-6 col-12"> | 340 | <div class="col-md-6 col-12"> |
293 | <label>Vendedor</label> | 341 | <label>Vendedor</label> |
294 | <div class="input-group"> | 342 | <div class="input-group"> |
295 | <input | 343 | <input |
296 | type="text" | 344 | type="text" |
297 | class="form-control form-control-sm" | 345 | class="form-control form-control-sm" |
298 | ng-model="vendedor.NOM" | 346 | ng-model="vendedor.NOM" |
299 | disabled="true" | 347 | disabled="true" |
300 | /> | 348 | /> |
301 | </div> | 349 | </div> |
302 | </div> | 350 | </div> |
303 | <div class="col-md-6 col-12"> | 351 | <div class="col-md-6 col-12"> |
304 | <label>Email</label> | 352 | <label>Email</label> |
305 | <div class="input-group"> | 353 | <div class="input-group"> |
306 | <input | 354 | <input |
307 | type="email" | 355 | type="text" |
308 | class="form-control form-control-sm" | 356 | class="form-control form-control-sm" |
309 | placeholder="Ingrese Email" | 357 | placeholder="Ingrese Email" |
310 | ng-model="cliente.MAIL" | 358 | ng-model="cliente.MAIL" |
311 | ng-required="true" | 359 | ng-required="true" |
312 | ng-keypress="next($event.keyCode)" | 360 | ng-keypress="next($event.keyCode)" |
313 | ng-focus="focus(10)" | 361 | ng-focus="focus(10)" |
314 | foca-focus="focused == 10" | 362 | foca-focus="focused == 10" |
315 | teclado-virtual> | 363 | teclado-virtual> |
316 | </div> | 364 | </div> |
317 | </div> | 365 | </div> |
318 | <div class="col-md-6 col-12"> | 366 | <div class="col-md-6 col-12"> |
319 | <label>Telefono</label> | 367 | <label>Telefono</label> |
320 | <div class="input-group"> | 368 | <div class="input-group"> |
321 | <input | 369 | <input |
322 | type="text" | 370 | foca-tipo-input |
371 | limite-numeros-max="20" | ||
323 | class="form-control form-control-sm" | 372 | class="form-control form-control-sm" |
324 | placeholder="Ingrese Telefono" | 373 | placeholder="Ingrese Telefono" |
325 | ng-model="cliente.TEL" | 374 | ng-model="cliente.TEL" |
326 | ng-required="true" | 375 | ng-required="true" |
327 | ng-keypress="next($event.keyCode)" | 376 | ng-keypress="next($event.keyCode)" |
328 | ng-focus="focus(11)" | 377 | ng-focus="focus(11)" |
329 | foca-focus="focused == 11" | 378 | foca-focus="focused == 11" |
330 | teclado-virtual> | 379 | teclado-virtual> |
331 | </div> | 380 | </div> |
332 | </div> | 381 | </div> |
333 | </div> | 382 | </div> |
334 | <div class="row"> | 383 | <div class="row"> |
335 | <div class="col-6 d-flex"> | 384 | <div class="col-6 d-flex"> |
336 | <div class="custom-control custom-checkbox mt-auto"> | 385 | <div class="custom-control custom-checkbox mt-auto"> |
337 | <input | 386 | <input |
338 | type="checkbox" | 387 | type="checkbox" |
339 | class="custom-control-input" | 388 | class="custom-control-input" |
340 | id="checkDistribuidor" | 389 | id="checkDistribuidor" |
341 | ng-model="cliente.ES_MAY" | 390 | ng-model="cliente.ES_MAY" |
342 | checked | 391 | checked |
343 | disabled="disabled"> | 392 | disabled="disabled"> |
344 | <label class="custom-control-label" for="checkDistribuidor">¿Este cliente es distribuidor?</label> | 393 | <label class="custom-control-label" for="checkDistribuidor">¿Este cliente es distribuidor?</label> |
345 | </div> | 394 | </div> |
346 | </div> | 395 | </div> |
347 | </div> | 396 | </div> |
348 | </uib-tab> | 397 | </uib-tab> |
349 | <uib-tab heading="Datos impositivos"> | 398 | <uib-tab heading="Datos impositivos"> |
350 | <div class="row"> | 399 | <div class="row"> |
351 | <div class="col-md-7 col-12"> | 400 | <div class="col-md-7 col-12"> |
352 | <label>Responsabilidad ante el IVA</label> | 401 | <label>Responsabilidad ante el IVA</label> |
353 | <div class="input-group"> | 402 | <div class="input-group"> |
354 | <input | 403 | <input |
355 | type="text" | 404 | type="text" |
356 | class="form-control form-control-sm" | 405 | class="form-control form-control-sm" |
357 | placeholder="Seleccione responsabilidad ante el IVA" | 406 | placeholder="Seleccione responsabilidad ante el IVA" |
358 | ng-model="cliente.iva.NOMBRE" | 407 | ng-model="cliente.iva.NOMBRE" |
359 | ng-keypress="seleccionarIva($event.keyCode)" | 408 | ng-keypress="seleccionarIva($event.keyCode)" |
360 | ng-required="true" | 409 | ng-required="true" |
361 | ng-focus="focus(12)" | 410 | ng-focus="focus(12)" |
362 | foca-focus="focused == 12" | 411 | foca-focus="focused == 12" |
363 | teclado-virtual | 412 | teclado-virtual |
364 | /> | 413 | /> |
414 | <button | ||
415 | ng-show="cliente.iva.NOMBRE.length >= 1" | ||
416 | type="button" | ||
417 | class="clear-input" | ||
418 | ng-click="cliente.iva.NOMBRE = ''" | ||
419 | > | ||
420 | <i class="fa fa-times"></i> | ||
421 | </button> | ||
365 | <div class="input-group-append"> | 422 | <div class="input-group-append"> |
366 | <button | 423 | <button |
367 | ladda="searchLoading" | 424 | ladda="searchLoading" |
368 | class="btn btn-outline-secondary form-control-sm" | 425 | class="btn btn-outline-secondary" |
369 | type="button" | 426 | type="button" |
370 | ng-click="seleccionarIva(13)" | 427 | ng-click="seleccionarIva(13)" |
371 | > | 428 | > |
372 | <i class="fa fa-search" aria-hidden="true"></i> | 429 | <i class="fa fa-search" aria-hidden="true"></i> |
373 | </button> | 430 | </button> |
374 | </div> | 431 | </div> |
375 | </div> | 432 | </div> |
376 | </div> | 433 | </div> |
377 | <div class="col-md-5 col-12"> | 434 | <div class="col-md-5 col-12"> |
378 | <label>Factura que emite</label> | 435 | <label>Factura que emite</label> |
379 | <div class="input-group"> | 436 | <div class="input-group"> |
380 | <input | 437 | <input |
381 | type="text" | 438 | type="text" |
382 | class="form-control form-control-sm" | 439 | class="form-control form-control-sm" |
383 | placeholder="Seleccione factura que emite" | 440 | placeholder="Seleccione factura que emite" |
384 | ng-model="cliente.tipoFactura.NOMBRE" | 441 | ng-model="cliente.tipoFactura.NOMBRE" |
385 | ng-required="true" | 442 | ng-required="true" |
386 | ng-keypress="seleccionarTipoFactura(13)" | 443 | ng-keypress="seleccionarTipoFactura(13)" |
387 | ng-focus="focus(13)" | 444 | ng-focus="focus(13)" |
388 | foca-focus="focused == 13" | 445 | foca-focus="focused == 13" |
389 | teclado-virtual> | 446 | teclado-virtual> |
447 | <button | ||
448 | ng-show="cliente.tipoFactura.NOMBRE.length >= 1" | ||
449 | type="button" | ||
450 | class="clear-input" | ||
451 | ng-click="cliente.tipoFactura.NOMBRE = ''" | ||
452 | > | ||
453 | <i class="fa fa-times"></i> | ||
454 | </button> | ||
390 | <div class="input-group-append"> | 455 | <div class="input-group-append"> |
391 | <button | 456 | <button |
392 | ladda="searchLoading" | 457 | ladda="searchLoading" |
393 | class="btn btn-outline-secondary form-control-sm" | 458 | class="btn btn-outline-secondary" |
394 | type="button" | 459 | type="button" |
395 | ng-click="seleccionarTipoFactura(13)" | 460 | ng-click="seleccionarTipoFactura(13)" |
396 | > | 461 | > |
397 | <i class="fa fa-search" aria-hidden="true"></i> | 462 | <i class="fa fa-search" aria-hidden="true"></i> |
398 | </button> | 463 | </button> |
399 | </div> | 464 | </div> |
400 | </div> | 465 | </div> |
401 | </div> | 466 | </div> |
402 | </div> | 467 | </div> |
403 | 468 | ||
404 | <div class="row"> | 469 | <div class="row"> |
405 | <div class= "col-md-4 col-12"> | 470 | <div class= "col-md-4 col-12"> |
406 | <label>CUIT</label> | 471 | <label>CUIT</label> |
407 | <div class="d-flex"> | 472 | <div class="d-flex"> |
408 | <input | 473 | <input |
409 | type="text" | 474 | type="text" |
410 | class="form-control form-control-sm col-2" | 475 | class="form-control form-control-sm col-2" |
411 | maxlength="2" | 476 | limite-numeros-max="2" |
412 | ng-model="cliente.cuit1" | 477 | ng-model="cliente.cuit1" |
413 | ng-required="true" | 478 | ng-required="true" |
414 | ng-keypress="pasarCampoCuit(1)" | 479 | ng-keypress="pasarCampoCuit(1)" |
415 | ng-focus="focus(14)" | 480 | ng-focus="focus(14)" |
416 | foca-focus="focused == 14" | 481 | foca-focus="focused == 14" |
417 | teclado-virtual | 482 | teclado-virtual |
418 | > | 483 | > |
419 | <span class="m-1"> - </span> | 484 | <span class="m-1"> - </span> |
420 | <input | 485 | <input |
421 | type="text" | 486 | type="text" |
422 | class="form-control form-control-sm col-5" | 487 | class="form-control form-control-sm col-5" |
423 | maxlength="8" | 488 | maxlength="8" |
489 | limite-numeros-max="8" | ||
424 | ng-keypress="pasarCampoCuit(2)" | 490 | ng-keypress="pasarCampoCuit(2)" |
425 | ng-model="cliente.cuit2" | 491 | ng-model="cliente.cuit2" |
426 | ng-required="true" | 492 | ng-required="true" |
427 | ng-focus="focus(15)" | 493 | ng-focus="focus(15)" |
428 | foca-focus="cuitActivo == 2 || focused == 15" | 494 | foca-focus="cuitActivo == 2 || focused == 15" |
429 | teclado-virtual | 495 | teclado-virtual |
430 | > | 496 | > |
431 | <span class="m-1"> - </span> | 497 | <span class="m-1"> - </span> |
432 | <input | 498 | <input |
433 | type="text" | 499 | type="text" |
434 | class="form-control form-control-sm col-2" | 500 | class="form-control form-control-sm col-2" |
435 | maxlength="1" | 501 | maxlength="1" |
502 | limite-numeros-max="1" | ||
436 | ng-keypress="pasarCampoCuit(3)" | 503 | ng-keypress="pasarCampoCuit(3)" |
437 | ng-model="cliente.cuit3" | 504 | ng-model="cliente.cuit3" |
438 | ng-required="true" | 505 | ng-required="true" |
439 | ng-focus="focus(16)" | 506 | ng-focus="focus(16)" |
440 | foca-focus="cuitActivo == 3 || focused == 16" | 507 | foca-focus="cuitActivo == 3 || focused == 16" |
441 | teclado-virtual | 508 | teclado-virtual |
442 | > | 509 | > |
443 | </div> | 510 | </div> |
444 | </div> | 511 | </div> |
445 | <div class="col-md-4 col-12"> | 512 | <div class="col-md-4 col-12"> |
446 | <label>Clase de comprobante</label> | 513 | <label>Clase de comprobante</label> |
447 | <div class="input-group"> | 514 | <div class="input-group"> |
448 | <input | 515 | <input |
449 | type="text" | 516 | type="text" |
450 | class="form-control form-control-sm" | 517 | class="form-control form-control-sm" |
451 | placeholder="Seleccione clase de comprobante" | 518 | placeholder="Seleccione clase de comprobante" |
452 | ng-keypress="seleccionarTipoComprobante($event.keyCode)" | 519 | ng-keypress="seleccionarTipoComprobante($event.keyCode)" |
453 | ng-model="cliente.tipoComprobante.NOMBRE" | 520 | ng-model="cliente.tipoComprobante.NOMBRE" |
454 | ng-required="true" | 521 | ng-required="true" |
455 | ng-focus="focus(17)" | 522 | ng-focus="focus(17)" |
456 | foca-focus="focused == 17" | 523 | foca-focus="focused == 17" |
457 | teclado-virtual> | 524 | teclado-virtual> |
525 | <button | ||
526 | ng-show="cliente.tipoComprobante.NOMBRE.length >= 1" | ||
527 | type="button" | ||
528 | class="clear-input" | ||
529 | ng-click="cliente.tipoComprobante.NOMBRE = ''" | ||
530 | > | ||
531 | <i class="fa fa-times"></i> | ||
532 | </button> | ||
458 | <div class="input-group-append"> | 533 | <div class="input-group-append"> |
459 | <button | 534 | <button |
460 | ladda="searchLoading" | 535 | ladda="searchLoading" |
461 | class="btn btn-outline-secondary form-control-sm" | 536 | class="btn btn-outline-secondary" |
462 | type="button" | 537 | type="button" |
463 | ng-click="seleccionarTipoComprobante(13)" | 538 | ng-click="seleccionarTipoComprobante(13)" |
464 | > | 539 | > |
465 | <i class="fa fa-search" aria-hidden="true"></i> | 540 | <i class="fa fa-search" aria-hidden="true"></i> |
466 | </button> | 541 | </button> |
467 | </div> | 542 | </div> |
468 | </div> | 543 | </div> |
469 | </div> | 544 | </div> |
470 | <div class="col-md-4 col-12"> | 545 | <div class="col-md-4 col-12"> |
471 | <label>Forma de pago</label> | 546 | <label>Forma de pago</label> |
472 | <div class="input-group"> | 547 | <div class="input-group"> |
473 | <input | 548 | <input |
474 | type="text" | 549 | type="text" |
475 | class="form-control form-control-sm" | 550 | class="form-control form-control-sm" |
476 | placeholder="Seleccione forma de pago" | 551 | placeholder="Seleccione forma de pago" |
477 | ng-model="cliente.formaPago.NOMBRE" | 552 | ng-model="cliente.formaPago.NOMBRE" |
478 | ng-required="true" | 553 | ng-required="true" |
479 | ng-keypress="seleccionarFormaPago($event.keyCode)" | 554 | ng-keypress="seleccionarFormaPago($event.keyCode)" |
480 | ng-focus="focus(18)" | 555 | ng-focus="focus(18)" |
481 | foca-focus="focused == 18" | 556 | foca-focus="focused == 18" |
482 | teclado-virtual> | 557 | teclado-virtual> |
558 | <button | ||
559 | ng-show="cliente.formaPago.NOMBRE.length >= 1" | ||
560 | type="button" | ||
561 | class="clear-input" | ||
562 | ng-click="cliente.formaPago.NOMBRE = ''" | ||
563 | > | ||
564 | <i class="fa fa-times"></i> | ||
565 | </button> | ||
483 | <div class="input-group-append"> | 566 | <div class="input-group-append"> |
484 | <button | 567 | <button |
485 | ladda="searchLoading" | 568 | ladda="searchLoading" |
486 | class="btn btn-outline-secondary form-control-sm" | 569 | class="btn btn-outline-secondary" |
487 | type="button" | 570 | type="button" |
488 | ng-click="seleccionarFormaPago(13)" | 571 | ng-click="seleccionarFormaPago(13)" |
489 | > | 572 | > |
490 | <i class="fa fa-search" aria-hidden="true"></i> | 573 | <i class="fa fa-search" aria-hidden="true"></i> |
491 | </button> | 574 | </button> |
492 | </div> | 575 | </div> |
493 | </div> | 576 | </div> |
494 | </div> | 577 | </div> |
495 | </div> | 578 | </div> |
496 | </uib-tab> | 579 | </uib-tab> |
497 | </uib-tabset> | 580 | </uib-tabset> |
498 | </form> | 581 | </form> |
499 | </div> | 582 | </div> |
500 | <div class="modal-footer py-1"> | 583 | <div class="modal-footer py-1"> |
501 | <nav ng-show="currentPageClientes.length > 0 && primerBusqueda && !ingreso" class="mr-auto"> | 584 | <nav ng-show="currentPageClientes.length > 0 && primerBusqueda && !ingreso" class="mr-auto"> |
502 | <ul class="pagination pagination-sm mb-0"> | 585 | <ul class="pagination pagination-sm mb-0"> |
503 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> | 586 | <li class="page-item" ng-class="{'disabled': currentPage == 1}"> |
504 | <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage - 1)"> | 587 | <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage - 1)"> |
505 | <span aria-hidden="true">«</span> | 588 | <span aria-hidden="true">«</span> |
506 | <span class="sr-only">Anterior</span> | 589 | <span class="sr-only">Anterior</span> |
507 | </a> | 590 | </a> |
508 | </li> | 591 | </li> |
509 | <li | 592 | <li |
510 | class="page-item" | 593 | class="page-item" |
511 | ng-repeat="pagina in paginas" | 594 | ng-repeat="pagina in paginas" |
512 | ng-class="{'active': pagina == currentPage}" | 595 | ng-class="{'active': pagina == currentPage}" |
513 | > | 596 | > |
514 | <a | 597 | <a |
515 | class="page-link" | 598 | class="page-link" |
516 | href="javascript:void()" | 599 | href="javascript:void()" |
517 | ng-click="selectPage(pagina)" | 600 | ng-click="selectPage(pagina)" |
518 | ng-bind="pagina" | 601 | ng-bind="pagina" |
519 | ></a> | 602 | ></a> |
520 | </li> | 603 | </li> |
521 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> | 604 | <li class="page-item" ng-class="{'disabled': currentPage == lastPage}"> |
522 | <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage + 1)"> | 605 | <a class="page-link" href="javascript:void()" ng-click="selectPage(currentPage + 1)"> |
523 | <span aria-hidden="true">»</span> | 606 | <span aria-hidden="true">»</span> |
524 | <span class="sr-only">Siguiente</span> | 607 | <span class="sr-only">Siguiente</span> |
525 | </a> | 608 | </a> |
526 | </li> | 609 | </li> |
527 | </ul> | 610 | </ul> |
528 | </nav> | 611 | </nav> |
529 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> | 612 | <button class="btn btn-sm btn-secondary" type="button" ng-click="cancel()">Cancelar</button> |
530 | <button | 613 | <button |
531 | class="btn btn-sm btn-primary" | 614 | class="btn btn-sm btn-primary" |
532 | type="button" | 615 | type="button" |
533 | ng-show="ingreso" | 616 | ng-show="ingreso" |
534 | ng-click="guardar()" | 617 | ng-click="guardar()" |
535 | >Guardar</button> | 618 | >Guardar</button> |
536 | </div> | 619 | </div> |
537 | 620 |