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