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