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