From 5b708c27ef4fb29c86971c8e0f0f8854948df80e Mon Sep 17 00:00:00 2001 From: Frederico Palma Date: Mon, 26 Jan 2009 17:46:55 +0000 Subject: [PATCH] git-svn-id: https://svn.coded.pt/svn/SIPRP@924 bb69d46d-e84e-40c8-a05a-06db0d633741 --- .../print/PlanoActuacaoPrintDataProvider.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/trunk/SIPRPSoft/src/siprp/planoactuacao/print/PlanoActuacaoPrintDataProvider.java b/trunk/SIPRPSoft/src/siprp/planoactuacao/print/PlanoActuacaoPrintDataProvider.java index 3d9ceb7b..4a877713 100644 --- a/trunk/SIPRPSoft/src/siprp/planoactuacao/print/PlanoActuacaoPrintDataProvider.java +++ b/trunk/SIPRPSoft/src/siprp/planoactuacao/print/PlanoActuacaoPrintDataProvider.java @@ -57,6 +57,37 @@ public class PlanoActuacaoPrintDataProvider return instance; } + public boolean empresaUsaPlanoAlargadoPorPlanoId( Integer planoId ) + throws Exception + { + try + { + Select select = + new Select2( + new String[]{ "hs_relatorio", "marcacoes_estabelecimento", "estabelecimentos", "empresas" }, + new Integer[]{ Select2.JOIN_INNER, Select2.JOIN_INNER, Select2.JOIN_INNER }, + new Expression[]{ + new Field( "hs_relatorio.marcacao_id" ).isEqual( new Field( "marcacoes_estabelecimento.id" ) ), + new Field( "marcacoes_estabelecimento.estabelecimento_id" ).isEqual( new Field( "estabelecimentos.id" ) ), + new Field( "estabelecimentos.empresa_id" ).isEqual( new Field( "empresas.id" ) ) + }, + new String[]{ "imprimir_tabela_alargada" }, + new Field( "hs_relatorio.id" ).isEqual( planoId ), + null, + null, + null, + null ); + Virtual2DArray array = LOCAL_EXECUTER.executeQuery( select ); + + return ( ( Boolean ) array.get( 0, 0 ) ).booleanValue(); + } + catch( Exception ex ) + { + return true; + } + } + + public PlanoActuacaoToPrint getPlanoToPrint( Integer id ) throws Exception {