Commit 2aeb5fc11ddc627bc6001fc16c5f6b12f3996226

Authored by Luigi
1 parent c4b114ffad
Exists in master and in 1 other branch develop

Seleccion de IVA segun sus tipo Factura

src/js/controller.js
... ... @@ -324,30 +324,67 @@ angular.module('focaBusquedaCliente')
324 324 };
325 325 $scope.seleccionarTipoFactura = function(key) {
326 326 if (key === 13) {
327   - var parametrosModal = {
328   - query: '/tipo-factura',
329   - columnas: [
  327 + if ($scope.cliente.iva.ID == 1) {
  328 + var datos = [
330 329 {
331   - propiedad: 'ID',
332   - nombre: 'Código'
  330 + id: 'A',
  331 + nombre: 'Factura A'
333 332 },
334 333 {
335   - propiedad: 'NOMBRE',
336   - nombre: 'Nombre'
  334 + id: 'M',
  335 + nombre: 'Factura M'
  336 + },
  337 + {
  338 + id: 'R',
  339 + nombre: 'Remito'
337 340 }
338   - ],
339   - titulo: 'Búsqueda de tipos de factura',
340   - size: 'md'
341   - };
342   - focaModalService.modal(parametrosModal).then(
343   - function(tipoFactura) {
344   - $scope.cliente.tipoFactura = tipoFactura;
345   - $timeout(function() {
346   - $scope.focused = 13;
347   - });
348   - }, function() {
349   - // funcion ejecutada cuando se cancela el modal
  341 + ];
  342 + focaModalService.modal({
  343 + titulo: 'Seleccionar Factura',
  344 + data: datos,
  345 + size: 'md',
  346 + columnas: [
  347 + {
  348 + propiedad: 'id',
  349 + nombre: 'Codigo'
  350 + },
  351 + {
  352 + propiedad: 'nombre',
  353 + nombre: 'Factura'
  354 + }
  355 + ],
  356 + }).then(function(res) {
  357 + $scope.cliente.tipoFactura.NOMBRE = res.nombre;
  358 + });
  359 + } else if ($scope.cliente.iva.ID == 3 || $scope.cliente.iva.ID == 4 || $scope.cliente.iva.ID == 5) {
  360 + var datos2 = [
  361 + {
  362 + id: 'B',
  363 + nombre: 'Factura B'
  364 + },
  365 + {
  366 + id: 'R',
  367 + nombre: 'Remito'
  368 + }
  369 + ];
  370 + focaModalService.modal({
  371 + titulo: 'Seleccionar Factura',
  372 + data: datos2,
  373 + size: 'md',
  374 + columnas: [
  375 + {
  376 + propiedad: 'id',
  377 + nombre: 'Codigo'
  378 + },
  379 + {
  380 + propiedad: 'nombre',
  381 + nombre: 'Factura'
  382 + }
  383 + ],
  384 + }).then(function(res) {
  385 + $scope.cliente.tipoFactura.NOMBRE = res.nombre;
350 386 });
  387 + }
351 388 }
352 389 };
353 390 $scope.seleccionarTipoComprobante = function(key) {
... ... @@ -442,7 +479,6 @@ angular.module('focaBusquedaCliente')
442 479 };
443 480  
444 481 $scope.guardar = function() {
445   -
446 482 if (!$scope.cliente.NOM) {
447 483 focaModalService.alert('Ingrese Nombre');
448 484 return;
src/views/foca-busqueda-cliente-modal.html
... ... @@ -354,7 +354,7 @@
354 354 <input
355 355 type="text"
356 356 class="form-control form-control-sm"
357   - placeholder="Ingrese responsabilidad ante el IVA"
  357 + placeholder="Seleccione responsabilidad ante el IVA"
358 358 ng-model="cliente.iva.NOMBRE"
359 359 ng-keypress="seleccionarIva($event.keyCode)"
360 360 ng-required="true"
... ... @@ -380,7 +380,7 @@
380 380 <input
381 381 type="text"
382 382 class="form-control form-control-sm"
383   - placeholder="Ingrese factura que emite"
  383 + placeholder="Seleccione factura que emite"
384 384 ng-model="cliente.tipoFactura.NOMBRE"
385 385 ng-required="true"
386 386 ng-keypress="seleccionarTipoFactura(13)"