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