diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioCheckin.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioCheckin.java index 22846df3d..1c122c7b8 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioCheckin.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioCheckin.java @@ -34,9 +34,7 @@ public class RelatorioCheckin extends Relatorio { Date fecFinal = (Date) getParametros().get("DATA_FINAL"); fecInicio = DateUtil.inicioFecha(fecInicio); fecFinal = DateUtil.fimFecha(fecFinal); - Boolean isCheckinEncerrado = (Boolean) getParametros().get("IS_CHECKIN_ENCERRADO"); - Boolean isCheckinAberto = (Boolean) getParametros().get("IS_CHECKIN_ABERTO"); - + if (StringUtils.isNotBlank(idsBilheteiros)) { String []ls = idsBilheteiros.split(","); @@ -46,7 +44,7 @@ public class RelatorioCheckin extends Relatorio { } } - String sql = getSql(corridaId, origenId, idsBilheteiros, isCheckinEncerrado, isCheckinAberto); + String sql = getSql(corridaId, origenId, idsBilheteiros); PreparedStatement pstmt = getConexao().prepareStatement(sql); @@ -95,7 +93,7 @@ public class RelatorioCheckin extends Relatorio { this.setCollectionDataSource(new JRBeanCollectionDataSource(checkins)); } - private String getSql(Integer corridaId, Integer origenId, String idsBilheteiros, Boolean indCheckinEncerrado, Boolean indCheckinAberto) { + private String getSql(Integer corridaId, Integer origenId, String idsBilheteiros) { StringBuffer sql = new StringBuffer(); sql.append("select b.boleto_id, o.descparada, b.corrida_id, "); @@ -106,24 +104,14 @@ public class RelatorioCheckin extends Relatorio { sql.append("inner join boleto_checkin bc on b.boleto_id = bc.boletooriginal_id "); sql.append("inner join parada o on b.origen_id = o.parada_id "); sql.append("inner join usuario u on bc.usuario_id = u.usuario_id "); - //Se a corrida_id e feccorrida existe na tabela checkin_cerrado = checkin encerrado - if(indCheckinEncerrado) { - sql.append("inner join checkin_cerrado cc on (b.corrida_id = cc.corrida_id and b.feccorrida=cc.feccorrida )"); - }else { - //Se a corrida_id e feccorrida não existe na tabela checkin_cerrado = checkin aberto - if(indCheckinAberto) { - sql.append(" left join checkin_cerrado cc on (b.corrida_id = cc.corrida_id and b.feccorrida=cc.feccorrida ) "); - } - } + sql.append(" where b.activo = 1 "); sql.append("and bc.FECMODIF between ? and ? "); sql.append(corridaId == null ? "" : " and b.corrida_id = ? "); sql.append(origenId == null ? "" : " and b.origen_id = ? "); sql.append((lsInt == null || lsInt.size() == 0) ? "" : " and u.USUARIO_ID in ( "+ createIn(lsInt.size()) + ") "); - if(indCheckinAberto) { - sql.append(" and cc.corrida_id is null "); - } + sql.append(" order by bc.datacancelado desc"); return sql.toString(); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioCheckinAberto.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioCheckinAberto.java new file mode 100644 index 000000000..4f67eab8c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioCheckinAberto.java @@ -0,0 +1,160 @@ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioCheckinAbertoBean; +import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; + +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; + +public class RelatorioCheckinAberto extends Relatorio { + + public static final String DATA_INICIO_SERVICO = "DATA_INICIO_SERVICO"; + public static final String DATA_FIM_SERVICO = "DATA_FIM_SERVICO"; + public static final String DATA_INICIO_ENCERRAMENTO = "DATA_INICIO_ENCERRAMENTO"; + public static final String DATA_FIM_ENCERRAMENTO = "DATA_FIM_ENCERRAMENTO"; + private List lsDadosRelatorio; + + public RelatorioCheckinAberto(Map parametros, Connection conexao) throws Exception { + super(parametros, conexao); + + this.setCustomDataSource(new DataSource(this) { + @Override + public void initDados() throws Exception { + + Connection conexao = this.relatorio.getConexao(); + + Map parametros = this.relatorio.getParametros(); + + String dataInicioServico = null; + if (parametros.containsKey(DATA_INICIO_SERVICO)) { + dataInicioServico = parametros.get(DATA_INICIO_SERVICO).toString() + " 00:00"; + } + + String dataFimServico = null; + if (parametros.containsKey(DATA_FIM_SERVICO)) { + dataFimServico = parametros.get(DATA_FIM_SERVICO).toString() + " 23:59"; + } + + String dataInicioEncerramento = null; + if (parametros.containsKey(DATA_INICIO_ENCERRAMENTO)) { + dataInicioEncerramento = parametros.get(DATA_INICIO_ENCERRAMENTO).toString() + " 00:00"; + } + + String dataFimEncerramento = null; + if (parametros.containsKey(DATA_FIM_ENCERRAMENTO)) { + dataFimEncerramento = parametros.get(DATA_FIM_ENCERRAMENTO).toString() + " 23:59"; + } + + Integer empresa_id = (Integer) parametros.get("empresa_id"); + Integer localidade_id = (Integer) parametros.get("localidade_id"); + + String sql = getSql(dataInicioServico, dataFimServico, dataInicioEncerramento, dataFimEncerramento, empresa_id, localidade_id); + + NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql); + + if (dataInicioServico != null && dataFimServico != null) { + stmt.setString("dataInicioServico", dataInicioServico); + stmt.setString("dataFimServico", dataFimServico); + } + + if (dataInicioEncerramento != null && dataFimEncerramento != null) { + stmt.setString("dataInicioEncerramento", dataInicioEncerramento); + stmt.setString("dataFimEncerramento", dataFimEncerramento); + } + + if (empresa_id != null) { + stmt.setInt("empresa_id", empresa_id); + } + + if (localidade_id != null) { + stmt.setInt("localidade_id", localidade_id); + } + + ResultSet rs = stmt.executeQuery(); + + lsDadosRelatorio = new ArrayList(); + + SimpleDateFormat formatadorData = new SimpleDateFormat("dd/MM/yyyy"); + SimpleDateFormat formatadorDataHora = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); + + while (rs.next()) { + RelatorioCheckinAbertoBean bean = new RelatorioCheckinAbertoBean(); + bean.setServico(rs.getInt("servico")); + bean.setDataServico(formatadorData.format(rs.getDate("data_servico"))); + bean.setLocalidade(rs.getString("localidade")); + //bean.setUsuario(rs.getString("usuario")); + + lsDadosRelatorio.add(bean); + } + + if (lsDadosRelatorio.size() > 0) { + setLsDadosRelatorio(lsDadosRelatorio); + } + } + }); + } + + @Override + protected void processaParametros() throws Exception { + if (parametros.containsKey(DATA_INICIO_SERVICO) && parametros.containsKey(DATA_FIM_SERVICO)) { + this.parametros.put("PERIODO_SERVICO", parametros.get(DATA_INICIO_SERVICO) + " à " + parametros.get(DATA_FIM_SERVICO)); + } + + if (parametros.containsKey(DATA_INICIO_ENCERRAMENTO) && parametros.containsKey(DATA_FIM_ENCERRAMENTO)) { + this.parametros.put("PERIODO_ENCERRAMENTO", parametros.get(DATA_INICIO_ENCERRAMENTO) + " à " + parametros.get(DATA_FIM_ENCERRAMENTO)); + } + } + + private void setLsDadosRelatorio(List lsDadosRelatorio) { + this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); + this.lsDadosRelatorio = lsDadosRelatorio; + } + + private String getSql(String dataInicioServico, String dataFimServico, String dataInicioEncerramento, String dataFimEncerramento, Integer empresa_id, Integer localidade_id) { + StringBuilder sb = new StringBuilder(); + sb.append("select c.corrida_id as servico, "); + sb.append("c.feccorrida as data_servico, "); + sb.append("p.cveparada || ' - ' || p.descparada as localidade, "); + sb.append("cc.fechorcerrado as data_encerramento "); + sb.append("from corrida c "); + sb.append("join parada p on p.parada_id = c.origen_id "); + sb.append("left join checkin_cerrado cc on (c.corrida_id = cc.corrida_id and c.feccorrida=cc.feccorrida ) "); + + + if (empresa_id!=null) { + sb.append("join marca m on m.marca_id = c.marca_id "); + } + + sb.append("where c.activo = 1 "); + + sb.append(" and cc.corrida_id is null "); + + if (dataInicioServico != null && dataFimServico != null) { + sb.append("and c.feccorrida between to_date(:dataInicioServico, 'dd/mm/yyyy hh24:mi') and to_date(:dataFimServico, 'dd/mm/yyyy hh24:mi') "); + } + + if (dataInicioEncerramento != null && dataFimEncerramento != null) { + sb.append("and c.feccorrida between to_date(:dataInicioEncerramento, 'dd/mm/yyyy hh24:mi') and to_date(:dataFimEncerramento, 'dd/mm/yyyy hh24:mi') "); + } + + if (empresa_id != null) { + sb.append("and m.empresa_id = :empresa_id "); + } + + if (localidade_id != null) { + sb.append("and p.parada_id = :localidade_id "); + } + + sb.append("order by 2, 1, 4, 3"); + + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckinAberto_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckinAberto_es.properties new file mode 100644 index 000000000..7073dc9ff --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckinAberto_es.properties @@ -0,0 +1,18 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. +msg.a=à + +#Labels header +header.data.hora=Data/Hora\: +header.pagina=Página\: +header.periodo.servico=Período Serviço\: +header.periodo.encerramento=Período Encerramento\: +header.empresa=Empresa\: + +#Labels detail +detail.servico=Serviço +detail.data.servico=Data Serviço +detail.localidade=Localidade +detail.data.encerramento=Data Encerramento +detail.usuario.operacao=Usuário da Operação +detail.imei=Dispositivo \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckinAberto_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckinAberto_pt_BR.properties new file mode 100644 index 000000000..f9703c45a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckinAberto_pt_BR.properties @@ -0,0 +1,18 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. +msg.a=à + +#Labels header +header.data.hora=Data/Hora\: +header.pagina=Página\: +header.periodo.servico=Período Serviço\: +header.periodo.encerramento=Período Encerramento\: +header.empresa=Empresa\: + +#Labels detail +detail.servico=Serviço +detail.data.servico=Data Serviço +detail.localidade=Origem do Serviço +detail.data.encerramento=Data Encerramento +detail.usuario.operacao=Usuário da Operação +detail.imei=Dispositivo \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckin_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckin_es.properties index ff33acdc6..5bbfc7511 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckin_es.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckin_es.properties @@ -13,7 +13,7 @@ cabecalho.filtros=Filtros: #Labels datail datail.voucher=Nº Bilhete / Voucher -datail.origen=Origem +datail.origen=Origem do Serviço datail.servicio=Serviço datail.data.servicio=Data do Serviço datail.data.checkin=Data Checkin diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckin_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckin_pt_BR.properties index ff33acdc6..2dc8cdbd8 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckin_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioCheckin_pt_BR.properties @@ -10,10 +10,16 @@ cabecalho.impressorPor=Impressor por: cabecalho.pagina=Página cabecalho.de=de cabecalho.filtros=Filtros: +#Labels header +cabecalho.pagina=Página\: +cabecalho.empresa=Empresa\: +cabecalho.bilheteiro = Bilheteiro(s)\: +cabecalho.usuario = Usuário\: + #Labels datail datail.voucher=Nº Bilhete / Voucher -datail.origen=Origem +datail.origen=Origem do Serviço datail.servicio=Serviço datail.data.servicio=Data do Serviço datail.data.checkin=Data Checkin diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckin.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckin.jasper index 71fdfc0f5..9221236bb 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckin.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckin.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckin.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckin.jrxml index 57058e880..2a3b6b440 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckin.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckin.jrxml @@ -1,7 +1,7 @@ - + @@ -9,6 +9,9 @@ + + + @@ -26,18 +29,74 @@ - <band height="21" splitType="Stretch"> - <textField pattern="" isBlankWhenNull="false"> - <reportElement uuid="5ee43799-932b-4ce1-8056-df380a9050a8" mode="Transparent" x="0" y="0" width="338" height="20" forecolor="#000000" backcolor="#FFFFFF"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> - <font fontName="SansSerif" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> - <paragraph lineSpacing="Single"/> + <band height="83" splitType="Stretch"> + <line> + <reportElement x="0" y="80" width="619" height="1" uuid="b28df970-c219-4853-afeb-6821e0a44f04"/> + </line> + <textField> + <reportElement mode="Opaque" x="0" y="0" width="476" height="30" backcolor="#D7D7D7" uuid="50c553a9-7292-44df-8b24-24eb14e98841"/> + <textElement markup="styled"> + <font size="16" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> </textField> - <line> - <reportElement uuid="b28df970-c219-4853-afeb-6821e0a44f04" x="0" y="20" width="619" height="1"/> - </line> + <textField> + <reportElement x="0" y="31" width="130" height="16" uuid="3cbad5ad-ea6f-4718-b7e5-a98dc6be0188"/> + <textElement> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.periodo}]]></textFieldExpression> + </textField> + <textField> + <reportElement x="130" y="31" width="505" height="16" uuid="6c12f1b5-cae1-4ea9-b674-703d0f3d2bdc"/> + <textFieldExpression><![CDATA[($P{DATA_INICIAL} != null ? new java.text.SimpleDateFormat("dd/MM/yyyy").format($P{DATA_INICIAL}) : "") + +" à " + +($P{DATA_FINAL} != null ? new java.text.SimpleDateFormat("dd/MM/yyyy").format($P{DATA_FINAL}) : "")]]></textFieldExpression> + </textField> + <textField> + <reportElement x="131" y="49" width="504" height="16" isRemoveLineWhenBlank="true" uuid="64d65c79-be80-4596-b84e-e2c3c3ddaa8a"/> + <textFieldExpression><![CDATA[$P{nombUsuario}]]></textFieldExpression> + </textField> + <textField> + <reportElement x="0" y="49" width="130" height="16" isRemoveLineWhenBlank="true" uuid="cdd0af8e-575e-4afa-b68f-6d0812032d4b"/> + <textElement> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.usuario}]]></textFieldExpression> + </textField> + <textField> + <reportElement mode="Opaque" x="577" y="15" width="29" height="15" backcolor="#D7D7D7" uuid="17fabb43-59cc-4375-86a8-793ff7a67f50"/> + <textElement textAlignment="Right"/> + <textFieldExpression><![CDATA[$V{PAGE_NUMBER}+" de"]]></textFieldExpression> + </textField> + <textField> + <reportElement mode="Opaque" x="476" y="15" width="62" height="15" backcolor="#D7D7D7" uuid="e0a35762-56d1-4da2-a945-8ae4d5348bb7"/> + <textElement> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.pagina}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy HH:mm"> + <reportElement mode="Opaque" x="538" y="0" width="97" height="15" backcolor="#D7D7D7" uuid="54f55cc3-21cb-482f-a58b-fca885e48517"/> + <textElement textAlignment="Left"/> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + <textField evaluationTime="Report"> + <reportElement mode="Opaque" x="606" y="15" width="29" height="15" backcolor="#D7D7D7" uuid="d0201aca-580e-4359-9503-c579a43dcccd"/> + <textElement textAlignment="Left"/> + <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression> + </textField> + <textField> + <reportElement mode="Opaque" x="476" y="0" width="62" height="15" backcolor="#D7D7D7" uuid="1ac071ee-3dcd-427a-909f-9d39e40c6708"/> + <textElement> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression> + </textField> + <textField isBlankWhenNull="true"> + <reportElement mode="Opaque" x="538" y="15" width="39" height="15" backcolor="#D7D7D7" uuid="fb1a5b0c-1e7e-443e-b0ff-db26c4ed289d"/> + <textElement textAlignment="Right"/> + </textField> </band> @@ -45,125 +104,125 @@ - - + + - - + + - - + + - - - - - - - - + - + - + - + - + + + + + + + + - - + + - + - - + + - - - - - - - - + - + - + - + + + + + + + + @@ -178,7 +237,7 @@ - + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckinAberto.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckinAberto.jasper new file mode 100644 index 000000000..a64c25ecd Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckinAberto.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckinAberto.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckinAberto.jrxml new file mode 100644 index 000000000..72802b783 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioCheckinAberto.jrxml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + <band splitType="Stretch"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioCheckinAbertoBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioCheckinAbertoBean.java new file mode 100644 index 000000000..50cf66c03 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioCheckinAbertoBean.java @@ -0,0 +1,59 @@ +package com.rjconsultores.ventaboletos.relatorios.utilitarios; + +public class RelatorioCheckinAbertoBean { + + private Integer servico; + private String dataServico; + private String localidade; + private String dataEncerramento; + private String usuario; + private String imei; + + public Integer getServico() { + return servico; + } + + public void setServico(Integer servico) { + this.servico = servico; + } + + public String getDataServico() { + return dataServico; + } + + public void setDataServico(String dataServico) { + this.dataServico = dataServico; + } + + public String getLocalidade() { + return localidade; + } + + public void setLocalidade(String localidade) { + this.localidade = localidade; + } + + public String getDataEncerramento() { + return dataEncerramento; + } + + public void setDataEncerramento(String dataEncerramento) { + this.dataEncerramento = dataEncerramento; + } + + public String getUsuario() { + return usuario; + } + + public void setUsuario(String usuario) { + this.usuario = usuario; + } + + public String getImei() { + return imei; + } + + public void setImei(String imei) { + this.imei = imei; + } +} \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioCheckinController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioCheckinController.java index 6cce9952a..1d26ea234 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioCheckinController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioCheckinController.java @@ -16,7 +16,6 @@ import org.zkoss.zhtml.Messagebox; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; import org.zkoss.zul.Bandbox; -import org.zkoss.zul.Checkbox; import org.zkoss.zul.Comboitem; import org.zkoss.zul.ComboitemRenderer; import org.zkoss.zul.Datebox; @@ -28,6 +27,7 @@ import com.rjconsultores.ventaboletos.entidad.Parada; import com.rjconsultores.ventaboletos.entidad.Usuario; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioCheckin; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParadaCve; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @@ -55,8 +55,7 @@ public class RelatorioCheckinController extends MyGenericForwardComposer { private MyListbox usuarioSelList; private MyComboboxParada cmbParadaOrigem; private MyComboboxParadaCve cmbParadaOrigemCve; - private Checkbox chcEncerrado; - private Checkbox chcAberto; + @Autowired @@ -79,7 +78,7 @@ public class RelatorioCheckinController extends MyGenericForwardComposer { usuarioList.setItemRenderer(new RenderRelatorioCheckinUsuario()); usuarioSelList.setItemRenderer(new RenderRelatorioCheckinUsuariosSelecionados()); - + } public void onClick$btnPesquisa(Event ev) { @@ -136,9 +135,10 @@ public class RelatorioCheckinController extends MyGenericForwardComposer { parametros.put("DATA_FINAL", datFinal.getValue()); parametros.put("ORIGEN_ID", origenId); parametros.put("ORIGEN", origen); - parametros.put("IS_CHECKIN_ENCERRADO", chcEncerrado.isChecked()); - parametros.put("IS_CHECKIN_ABERTO", chcAberto.isChecked()); - parametros.put("NOME_RELATORIO", Labels.getLabel("indexController.mniRelatorioCheckin.label")); + parametros.put("nombUsuario", UsuarioLogado.getUsuarioLogado().getNombusuario().toString()); + String nomeRelatorio = Labels.getLabel("indexController.mniRelatorioCheckin.label"); + + parametros.put("NOME_RELATORIO", nomeRelatorio); String usuariosIds = ""; for (int i = 0; i < lsUsuariosSelecionados.size(); i++) { diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioEncerramentoCheckinController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioCheckinEnacerramentoAbertoController.java similarity index 80% rename from src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioEncerramentoCheckinController.java rename to src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioCheckinEnacerramentoAbertoController.java index ad5bf9ca5..e1b7f066a 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioEncerramentoCheckinController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioCheckinEnacerramentoAbertoController.java @@ -14,10 +14,12 @@ import org.springframework.stereotype.Controller; import org.zkoss.util.resource.Labels; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Checkbox; import org.zkoss.zul.Datebox; import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioCheckinAberto; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioEncerramentoCheckin; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.service.EmpresaService; @@ -31,7 +33,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @Controller("relatorioEncerramentoCheckinController") @Scope("prototype") @SuppressWarnings("serial") -public class RelatorioEncerramentoCheckinController extends MyGenericForwardComposer { +public class RelatorioCheckinEnacerramentoAbertoController extends MyGenericForwardComposer { @Autowired private DataSource dataSourceRead; @@ -46,11 +48,14 @@ public class RelatorioEncerramentoCheckinController extends MyGenericForwardComp private MyComboboxEstandar cmbEmpresa; private MyComboboxParada cmbLocalidade; private List lsEmpresas; + private Checkbox chcEncerrado; + private Checkbox chcAberto; @Override public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); lsEmpresas = empresaService.obtenerTodos(); + chcEncerrado.setChecked(Boolean.TRUE); } public void onClick$btnExecutarRelatorio(Event ev) throws Exception { @@ -59,7 +64,6 @@ public class RelatorioEncerramentoCheckinController extends MyGenericForwardComp private void executarRelatorio() throws Exception { Map parametros = new HashMap(); - parametros.put("TITULO", Labels.getLabel("relatorioEncerramentoCheckinController.window.title")); // Datas putParametrosDate(parametros, RelatorioEncerramentoCheckin.DATA_INICIO_SERVICO, this.dataInicioServico.getValue()); @@ -97,12 +101,25 @@ public class RelatorioEncerramentoCheckinController extends MyGenericForwardComp parametros.put("localidade_id", ((Parada) cmbLocalidade.getSelectedItem().getValue()).getParadaId()); } - Relatorio relatorio = new RelatorioEncerramentoCheckin(parametros, dataSourceRead.getConnection()); + Relatorio relatorio = null; + if(chcEncerrado.isChecked()) { + parametros.put("TITULO", Labels.getLabel("relatorioEncerramentoCheckinController.window.title")); + relatorio = new RelatorioEncerramentoCheckin(parametros, dataSourceRead.getConnection()); + }else { + parametros.put("TITULO", Labels.getLabel("relatorioCheckinAbertoController.window.title")); + relatorio = new RelatorioCheckinAberto(parametros, dataSourceRead.getConnection()); + } + Map args = new HashMap(); args.put("relatorio", relatorio); - openWindow("/component/reportView.zul", Labels.getLabel("relatorioEncerramentoCheckinController.window.title"), args, MODAL); + if(chcEncerrado.isChecked()) { + openWindow("/component/reportView.zul", Labels.getLabel("relatorioEncerramentoCheckinController.window.title"), args, MODAL); + }else { + openWindow("/component/reportView.zul", Labels.getLabel("relatorioCheckinAbertoController.window.title"), args, MODAL); + } + } private void putParametrosDate(Map parametros, String nomeParametro, Date data) { diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index be9a9c359..c7fbe79e0 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -328,6 +328,8 @@ indexController.mniRelatorioVendasBilheteiroSintetico.label = Ventas por agentes indexController.mniRelatorioAgenciasNaoImportadas.label = Reporte puntos venta no importados indexController.mniRelatorioIntegracaoAntiFraude.label = Relatório de Integração com Antifraude indexController.mniRelatorioCheckin.label = Checkin's +indexController.mniRelatorioCheckinAberto.label = Relatório Checkin's Abertos +indexController.mniRelatorioCheckinEncerrado.label = Relatório Checkin's Encerrados indexController.mniFechamentoParamgeral.label = Cierre cuenta indexController.mniFechamentoParamptovta.label = Cierre cuenta contábil punto de venta indexController.mniRelatorioCorridas.label = Reporte de corridas diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 2f2caba9b..a8713f8f3 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -347,7 +347,9 @@ indexController.mniRelatorioVendasBilheteiroSintetico.label = Vendas por Bilhete indexController.mniRelatorioCancelamentoAutomaticoECF.label = Relatório de Cancelamento Automatico ECF indexController.mniRelatorioAgenciasNaoImportadas.label = Relatório de Agências não Importadas indexController.mniRelatorioIntegracaoAntiFraude.label = Relatório de Integração com Antifraude -indexController.mniRelatorioCheckin.label = Checkin's +indexController.mniRelatorioCheckin.label = Relatório Checkin's +indexController.mniRelatorioCheckinAberto.label = Relatório Checkin's Abertos +indexController.mniRelatorioCheckinEncerrado.label = Relatório Checkin's Encerrados indexController.mniFechamentoParamgeral.label = Configuração de Boleto indexController.mniFechamentoParamptovta.label = Fechamento Conta Corrente Agência indexController.mniRelatorioCorridas.label = Relatório de Serviços @@ -9794,6 +9796,7 @@ relatorioMovimentacaoBilheteController.lbAdicionarLinha.value = Adicionar Linha # Relatório Encerramento do Checkin relatorioEncerramentoCheckinController.window.title = Relatório Encerramento do Checkin +relatorioCheckinAbertoController.window.title = Relatório de Checkin em Aberto (Não Encerrados) relatorioEncerramentoCheckinController.data.servico.obrigatoria = É necessário preencher a data inicial e final do serviço relatorioEncerramentoCheckinController.data.encerramento.obrigatoria = É necessário preencher a data inicial e final do encerramento relatorioEncerramentoCheckinController.data.obrigatoria = Data do Serviço ou Data do Encerramento são obrigatórias diff --git a/web/gui/relatorios/filtroRelatorioCheckin.zul b/web/gui/relatorios/filtroRelatorioCheckin.zul index 9592c35b7..6b2285f89 100644 --- a/web/gui/relatorios/filtroRelatorioCheckin.zul +++ b/web/gui/relatorios/filtroRelatorioCheckin.zul @@ -55,25 +55,6 @@ - - diff --git a/web/gui/relatorios/filtroRelatorioEncerramentoCheckin.zul b/web/gui/relatorios/filtroRelatorioEncerramentoCheckin.zul index 9b9887fd7..51668c8b2 100644 --- a/web/gui/relatorios/filtroRelatorioEncerramentoCheckin.zul +++ b/web/gui/relatorios/filtroRelatorioEncerramentoCheckin.zul @@ -8,7 +8,7 @@ + height="265px" width="560px" border="normal"> @@ -70,6 +70,25 @@ mold="rounded" buttonVisible="true" use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada" /> + +