fixes bug#AL-2679
parent
5da328d057
commit
6f257c565a
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>br.com.rjconsultores</groupId>
|
||||
<artifactId>ventaboletosadm</artifactId>
|
||||
<version>1.5.0</version>
|
||||
<version>1.5.1</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -57,8 +57,9 @@ public class RelatorioPassagensAGR extends Relatorio {
|
|||
String clienteIds = parametros.get("clienteIds").toString();
|
||||
String linhaIds = parametros.get("linhaIds").toString();
|
||||
String empresa = parametros.get("empresa") != null ? parametros.get("empresa").toString() : "";
|
||||
String categoriaIds = parametros.get("tipGratuIds") != null ? parametros.get("tipGratuIds").toString() : "";
|
||||
|
||||
String sql = getSql(fecInicioVenda, fecFinalVenda, linhaIds, tipGratuIds, clienteIds, empresa, fecInicioViagem, fecFinalViagem);
|
||||
String sql = getSql(fecInicioVenda, fecFinalVenda, linhaIds, tipGratuIds, clienteIds, empresa, fecInicioViagem, fecFinalViagem, categoriaIds);
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
|
||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||
|
@ -232,10 +233,11 @@ public class RelatorioPassagensAGR extends Relatorio {
|
|||
protected void processaParametros() throws Exception {
|
||||
}
|
||||
|
||||
private String getSql(String fecInicioVenda, String fecFinalVenda, String linha, String tipoGratu, String cliente, String empresa, String fecInicioViagem, String fecFinalViagem ) {
|
||||
private String getSql(String fecInicioVenda, String fecFinalVenda, String linha, String tipoGratu, String cliente,
|
||||
String empresa, String fecInicioViagem, String fecFinalViagem, String categoriaIds ) {
|
||||
|
||||
StringBuilder sql = new StringBuilder(3400);
|
||||
|
||||
|
||||
sql.append(" SELECT ");
|
||||
sql.append(" b.numfoliosistema AS numero_bilhete, ");
|
||||
sql.append(" e.nombempresa AS razao_social, ");
|
||||
|
@ -290,23 +292,26 @@ public class RelatorioPassagensAGR extends Relatorio {
|
|||
sql.append("WHERE ");
|
||||
sql.append(" ( b.motivocancelacion_id NOT IN ( 4 ) ");
|
||||
sql.append(" OR b.motivocancelacion_id IS NULL ) ");
|
||||
sql.append(" AND b.categoria_id in (5,7) ");
|
||||
sql.append(" AND r.orgaoconcedente_id = 16 ");
|
||||
sql.append(" AND r.orgaoconcedente_id = 16 ");
|
||||
|
||||
if( fecInicioVenda != null && fecFinalVenda !=null ){
|
||||
sql.append(" AND b.fechorventa BETWEEN :fecInicioVenda AND :fecFinalVenda ");
|
||||
sql.append(" AND b.fechorventa BETWEEN :fecInicioVenda AND :fecFinalVenda ");
|
||||
}
|
||||
|
||||
if( fecInicioViagem != null && fecFinalViagem !=null ){
|
||||
sql.append(" AND b.fechorviaje BETWEEN :fecInicioViagem AND :fecFinalViagem ");
|
||||
|
||||
if (!categoriaIds.isEmpty() || !categoriaIds.equals("Todas") ) {
|
||||
sql.append(" AND b.categoria_id in ( "+categoriaIds+" ) ");
|
||||
}
|
||||
|
||||
if (!empresa.isEmpty()){
|
||||
sql.append("AND b.empresacorrida_id =:empresa_id ");
|
||||
if( fecInicioViagem != null && fecFinalViagem !=null ){
|
||||
sql.append(" AND b.fechorviaje BETWEEN :fecInicioViagem AND :fecFinalViagem ");
|
||||
}
|
||||
|
||||
if (!empresa.isEmpty() || !empresa.equals("Todas")){
|
||||
sql.append(" AND b.empresacorrida_id =:empresa_id ");
|
||||
}
|
||||
|
||||
if (linha != null && !linha.equals("Todas")) {
|
||||
sql.append(" AND b.ruta_id in (").append(linha).append(") ");
|
||||
sql.append(" AND b.ruta_id in (").append(linha).append(") ");
|
||||
}
|
||||
|
||||
sql.append(" ORDER BY ");
|
||||
|
|
|
@ -35,7 +35,6 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
|||
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderClienteSimples;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioLinhaHorario;
|
||||
import com.trg.search.Filter;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winFiltroRelatorioPassagensAGR"
|
||||
apply="${relatorioPassagensAGRController}"
|
||||
contentStyle="overflow:auto" height="335px" width="550px"
|
||||
contentStyle="overflow:auto" height="435px" width="550px"
|
||||
border="normal">
|
||||
|
||||
<grid fixedLayout="true">
|
||||
|
@ -135,6 +135,34 @@
|
|||
</rows>
|
||||
</grid>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="100%" />
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<toolbar>
|
||||
<button id="btnRemoveTipoGratuidade" height="20"
|
||||
image="/gui/img/remove.png" width="35px"
|
||||
tooltiptext="${c:l('generarTarifaOrgaoController.labelRemoveRuta.value')}" />
|
||||
<button id="btnAddTipoTipoGratuidade" height="20"
|
||||
image="/gui/img/add.png" width="35px"
|
||||
tooltiptext="${c:l('generarTarifaOrgaoController.labelAddRuta.value')}" />
|
||||
</toolbar>
|
||||
</row>
|
||||
<row>
|
||||
<listbox id="selectedTipoGratuidadeList" mold="paging"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
vflex="true" multiple="false" height="60%" >
|
||||
<listhead sizable="true">
|
||||
<listheader image="/gui/img/builder.gif"
|
||||
label="${c:l('generarTarifaOrgaoController.labelEmpresa.value')}" width="100%"/>
|
||||
</listhead>
|
||||
</listbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<grid fixedLayout="true">
|
||||
<columns>
|
||||
<column width="25%" />
|
||||
|
|
Loading…
Reference in New Issue