From ee56d2f57942cf8664789690b8705e51318f7801 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 6 May 2019 18:38:28 -0300 Subject: [PATCH] hoja de ruta2 --- src/js/controller.js | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/js/service.js | 18 ++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/src/js/controller.js b/src/js/controller.js index 0b34020..2cd347b 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -444,6 +444,68 @@ angular.module('focaParametros') }; + $scope.seleccionarTarifario = function() { + + focaModalService + .prompt({ + titulo: 'Tarifa flete', + value: $scope[getModulo()].tarifario + }) + .then(function(costo) { + if (isNaN(costo)) { + focaModalService + .alert('Ingrese un valor válido') + .then(function() { + $scope.seleccionarTarifario(); + }); + + return; + } + + $scope[getModulo()].tarifario = costo; + + $scope.$broadcast('addCabecera', { + label: 'Tarifario:', + valor: costo, + seccion: getModulo('label') + }); + }); + }; + + $scope.seleccionarTransportista = function() { + + var parametrosModal = { + titulo: 'Búsqueda de transportista', + query: '/transportista/no-relacion', + columnas: [ + { + nombre: 'Código', + propiedad: 'COD' + }, + { + nombre: 'Nombre', + propiedad: 'NOM' + }, + { + nombre: 'CUIT', + propiedad: 'CUIT' + } + ] + }; + focaModalService.modal(parametrosModal).then( + function(proveedor) { + $scope[getModulo()].transportista = proveedor; + $scope.$broadcast('addCabecera', { + label: 'Transportista:', + seccion: getModulo('label'), + valor: $filter('rellenarDigitos')(proveedor.COD, 5) + ' - ' + + proveedor.NOM + }); + }, function() { + } + ); + }; + $scope.$watch('botonera', function() { // Creo el string en donde guardo el objeto parseado @@ -662,6 +724,13 @@ angular.module('focaParametros') }); } + if ($scope[entidad.modulo].tarifario) { + cabeceras.push({ + label: 'Tarifario', + valor: $scope[entidad.modulo].tarifario + }); + } + addArrayCabecera(cabeceras, entidad.modulo); } diff --git a/src/js/service.js b/src/js/service.js index 20af063..49234fa 100644 --- a/src/js/service.js +++ b/src/js/service.js @@ -68,6 +68,18 @@ angular.module('focaParametros') image: 'botonObservaciones.png', variable: 'observaciones', modulo: [1] + }, + { + label: 'Transportista', + image: 'proveedor.png', + variable: 'transportista', + modulo: [3] + }, + { + label: 'Tarifario', + image: 'tarifario.png', + variable: 'tarifario', + modulo: [3] } ]; @@ -89,6 +101,12 @@ angular.module('focaParametros') image: 'remito.png', modulo: 2, variable: 'remito' + }, + { + label: 'Hoja ruta', + image: 'hoja-ruta.png', + modulo: 3, + variable: 'hojaRuta' } ] }; -- 1.9.1