fixes bug#AL-2679
parent
5da328d057
commit
6f257c565a
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ventaboletosadm</artifactId>
|
<artifactId>ventaboletosadm</artifactId>
|
||||||
<version>1.5.0</version>
|
<version>1.5.1</version>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -57,8 +57,9 @@ public class RelatorioPassagensAGR extends Relatorio {
|
||||||
String clienteIds = parametros.get("clienteIds").toString();
|
String clienteIds = parametros.get("clienteIds").toString();
|
||||||
String linhaIds = parametros.get("linhaIds").toString();
|
String linhaIds = parametros.get("linhaIds").toString();
|
||||||
String empresa = parametros.get("empresa") != null ? parametros.get("empresa").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");
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
|
||||||
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
|
||||||
|
@ -232,7 +233,8 @@ public class RelatorioPassagensAGR extends Relatorio {
|
||||||
protected void processaParametros() throws Exception {
|
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);
|
StringBuilder sql = new StringBuilder(3400);
|
||||||
|
|
||||||
|
@ -290,18 +292,21 @@ public class RelatorioPassagensAGR extends Relatorio {
|
||||||
sql.append("WHERE ");
|
sql.append("WHERE ");
|
||||||
sql.append(" ( b.motivocancelacion_id NOT IN ( 4 ) ");
|
sql.append(" ( b.motivocancelacion_id NOT IN ( 4 ) ");
|
||||||
sql.append(" OR b.motivocancelacion_id IS NULL ) ");
|
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 ){
|
if( fecInicioVenda != null && fecFinalVenda !=null ){
|
||||||
sql.append(" AND b.fechorventa BETWEEN :fecInicioVenda AND :fecFinalVenda ");
|
sql.append(" AND b.fechorventa BETWEEN :fecInicioVenda AND :fecFinalVenda ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!categoriaIds.isEmpty() || !categoriaIds.equals("Todas") ) {
|
||||||
|
sql.append(" AND b.categoria_id in ( "+categoriaIds+" ) ");
|
||||||
|
}
|
||||||
|
|
||||||
if( fecInicioViagem != null && fecFinalViagem !=null ){
|
if( fecInicioViagem != null && fecFinalViagem !=null ){
|
||||||
sql.append(" AND b.fechorviaje BETWEEN :fecInicioViagem AND :fecFinalViagem ");
|
sql.append(" AND b.fechorviaje BETWEEN :fecInicioViagem AND :fecFinalViagem ");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empresa.isEmpty()){
|
if (!empresa.isEmpty() || !empresa.equals("Todas")){
|
||||||
sql.append(" AND b.empresacorrida_id =:empresa_id ");
|
sql.append(" AND b.empresacorrida_id =:empresa_id ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
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.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioLinhaHorario;
|
||||||
import com.trg.search.Filter;
|
import com.trg.search.Filter;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||||
<window id="winFiltroRelatorioPassagensAGR"
|
<window id="winFiltroRelatorioPassagensAGR"
|
||||||
apply="${relatorioPassagensAGRController}"
|
apply="${relatorioPassagensAGRController}"
|
||||||
contentStyle="overflow:auto" height="335px" width="550px"
|
contentStyle="overflow:auto" height="435px" width="550px"
|
||||||
border="normal">
|
border="normal">
|
||||||
|
|
||||||
<grid fixedLayout="true">
|
<grid fixedLayout="true">
|
||||||
|
@ -135,6 +135,34 @@
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</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">
|
<grid fixedLayout="true">
|
||||||
<columns>
|
<columns>
|
||||||
<column width="25%" />
|
<column width="25%" />
|
||||||
|
|
Loading…
Reference in New Issue