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