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