fixes bug#20983

qua:
dev:Valdevir

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@104947 d1611594-4594-4d17-8e1d-87c2c4800839
master
valdevir 2021-01-06 03:04:11 +00:00
parent e80faa13f4
commit 0e32a2dba8
4 changed files with 36 additions and 6 deletions

View File

@ -84,7 +84,7 @@ public class RelatorioLinhasHorarioSimplificado extends Relatorio {
Integer tipoServico = (Integer) parametros.get("TIPOSERVICIO_ID");
String sql = getSql(lsNumLinha, lsNumServico, empresa, tipoServico, grupoRuta);
String sql = getSql(lsNumLinha, lsNumServico, empresa, tipoServico, grupoRuta, (Boolean)parametros.get("ISSENTIDOIDA"), (Boolean)parametros.get("ISSENTIDOVOLTA"));
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
ResultSet rset = null;
@ -413,7 +413,7 @@ public class RelatorioLinhasHorarioSimplificado extends Relatorio {
protected void processaParametros() throws Exception {
}
private String getSql(ArrayList<Ruta> lsNumLinha, ArrayList<Corrida> lsNumServico, Empresa empresa, Integer tipoServico, GrupoRuta grupoRuta) {
private String getSql(ArrayList<Ruta> lsNumLinha, ArrayList<Corrida> lsNumServico, Empresa empresa, Integer tipoServico, GrupoRuta grupoRuta, Boolean isSentidoIda, Boolean isSentidoVolta) {
StringBuffer sql = new StringBuffer();
sql.append(" SELECT ");
@ -623,6 +623,14 @@ public class RelatorioLinhasHorarioSimplificado extends Relatorio {
}
sql.append(tipoServico > 0 ? " AND C.TIPOSERVICIO_ID = " + tipoServico + " " : "");
if(Boolean.TRUE.equals(isSentidoIda)) {
sql.append(" AND R.INDSENTIDOIDA =1 ");
}
if(Boolean.TRUE.equals(isSentidoVolta)) {
sql.append(" AND R.INDSENTIDOIDA = 0 ");
}
sql.append(" AND C.ACTIVO <> 0 AND ORIGEM.ACTIVO = 1 AND DESTINO.ACTIVO = 1 AND TB2.ORIGEM = ORIGEM.CVEPARADA AND TB2.DESTINO = DESTINO.CVEPARADA ");
sql.append("AND R.ACTIVO = 1 AND RO.ACTIVO = 1 AND DA.ACTIVO = 1 AND CS.ACTIVO = 1 ");

View File

@ -91,6 +91,8 @@ public class RelatorioLinhasHorarioController extends MyGenericForwardComposer {
private Checkbox chkSimplificado;
private Timebox horaInicial;
private Timebox horaFinal;
private Checkbox chkIndSentidoIda;
private Checkbox chkIndSentidoVolta;
@SuppressWarnings({ "unchecked", "rawtypes" })
private void executarRelatorio() throws Exception {
@ -167,6 +169,8 @@ public class RelatorioLinhasHorarioController extends MyGenericForwardComposer {
if(horaFinal.getValue()!= null){
parametros.put("HORA_FINAL", horaFinal.getValue());
}
parametros.put("ISSENTIDOIDA", chkIndSentidoIda.isChecked());
parametros.put("ISSENTIDOVOLTA", chkIndSentidoVolta.isChecked() );
relatorio = new RelatorioLinhasHorarioSimplificado(parametros, dataSourceRead.getConnection());
}

View File

@ -646,6 +646,8 @@ relatorioLinhasHorarioController.rdTodos.label = Todos
relatorioLinhasHorarioController.lblSimplificado.value = Emite relatório Simplificado
relatorioLinhasHorarioController.lbHoraSaidaInicial.value = Hora Saída
relatorioLinhasHorarioController.lbHoraSaidaFinal.value = à
relatorioLinhasHorarioController.chKIda.value = Linha Ida
relatorioLinhasHorarioController.chKVolta.value = Linha Volta
#Relatorio Trecho Vendido
relatorioTrechoVendidoController.lbDataIni.value = Data Inicial

View File

@ -12,10 +12,10 @@
<grid fixedLayout="true">
<columns>
<column width="13%" />
<column width="37%" />
<column width="13%" />
<column width="37%" />
<column width="12%" />
<column width="38%" />
<column width="12%" />
<column width="38%" />
</columns>
<rows>
@ -46,6 +46,22 @@
</attribute>
</timebox>
</row>
<row height="30px" >
<cell colspan="4">
<checkbox id="chkIndSentidoIda"
label="${c:l('relatorioLinhasHorarioController.chKIda.value')}" width="100px" >
<attribute name="onFocus">
chkIndSentidoVolta.setChecked(false);
</attribute>
</checkbox>
<checkbox id="chkIndSentidoVolta"
label="${c:l('relatorioLinhasHorarioController.chKVolta.value')}" width="100px" >
<attribute name="onFocus">
chkIndSentidoIda.setChecked(false);
</attribute>
</checkbox>
</cell>
</row>
</rows>
</grid>