Commit ee56d2f57942cf8664789690b8705e51318f7801

Authored by Eric
1 parent e22a685b3d
Exists in master and in 1 other branch develop

hoja de ruta2

Showing 2 changed files with 87 additions and 0 deletions   Show diff stats
src/js/controller.js
... ... @@ -444,6 +444,68 @@ angular.module('focaParametros')
444 444  
445 445 };
446 446  
  447 + $scope.seleccionarTarifario = function() {
  448 +
  449 + focaModalService
  450 + .prompt({
  451 + titulo: 'Tarifa flete',
  452 + value: $scope[getModulo()].tarifario
  453 + })
  454 + .then(function(costo) {
  455 + if (isNaN(costo)) {
  456 + focaModalService
  457 + .alert('Ingrese un valor válido')
  458 + .then(function() {
  459 + $scope.seleccionarTarifario();
  460 + });
  461 +
  462 + return;
  463 + }
  464 +
  465 + $scope[getModulo()].tarifario = costo;
  466 +
  467 + $scope.$broadcast('addCabecera', {
  468 + label: 'Tarifario:',
  469 + valor: costo,
  470 + seccion: getModulo('label')
  471 + });
  472 + });
  473 + };
  474 +
  475 + $scope.seleccionarTransportista = function() {
  476 +
  477 + var parametrosModal = {
  478 + titulo: 'Búsqueda de transportista',
  479 + query: '/transportista/no-relacion',
  480 + columnas: [
  481 + {
  482 + nombre: 'Código',
  483 + propiedad: 'COD'
  484 + },
  485 + {
  486 + nombre: 'Nombre',
  487 + propiedad: 'NOM'
  488 + },
  489 + {
  490 + nombre: 'CUIT',
  491 + propiedad: 'CUIT'
  492 + }
  493 + ]
  494 + };
  495 + focaModalService.modal(parametrosModal).then(
  496 + function(proveedor) {
  497 + $scope[getModulo()].transportista = proveedor;
  498 + $scope.$broadcast('addCabecera', {
  499 + label: 'Transportista:',
  500 + seccion: getModulo('label'),
  501 + valor: $filter('rellenarDigitos')(proveedor.COD, 5) + ' - ' +
  502 + proveedor.NOM
  503 + });
  504 + }, function() {
  505 + }
  506 + );
  507 + };
  508 +
447 509 $scope.$watch('botonera', function() {
448 510  
449 511 // Creo el string en donde guardo el objeto parseado
... ... @@ -662,6 +724,13 @@ angular.module('focaParametros')
662 724 });
663 725 }
664 726  
  727 + if ($scope[entidad.modulo].tarifario) {
  728 + cabeceras.push({
  729 + label: 'Tarifario',
  730 + valor: $scope[entidad.modulo].tarifario
  731 + });
  732 + }
  733 +
665 734 addArrayCabecera(cabeceras, entidad.modulo);
666 735  
667 736 }
... ... @@ -68,6 +68,18 @@ angular.module('focaParametros')
68 68 image: 'botonObservaciones.png',
69 69 variable: 'observaciones',
70 70 modulo: [1]
  71 + },
  72 + {
  73 + label: 'Transportista',
  74 + image: 'proveedor.png',
  75 + variable: 'transportista',
  76 + modulo: [3]
  77 + },
  78 + {
  79 + label: 'Tarifario',
  80 + image: 'tarifario.png',
  81 + variable: 'tarifario',
  82 + modulo: [3]
71 83 }
72 84 ];
73 85  
... ... @@ -89,6 +101,12 @@ angular.module('focaParametros')
89 101 image: 'remito.png',
90 102 modulo: 2,
91 103 variable: 'remito'
  104 + },
  105 + {
  106 + label: 'Hoja ruta',
  107 + image: 'hoja-ruta.png',
  108 + modulo: 3,
  109 + variable: 'hojaRuta'
92 110 }
93 111 ]
94 112 };