Commit c975705d1cc84dce86c8bb296792546c9c234d7c
1 parent
e8c0136f61
Exists in
master
campo cobrador alta clientes
Showing
2 changed files
with
65 additions
and
14 deletions
Show diff stats
src/js/controller.js
| ... | ... | @@ -44,6 +44,9 @@ angular.module('focaBusquedaCliente') |
| 44 | 44 | }, |
| 45 | 45 | formaPago: { |
| 46 | 46 | NOMBRE: '' |
| 47 | + }, | |
| 48 | + cobrador: { | |
| 49 | + NomVen: '' | |
| 47 | 50 | } |
| 48 | 51 | }; |
| 49 | 52 | |
| ... | ... | @@ -213,7 +216,7 @@ angular.module('focaBusquedaCliente') |
| 213 | 216 | function(iva) { |
| 214 | 217 | $scope.cliente.iva = iva; |
| 215 | 218 | $timeout(function() { |
| 216 | - $scope.focused = 9; | |
| 219 | + $scope.focused = 10; | |
| 217 | 220 | }); |
| 218 | 221 | }, function() { |
| 219 | 222 | // funcion ejecutada cuando se cancela el modal |
| ... | ... | @@ -231,6 +234,9 @@ angular.module('focaBusquedaCliente') |
| 231 | 234 | focaModalService.modal(columnas, query, titulo, 'md').then( |
| 232 | 235 | function(actividad) { |
| 233 | 236 | $scope.cliente.actividad = actividad; |
| 237 | + $timeout(function() { | |
| 238 | + $scope.focused = 8; | |
| 239 | + }); | |
| 234 | 240 | }, function() { |
| 235 | 241 | // funcion ejecutada cuando se cancela el modal |
| 236 | 242 | }); |
| ... | ... | @@ -267,7 +273,7 @@ angular.module('focaBusquedaCliente') |
| 267 | 273 | function(tipoFactura) { |
| 268 | 274 | $scope.cliente.tipoFactura = tipoFactura; |
| 269 | 275 | $timeout(function() { |
| 270 | - $scope.focused = 10; | |
| 276 | + $scope.focused = 11; | |
| 271 | 277 | }); |
| 272 | 278 | }, function() { |
| 273 | 279 | // funcion ejecutada cuando se cancela el modal |
| ... | ... | @@ -286,7 +292,7 @@ angular.module('focaBusquedaCliente') |
| 286 | 292 | function(tipoComprobante) { |
| 287 | 293 | $scope.cliente.tipoComprobante = tipoComprobante; |
| 288 | 294 | $timeout(function() { |
| 289 | - $scope.focused = 12; | |
| 295 | + $scope.focused = 13; | |
| 290 | 296 | }); |
| 291 | 297 | }, function() { |
| 292 | 298 | // funcion ejecutada cuando se cancela el modal |
| ... | ... | @@ -309,6 +315,22 @@ angular.module('focaBusquedaCliente') |
| 309 | 315 | }); |
| 310 | 316 | } |
| 311 | 317 | }; |
| 318 | + $scope.seleccionarCobrador = function(key) { | |
| 319 | + if(key === 13) { | |
| 320 | + var query = '/cobrador'; | |
| 321 | + var columnas = { | |
| 322 | + nombre: ['Código', 'Nombre'], | |
| 323 | + propiedad: ['CodVen', 'NomVen',] | |
| 324 | + }; | |
| 325 | + var titulo = 'Búsqueda de cobradores'; | |
| 326 | + focaModalService.modal(columnas, query, titulo, 'md').then( | |
| 327 | + function(cobrador) { | |
| 328 | + $scope.cliente.cobrador = cobrador; | |
| 329 | + }, function() { | |
| 330 | + // funcion ejecutada cuando se cancela el modal | |
| 331 | + }); | |
| 332 | + } | |
| 333 | + }; | |
| 312 | 334 | |
| 313 | 335 | $scope.guardar = function() { |
| 314 | 336 | |
| ... | ... | @@ -321,6 +343,7 @@ angular.module('focaBusquedaCliente') |
| 321 | 343 | $scope.cliente.TCO = $scope.cliente.tipoComprobante.ID; |
| 322 | 344 | $scope.cliente.FPA = $scope.cliente.formaPago.ID; |
| 323 | 345 | $scope.cliente.VEN = $scope.vendedor.CodVen; |
| 346 | + $scope.cliente.idCobrador = $scope.cliente.cobrador.CodVen; | |
| 324 | 347 | |
| 325 | 348 | delete $scope.cliente.provincia; |
| 326 | 349 | delete $scope.cliente.localidad; |
| ... | ... | @@ -330,6 +353,7 @@ angular.module('focaBusquedaCliente') |
| 330 | 353 | delete $scope.cliente.tipoFactura; |
| 331 | 354 | delete $scope.cliente.tipoComprobante; |
| 332 | 355 | delete $scope.cliente.formaPago; |
| 356 | + delete $scope.cliente.cobrador; | |
| 333 | 357 | |
| 334 | 358 | focaBusquedaClienteService |
| 335 | 359 | .guardarCliente($scope.cliente) |
src/views/foca-busqueda-cliente-modal.html
| ... | ... | @@ -99,7 +99,7 @@ |
| 99 | 99 | |
| 100 | 100 | <form name="formCliente"> |
| 101 | 101 | <uib-tabset class="tabs-right" ng-show="ingreso"> |
| 102 | - <uib-tab heading="Datos clientes"> | |
| 102 | + <uib-tab heading="Datos cliente"> | |
| 103 | 103 | <div class="row"> |
| 104 | 104 | <div class="col-3"> |
| 105 | 105 | <label>Código</label> |
| ... | ... | @@ -265,6 +265,31 @@ |
| 265 | 265 | </div> |
| 266 | 266 | <div class="row"> |
| 267 | 267 | <div class="col-md-6 col-12"> |
| 268 | + <label>Cobrador</label> | |
| 269 | + <div class="input-group"> | |
| 270 | + <input | |
| 271 | + type="text" | |
| 272 | + class="form-control form-control-sm" | |
| 273 | + ng-model="cliente.cobrador.NomVen" | |
| 274 | + ng-keypress="seleccionarCobrador($event.keyCode)" | |
| 275 | + placeholder="Ingrese cobrador" | |
| 276 | + ng-focus="focus(8)" | |
| 277 | + foca-focus="focused == 8" | |
| 278 | + teclado-virtual | |
| 279 | + /> | |
| 280 | + <div class="input-group-append"> | |
| 281 | + <button | |
| 282 | + ladda="searchLoading" | |
| 283 | + class="btn btn-outline-secondary form-control-sm" | |
| 284 | + type="button" | |
| 285 | + ng-click="seleccionarCobrador(13)" | |
| 286 | + > | |
| 287 | + <i class="fa fa-search" aria-hidden="true"></i> | |
| 288 | + </button> | |
| 289 | + </div> | |
| 290 | + </div> | |
| 291 | + </div> | |
| 292 | + <div class="col-md-6 col-12"> | |
| 268 | 293 | <label>Vendedor</label> |
| 269 | 294 | <div class="input-group"> |
| 270 | 295 | <input |
| ... | ... | @@ -275,6 +300,8 @@ |
| 275 | 300 | /> |
| 276 | 301 | </div> |
| 277 | 302 | </div> |
| 303 | + </div> | |
| 304 | + <div class="row"> | |
| 278 | 305 | <div class="col-6 d-flex"> |
| 279 | 306 | <div class="custom-control custom-checkbox mt-auto"> |
| 280 | 307 | <input |
| ... | ... | @@ -300,8 +327,8 @@ |
| 300 | 327 | ng-model="cliente.iva.NOMBRE" |
| 301 | 328 | ng-keypress="seleccionarIva($event.keyCode)" |
| 302 | 329 | ng-required="true" |
| 303 | - ng-focus="focus(8)" | |
| 304 | - foca-focus="focused == 8" | |
| 330 | + ng-focus="focus(9)" | |
| 331 | + foca-focus="focused == 9" | |
| 305 | 332 | teclado-virtual |
| 306 | 333 | /> |
| 307 | 334 | <div class="input-group-append"> |
| ... | ... | @@ -326,8 +353,8 @@ |
| 326 | 353 | ng-model="cliente.tipoFactura.NOMBRE" |
| 327 | 354 | ng-required="true" |
| 328 | 355 | ng-keypress="seleccionarTipoFactura(13)" |
| 329 | - ng-focus="focus(9)" | |
| 330 | - foca-focus="focused == 9" | |
| 356 | + ng-focus="focus(10)" | |
| 357 | + foca-focus="focused == 10" | |
| 331 | 358 | teclado-virtual> |
| 332 | 359 | <div class="input-group-append"> |
| 333 | 360 | <button |
| ... | ... | @@ -355,8 +382,8 @@ |
| 355 | 382 | ng-pattern="regexCuit" |
| 356 | 383 | ng-maxlength="13" |
| 357 | 384 | ng-keypress="next($event.keyCode)" |
| 358 | - ng-focus="focus(10)" | |
| 359 | - foca-focus="focused == 10" | |
| 385 | + ng-focus="focus(11)" | |
| 386 | + foca-focus="focused == 11" | |
| 360 | 387 | teclado-virtual> |
| 361 | 388 | </div> |
| 362 | 389 | </div> |
| ... | ... | @@ -370,8 +397,8 @@ |
| 370 | 397 | ng-keypress="seleccionarTipoComprobante($event.keyCode)" |
| 371 | 398 | ng-model="cliente.tipoComprobante.NOMBRE" |
| 372 | 399 | ng-required="true" |
| 373 | - ng-focus="focus(11)" | |
| 374 | - foca-focus="focused == 11" | |
| 400 | + ng-focus="focus(12)" | |
| 401 | + foca-focus="focused == 12" | |
| 375 | 402 | teclado-virtual> |
| 376 | 403 | <div class="input-group-append"> |
| 377 | 404 | <button |
| ... | ... | @@ -395,8 +422,8 @@ |
| 395 | 422 | ng-model="cliente.formaPago.NOMBRE" |
| 396 | 423 | ng-required="true" |
| 397 | 424 | ng-keypress="seleccionarFormaPago($event.keyCode)" |
| 398 | - ng-focus="focus(12)" | |
| 399 | - foca-focus="focused == 12" | |
| 425 | + ng-focus="focus(13)" | |
| 426 | + foca-focus="focused == 13" | |
| 400 | 427 | teclado-virtual> |
| 401 | 428 | <div class="input-group-append"> |
| 402 | 429 | <button |