fix bug #0009476 - Desenvolvimento do Relatório de Vendas por Bilheteiro Sintetico

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@72439 d1611594-4594-4d17-8e1d-87c2c4800839
master
bruno.neves 2017-08-08 21:28:23 +00:00
parent 09b7d865b0
commit 5f46826a4e
12 changed files with 927 additions and 1 deletions

View File

@ -0,0 +1,116 @@
/**
*
*/
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
/**
* @author Bruno Neves
*
*/
public class RelatorioVendasBilheteiroSintetico extends Relatorio {
public RelatorioVendasBilheteiroSintetico(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new ArrayDataSource(this) {
@Override
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
StringBuilder sql = new StringBuilder();
sql.append("select ");
sql.append(" pv.NUMPUNTOVENTA, us.cveusuario , us.NOMBUSUARIO, ");
sql.append(" sum (case when ca.motivocancelacion_id is null then 1 else 0 end) qtdVendas, ");
sql.append(" sum (case when ca.motivocancelacion_id is null then ");
sql.append(" (coalesce(ca.preciopagado,0) ");
sql.append(" + coalesce(ca.importepedagio,0) ");
sql.append(" + coalesce(ca.importetaxaembarque,0) ");
sql.append(" + coalesce(ca.importeseguro,0) ) else 0 end ) vlrVendas, ");
sql.append(" sum (case when ca.motivocancelacion_id is not null then 1 else 0 end) qtdCancelados, ");
sql.append(" sum (case when ca.motivocancelacion_id is not null then ");
sql.append(" (coalesce(ca.preciopagado,0) ");
sql.append(" + coalesce(ca.importepedagio,0) ");
sql.append(" + coalesce(ca.importetaxaembarque,0) ");
sql.append(" + coalesce(ca.importeseguro,0) ) else 0 end ) vlrCancelados ");
sql.append("from ");
sql.append(" caja ca ");
sql.append(" inner join usuario us on us.usuario_id = ca.usuario_id ");
sql.append(" inner join punto_venta pv on pv.puntoventa_id = ca.puntoventa_id ");
sql.append("where ");
sql.append(" ca.indreimpresion = 0 ");
sql.append(" and ca.feccorte >= :DATA_INICIAL ");
sql.append(" and ca.feccorte <= :DATA_FINAL ");
if(parametros.get("EMPRESA_ID") != null){
sql.append(" and ca.EMPRESAPUNTOVENTA_ID = :EMPRESA_ID");
}
if (parametros.get("NUMPUNTOVENTA") != null) {
sql.append(" and ca.puntoventa_id IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")");
}
if(parametros.get("TIPOPUNTOVENTA_ID") != null && !parametros.get("TIPOPUNTOVENTA_ID").toString().equals("-1") ){
sql.append(" and pv.TIPOPTOVTA_ID = :TIPOPUNTOVENTA_ID ");
}
sql.append(" group by pv.NUMPUNTOVENTA, us.cveusuario, us.NOMBUSUARIO ");
sql.append(" order by pv.NUMPUNTOVENTA, us.NOMBUSUARIO ");
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString());
if(parametros.get("EMPRESA_ID") != null){
stmt.setInt("EMPRESA_ID", Integer.valueOf(parametros.get("EMPRESA_ID").toString()));
}
stmt.setTimestamp("DATA_INICIAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
stmt.setTimestamp("DATA_FINAL", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
if(parametros.get("TIPOPUNTOVENTA_ID") != null && !parametros.get("TIPOPUNTOVENTA_ID").toString().equals("-1") ){
stmt.setInt("TIPOPUNTOVENTA_ID", Integer.valueOf(parametros.get("TIPOPUNTOVENTA_ID").toString()));
}
ResultSet rset = stmt.executeQuery();
while (rset.next()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
dataResult.put("NUMPUNTOVENTA", rset.getString("NUMPUNTOVENTA"));
dataResult.put("CVEUSUARIO", rset.getString("CVEUSUARIO"));
dataResult.put("NOMBUSUARIO", rset.getString("NOMBUSUARIO"));
dataResult.put("QTDVENDAS", rset.getInt("QTDVENDAS"));
dataResult.put("VLRVENDAS", rset.getBigDecimal("VLRVENDAS"));
dataResult.put("QTDCANCELADOS", rset.getInt("QTDCANCELADOS"));
dataResult.put("VLRCANCELADOS", rset.getBigDecimal("VLRCANCELADOS"));
this.dados.add(dataResult);
}
this.resultSet = rset;
}
});
}
/*
* (non-Javadoc)
*
* @see com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio#processaParametros()
*/
@Override
protected void processaParametros() throws Exception {
}
}

View File

@ -0,0 +1,13 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.relatorio=Relatório:
cabecalho.periodo=Período:
cabecalho.periodoA=à
cabecalho.dataHora=Data/Hora:
cabecalho.impressorPor=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:

View File

@ -0,0 +1,289 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioVendasBilheteiro" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b92fb063-a827-4619-8a69-5c78e3afbb8c">
<property name="ireport.zoom" value="1.5"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="pageHeader"/>
<property name="ireport.x" value="131"/>
<property name="ireport.y" value="0"/>
<style name="textStyle" isDefault="true" fontSize="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<parameter name="DATA_INICIAL" class="java.util.Date"/>
<parameter name="DATA_FINAL" class="java.util.Date"/>
<parameter name="NOME_RELATORIO" class="java.lang.String"/>
<parameter name="FILTROS" class="java.lang.String"/>
<parameter name="USUARIO" class="java.lang.String"/>
<parameter name="NUMPUNTOVENTA" class="java.lang.String"/>
<parameter name="EMPRESA_ID" class="java.lang.Integer"/>
<parameter name="EMPRESA" class="java.lang.String"/>
<field name="NUMPUNTOVENTA" class="java.lang.String"/>
<field name="CVEUSUARIO" class="java.lang.String"/>
<field name="NOMBUSUARIO" class="java.lang.String"/>
<field name="QTDVENDAS" class="java.lang.Integer"/>
<field name="VLRVENDAS" class="java.math.BigDecimal"/>
<field name="QTDCANCELADOS" class="java.lang.Integer"/>
<field name="VLRCANCELADOS" class="java.math.BigDecimal"/>
<variable name="vlrVendaTotal" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{VLRVENDAS}]]></variableExpression>
</variable>
<variable name="vlrCanceladosTotal" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{VLRCANCELADOS}]]></variableExpression>
</variable>
<variable name="qtdCanceladosTotal" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{QTDCANCELADOS}]]></variableExpression>
</variable>
<variable name="qtdVendasTotal" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{QTDVENDAS}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="53" splitType="Stretch">
<textField pattern="dd/MM/yyyy" isBlankWhenNull="false">
<reportElement mode="Transparent" x="43" y="14" width="51" height="14" forecolor="#000000" backcolor="#FFFFFF" uuid="42796e20-405c-441f-9fd9-b26238bc7cdb"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$P{DATA_INICIAL}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="0" y="0" width="257" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="d2973779-79dc-4cc8-937a-e9167c42bab0"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="false">
<reportElement mode="Transparent" x="102" y="14" width="51" height="14" forecolor="#000000" backcolor="#FFFFFF" uuid="8730e85b-d436-42cd-beb6-1a881bad2478"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="0" y="14" width="44" height="14" forecolor="#000000" backcolor="#FFFFFF" uuid="26bbd310-5e59-4975-a47f-b0048e80b1b6"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="44" y="39" width="511" height="14" uuid="c486add3-94d7-419f-9f37-04f6a6da879e"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="39" width="555" height="1" uuid="a179c478-4014-4b4a-abf0-4655e7588bf7"/>
</line>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="0" y="39" width="45" height="14" forecolor="#000000" backcolor="#FFFFFF" uuid="9630a784-5f92-4abe-805c-fd175e4f8241"/>
<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.filtros}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false">
<reportElement mode="Transparent" x="464" y="1" width="89" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="91cded42-c53d-469a-abc7-6eb0d59f69af"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="434" y="29" width="119" height="12" forecolor="#000000" backcolor="#FFFFFF" uuid="62f6ba6e-1aaf-4449-aef6-2e9d6e541856"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="538" y="15" width="15" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="985f839c-258a-47eb-b72b-bec819b7bdbb"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="434" y="15" width="105" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="ba831a24-59f4-4f8f-888f-fd69711018e9"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina}+" "+$V{PAGE_NUMBER}+" "+$R{cabecalho.de}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="385" y="1" width="80" height="15" uuid="5cbb57ef-bd5e-4d1b-a077-d0ff398df801"/>
<textElement textAlignment="Right">
<font size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="93" y="14" width="10" height="14" forecolor="#000000" backcolor="#FFFFFF" uuid="6d6ab075-006c-4796-98d5-f047ae963876"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodoA}]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="52" width="555" height="1" uuid="06344ed1-e586-42b1-826e-f9008a2ee107"/>
</line>
</band>
</pageHeader>
<columnHeader>
<band height="13" splitType="Stretch">
<staticText>
<reportElement x="166" y="0" width="96" height="11" uuid="9fc7e58e-8625-41c4-a8ee-6454f6382d46"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="7" isBold="true"/>
</textElement>
<text><![CDATA[Usuário]]></text>
</staticText>
<staticText>
<reportElement x="0" y="0" width="68" height="11" uuid="3766fa33-6281-4576-a9d1-3b984e1976d3"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="7" isBold="true"/>
</textElement>
<text><![CDATA[Num. Agência]]></text>
</staticText>
<staticText>
<reportElement x="262" y="0" width="64" height="11" uuid="7e1f6b82-8a1f-4719-b942-41f0d7027aa8"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="7" isBold="true"/>
</textElement>
<text><![CDATA[QTD. Vendas]]></text>
</staticText>
<staticText>
<reportElement mode="Transparent" x="326" y="0" width="76" height="11" forecolor="#000000" backcolor="#FFFFFF" uuid="6adaca80-9b5a-4a03-a80b-5eeed4894d7f"/>
<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<text><![CDATA[VLR. Vendas]]></text>
</staticText>
<staticText>
<reportElement mode="Transparent" x="475" y="0" width="80" height="11" forecolor="#000000" backcolor="#FFFFFF" uuid="a39ab8f3-becb-44e3-b4f5-b7c43889508c"/>
<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<text><![CDATA[VLR.Cancelamentos]]></text>
</staticText>
<staticText>
<reportElement x="68" y="0" width="97" height="11" uuid="8a5e97db-9b05-4fa5-9663-7795869b6b90"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="7" isBold="true"/>
</textElement>
<text><![CDATA[Login]]></text>
</staticText>
<staticText>
<reportElement mode="Transparent" x="402" y="0" width="73" height="11" forecolor="#000000" backcolor="#FFFFFF" uuid="c0542d93-dde4-448d-932c-453d6a4a6882"/>
<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" markup="none">
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<text><![CDATA[QTD. Cancelamentos]]></text>
</staticText>
<line>
<reportElement x="0" y="11" width="555" height="1" uuid="8ef1fe89-c398-4c2d-a263-68d3c0dc91ab"/>
</line>
</band>
</columnHeader>
<detail>
<band height="15" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="68" height="15" uuid="01ee8c0d-6a68-45ea-a4e1-165a48cc89d4"/>
<textFieldExpression><![CDATA[$F{NUMPUNTOVENTA}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="68" y="0" width="97" height="15" uuid="152742f7-1799-4416-a180-3f55ebd20eb0"/>
<textFieldExpression><![CDATA[$F{CVEUSUARIO}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="166" y="0" width="96" height="15" uuid="7456c2e1-eb6f-48ba-8097-3ebc40c96bcd"/>
<textFieldExpression><![CDATA[$F{NOMBUSUARIO}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="262" y="0" width="64" height="15" uuid="0debe4a0-072f-46ed-957b-635c73d4c92c"/>
<textFieldExpression><![CDATA[$F{QTDVENDAS}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="402" y="0" width="73" height="15" uuid="cb0241c1-c8ed-446d-accf-36af4a4ab540"/>
<textFieldExpression><![CDATA[$F{QTDCANCELADOS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="475" y="0" width="80" height="15" uuid="de74b2a9-67c4-415c-abca-fa3549d9b0a7"/>
<textFieldExpression><![CDATA[$F{VLRCANCELADOS}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="326" y="0" width="76" height="15" uuid="da9cc79b-499f-4b9f-b1fd-7de995071fea"/>
<textFieldExpression><![CDATA[$F{VLRVENDAS}]]></textFieldExpression>
</textField>
</band>
</detail>
<lastPageFooter>
<band height="25">
<textField pattern="¤ #,##0.00">
<reportElement x="326" y="0" width="76" height="20" uuid="4fe96ddc-d868-49b8-8da6-819532f96884"/>
<textFieldExpression><![CDATA[$V{vlrVendaTotal}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="475" y="0" width="80" height="20" uuid="04a540b3-e38f-47ca-85fe-3501dbc6c6a3"/>
<textFieldExpression><![CDATA[$V{vlrCanceladosTotal}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="402" y="0" width="73" height="20" uuid="1d047de8-99d1-4293-924e-68e503c9e3bb"/>
<textFieldExpression><![CDATA[$V{qtdCanceladosTotal}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="262" y="0" width="64" height="20" uuid="8635b7a5-3642-4e3c-83d0-61f00680f2e1"/>
<textFieldExpression><![CDATA[$V{qtdVendasTotal}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="166" y="0" width="96" height="20" uuid="4b21c6f2-7b3a-4ff4-b3d3-714ece376255"/>
<textElement textAlignment="Right"/>
<text><![CDATA[Totais:]]></text>
</staticText>
</band>
</lastPageFooter>
<noData>
<band height="50">
<textField>
<reportElement x="109" y="15" width="530" height="20" uuid="995c4c61-6291-4e5f-8d92-b75502a10466"/>
<textElement markup="none">
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -0,0 +1,241 @@
/**
*
*/
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels;
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.Comboitem;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Paging;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioVendasBilheteiroSintetico;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
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.RenderRelatorioVendasBilheteiroSintetico;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioVendasBilheteiroSinteticoSelecionados;
/**
* @author Bruno Neves
*
*/
@Controller("relatorioVendasBilheteiroSinteticoController")
@Scope("prototype")
public class RelatorioVendasBilheteiroSinteticoController extends MyGenericForwardComposer {
/**
*
*/
private static final long serialVersionUID = 1L;
private static Logger log = Logger.getLogger(RelatorioVendasBilheteiroSinteticoController.class);
@Autowired
private DataSource dataSourceRead;
@Autowired
private EmpresaService empresaService;
@Autowired
private TipoPuntoVentaService tipoPuntoVentaService;
private Datebox datInicial;
private Datebox datFinal;
private MyComboboxEstandar cmbEmpresa;
private List<Empresa> lsEmpresa;
private MyComboboxEstandar cmbTipoPuntoVenta;
private List<TipoPuntoVenta> lsTipoPuntoVenta;
@Autowired
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
private MyTextbox txtNombrePuntoVenta;
private Bandbox bbPesquisaPuntoVenta;
private MyListbox puntoVentaList;
private MyListbox puntoVentaSelList;
private Paging pagingPuntoVenta;
private MyTextbox txtBilheteiro;
@Override
public void doAfterCompose(Component comp) throws Exception {
lsEmpresa = empresaService.obtenerTodos();
lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos();
super.doAfterCompose(comp);
puntoVentaList.setItemRenderer(new RenderRelatorioVendasBilheteiroSintetico());
puntoVentaSelList.setItemRenderer(new RenderRelatorioVendasBilheteiroSinteticoSelecionados());
}
public List<Empresa> getLsEmpresa() {
return lsEmpresa;
}
public void setLsEmpresa(List<Empresa> lsEmpresa) {
this.lsEmpresa = lsEmpresa;
}
private void executarPesquisa() {
HibernateSearchObject<PuntoVenta> puntoVentaBusqueda =
new HibernateSearchObject<PuntoVenta>(PuntoVenta.class, pagingPuntoVenta.getPageSize());
puntoVentaBusqueda.addFilterILike("nombpuntoventa", "%" + txtNombrePuntoVenta.getValue() + "%");
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
puntoVentaBusqueda.addSortAsc("nombpuntoventa");
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta);
if (puntoVentaList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("relatorioVendasBilheteiroSinteticoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}
public void onClick$btnPesquisa(Event ev) {
executarPesquisa();
}
public void onDoubleClick$puntoVentaSelList(Event ev) {
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaSelList.getSelected();
puntoVentaSelList.removeItem(puntoVenta);
}
public void onDoubleClick$puntoVentaList(Event ev) {
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected();
puntoVentaSelList.addItemNovo(puntoVenta);
}
public void onClick$btnLimpar(Event ev) {
puntoVentaList.setData(new ArrayList<PuntoVenta>());
bbPesquisaPuntoVenta.setText("");
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
}
/**
* @throws Exception
*
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private void executarRelatorio() throws Exception {
Relatorio relatorio;
Map<String, Object> parametros = new HashMap<String, Object>();
StringBuilder filtro = new StringBuilder();
filtro.append("Agência: ");
String puntoVentaIds = "";
String puntoVentas = "";
List<PuntoVenta> lsPuntoVentaSelecionados = new ArrayList(Arrays.asList(puntoVentaSelList.getData()));
if (lsPuntoVentaSelecionados.isEmpty()) {
puntoVentas = "Todas";
} else {
for (int i = 0; i < lsPuntoVentaSelecionados.size(); i++) {
PuntoVenta puntoVenta = lsPuntoVentaSelecionados.get(i);
puntoVentas = puntoVentas + puntoVenta.getNombpuntoventa() + ",";
puntoVentaIds = puntoVentaIds + puntoVenta.getPuntoventaId() + ",";
}
// removendo ultima virgula
puntoVentaIds = puntoVentaIds.substring(0, puntoVentaIds.length() - 1);
puntoVentas = puntoVentas.substring(0, puntoVentas.length() - 1);
parametros.put("NUMPUNTOVENTA", puntoVentaIds);
}
filtro.append(puntoVentas).append(";");
parametros.put("DATA_INICIAL", (java.util.Date) this.datInicial.getValue());
parametros.put("DATA_FINAL", (java.util.Date) this.datFinal.getValue());
parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioVendasBilheteiroSinteticoController.window.title"));
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
filtro.append(" Empresa: ");
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
if (itemEmpresa != null) {
Empresa empresa = (Empresa) itemEmpresa.getValue();
parametros.put("EMPRESA_ID", empresa.getEmpresaId());
parametros.put("EMPRESA", empresa.getNombempresa());
filtro.append(empresa.getNombempresa() + ";");
} else {
filtro.append(" Todas;");
}
filtro.append(" Canal Vendas: ");
Comboitem itemTipoPuntoVenda = cmbTipoPuntoVenta.getSelectedItem();
if (itemTipoPuntoVenda != null) {
TipoPuntoVenta tpv = (TipoPuntoVenta) itemTipoPuntoVenda.getValue();
parametros.put("TIPOPUNTOVENTA_ID", tpv.getTipoptovtaId());
parametros.put("TIPOPUNTOVENTA", tpv.getDesctipo());
filtro.append(tpv.getDesctipo() + ";");
} else {
filtro.append(" Todos;");
}
parametros.put("FILTROS", filtro.toString());
relatorio = new RelatorioVendasBilheteiroSintetico(parametros, dataSourceRead.getConnection());
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioVendasBilheteiroSinteticoController.window.title"), args, MODAL);
}
public MyListbox getPuntoVentaSelList() {
return puntoVentaSelList;
}
public void setPuntoVentaSelList(MyListbox puntoVentaSelList) {
this.puntoVentaSelList = puntoVentaSelList;
}
public List<TipoPuntoVenta> getLsTipoPuntoVenta() {
return lsTipoPuntoVenta;
}
public void setLsTipoPuntoVenta(List<TipoPuntoVenta> lsTipoPuntoVenta) {
this.lsTipoPuntoVenta = lsTipoPuntoVenta;
}
}

View File

@ -0,0 +1,32 @@
/**
*
*/
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios;
import org.zkoss.util.resource.Labels;
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
/**
* @author Bruno Neves
*
*/
public class ItemMenuRelatorioVendasBilheteiroSintetico extends DefaultItemMenuSistema {
public ItemMenuRelatorioVendasBilheteiroSintetico() {
super("indexController.mniRelatorioVendasBilheteiroSintetico.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASBILHETEIROSINTETICO";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioVendasBilheteiroSintetico.zul",
Labels.getLabel("relatorioVendasBilheteiroSinteticoController.window.title"), getArgs() ,desktop);
}
}

View File

@ -155,6 +155,7 @@ analitico.gerenciais.financeiro.receitaDiariaAgencia=com.rjconsultores.ventabole
analitico.gerenciais.financeiro.taxas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioTaxasLinha analitico.gerenciais.financeiro.taxas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioTaxasLinha
analitico.gerenciais.financeiro.ocd=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioOCD analitico.gerenciais.financeiro.ocd=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioOCD
analitico.gerenciais.financeiro.vendasBilheteiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasBilheteiro analitico.gerenciais.financeiro.vendasBilheteiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasBilheteiro
analitico.gerenciais.financeiro.vendasBilheteiroSintetico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasBilheteiroSintetico
analitico.gerenciais.financeiro.receitaServico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioReceitaServico analitico.gerenciais.financeiro.receitaServico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioReceitaServico
analitico.gerenciais.financeiro.agenciaFechamento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAgenciaFechamento analitico.gerenciais.financeiro.agenciaFechamento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAgenciaFechamento
analitico.gerenciais.financeiro.cancelamentoVendaCartao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioCancelamentoVendaCartao analitico.gerenciais.financeiro.cancelamentoVendaCartao=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioCancelamentoVendaCartao

View File

@ -0,0 +1,40 @@
/**
*
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
/**
* @author Bruno Neves
*
*/
public class RenderRelatorioVendasBilheteiroSintetico implements ListitemRenderer {
@Override
public void render(Listitem lstm, Object o) throws Exception {
PuntoVenta puntoVenta = (PuntoVenta) o;
Listcell lc = new Listcell(puntoVenta.getNombpuntoventa());
lc.setParent(lstm);
Empresa empresa = puntoVenta.getEmpresa();
if (empresa != null) {
lc = new Listcell(empresa.getNombempresa());
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
lc = new Listcell(puntoVenta.getNumPuntoVenta());
lc.setParent(lstm);
lstm.setAttribute("data", puntoVenta);
}
}

View File

@ -0,0 +1,61 @@
/**
*
*/
package com.rjconsultores.ventaboletos.web.utilerias.render;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Button;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
/**
* @author Bruno Neves
*
*/
public class RenderRelatorioVendasBilheteiroSinteticoSelecionados implements ListitemRenderer {
public void render(Listitem lstm, Object o) throws Exception {
PuntoVenta puntoVenta = (PuntoVenta) o;
Listcell lc = new Listcell(puntoVenta.getNombpuntoventa());
lc.setParent(lstm);
Empresa empresa = puntoVenta.getEmpresa();
if (empresa != null) {
lc = new Listcell(empresa.getNombempresa());
} else {
lc = new Listcell("");
}
lc.setParent(lstm);
lc = new Listcell(puntoVenta.getNumPuntoVenta());
lc.setParent(lstm);
Button btn = new Button();
lc = new Listcell();
lc.setParent(lstm);
btn.setWidth("16");
btn.setHeight("16");
btn.setImage("/gui/img/remove.png");
btn.addEventListener("onClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
MyListbox listBox = (MyListbox) event.getTarget().getParent().getParent().getParent();
Listitem listItem = (Listitem) event.getTarget().getParent().getParent();
listBox.removeItem((PuntoVenta) listItem.getAttribute("data"));
}
});
lc.appendChild(btn);
lstm.setAttribute("data", puntoVenta);
}
}

View File

@ -259,6 +259,7 @@ indexController.mniRelatorioOCD.label = Status de OCD
indexController.mniRelatorioGratuidade.label = Gratuidades indexController.mniRelatorioGratuidade.label = Gratuidades
indexController.mniRelatorioGratuidadeIdosoDeficiente.label = Gratuidades Idoso/Deficiente indexController.mniRelatorioGratuidadeIdosoDeficiente.label = Gratuidades Idoso/Deficiente
indexController.mniRelatorioVendasBilheteiro.label = Ventas por Agente de Pasajes indexController.mniRelatorioVendasBilheteiro.label = Ventas por Agente de Pasajes
indexController.mniRelatorioVendasBilheteiroSintetico.label = Vendas por Bilheteiro Sintético
indexController.mniRelatorioAgenciasNaoImportadas.label = Reporte Puntos Venta no Importados indexController.mniRelatorioAgenciasNaoImportadas.label = Reporte Puntos Venta no Importados
indexController.mniRelatorioCheckin.label = Checkin's indexController.mniRelatorioCheckin.label = Checkin's
indexController.mniFechamentoParamgeral.label = Cierre Conta indexController.mniFechamentoParamgeral.label = Cierre Conta
@ -586,6 +587,17 @@ relatorioVendasBilheteiroController.btnLimpar.label = Limpiar
relatorioVendasBilheteiroController.lbNumero.value = Numero punto de venta relatorioVendasBilheteiroController.lbNumero.value = Numero punto de venta
relatorioVendasBilheteiroController.lbBilheteiro.value = Agente de Pasajes relatorioVendasBilheteiroController.lbBilheteiro.value = Agente de Pasajes
#Relatório de Vendas por bilheteiro Sintético
relatorioVendasBilheteiroSinteticoController.window.title = Relatório de Vendas por Bilheteiro Sintético
relatorioVendasBilheteiroSinteticoController.lbDatInicial.value = Data inicial
relatorioVendasBilheteiroSinteticoController.lbDatFinal.value = Data final
relatorioVendasBilheteiroSinteticoController.lbPuntoVenta.value = Agência
relatorioVendasBilheteiroSinteticoController.lbEmpresa.value = Empresa
relatorioVendasBilheteiroSinteticoController.btnPesquisa.label = Buscar
relatorioVendasBilheteiroSinteticoController.btnLimpar.label = Limpar
relatorioVendasBilheteiroSinteticoController.lbNumero.value = Número Agência
relatorioVendasBilheteiroSinteticoController.lbBilheteiro.value = Bilheteiro
#Reporte de Demandas #Reporte de Demandas
relatorioDemandasController.window.title = Reporte de Demandas relatorioDemandasController.window.title = Reporte de Demandas
relatorioDemandasController.lbDatInicial.value = Fecha Inicial relatorioDemandasController.lbDatInicial.value = Fecha Inicial

View File

@ -6,7 +6,7 @@
<zk xmlns="http://www.zkoss.org/2005/zul"> <zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioVendasBilheteiro" <window id="winFiltroRelatorioVendasBilheteiro"
apply="${relatorioVendasBilheteiroController}" apply="${relatorioVendasBilheteiroController}"
contentStyle="overflow:auto" height="320px" width="550px" contentStyle="overflow:auto" height="400px" width="550px"
border="normal"> border="normal">
<grid fixedLayout="true"> <grid fixedLayout="true">

View File

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winFiltroRelatorioVendasBilheteiroSintetico"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioVendasBilheteiroSintetico"
apply="${relatorioVendasBilheteiroSinteticoController}"
contentStyle="overflow:auto" height="320px" width="600px"
border="normal">
<grid fixedLayout="true">
<columns>
<column width="20%"/>
<column width="30%"/>
<column width="20%"/>
<column width="30%"/>
</columns>
<rows>
<row>
<label
value="${c:l('relatorioVendasBilheteiroSinteticoController.lbDatInicial.value')}" />
<datebox id="datInicial" width="90%"
format="dd/MM/yyyy" constraint="no empty"
maxlength="10" />
<label
value="${c:l('relatorioVendasBilheteiroSinteticoController.lbDatFinal.value')}" />
<datebox id="datFinal" width="90%"
format="dd/MM/yyyy" constraint="no empty"
maxlength="10" />
</row>
</rows>
</grid>
<grid fixedLayout="true">
<columns>
<column width="20%"/>
<column width="80%"/>
</columns>
<rows>
<row spans="1,1,2">
<label
value="${c:l('relatorioVendasBilheteiroSinteticoController.lbEmpresa.value')}" />
<combobox id="cmbEmpresa"
buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioVendasBilheteiroSintetico$composer.lsEmpresa}"
width="98%" />
</row>
<row spans="1,1,2">
<label
value="${c:l('relatorioVendasBilheteiroSinteticoController.lbCanalVendas.value')}" />
<combobox id="cmbTipoPuntoVenta"
buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioVendasBilheteiroSintetico$composer.lsTipoPuntoVenta}"
width="98%" />
</row>
<row spans="1,3">
<label
value="Agencia" />
<bandbox id="bbPesquisaPuntoVenta" width="98%"
mold="rounded" readonly="true">
<bandpopup>
<vbox>
<hbox>
<label
value="${c:l('relatorioVendasBilheteiroSinteticoController.lbPuntoVenta.value')}" />
<textbox id="txtNombrePuntoVenta"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
width="300px" mold="rounded" />
<button id="btnPesquisa"
image="/gui/img/find.png"
label="${c:l('relatorioLinhaOperacionalController.btnPesquisa.label')}" />
<button id="btnLimpar"
image="/gui/img/eraser.png"
label="${c:l('relatorioLinhaOperacionalController.btnLimpar.label')}" />
</hbox>
<paging id="pagingPuntoVenta"
pageSize="10" />
<listbox id="puntoVentaList"
mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" height="100%" width="530px">
<listhead>
<listheader
label="${c:l('relatorioVendasBilheteiroSinteticoController.lbPuntoVenta.value')}" />
<listheader width="35%"
label="${c:l('relatorioVendasBilheteiroSinteticoController.lbEmpresa.value')}" />
<listheader width="20%"
label="${c:l('relatorioVendasBilheteiroSinteticoController.lbNumero.value')}" />
</listhead>
</listbox>
</vbox>
</bandpopup>
</bandbox>
</row>
<row spans="4">
<listbox id="puntoVentaSelList" mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" height="100px" width="98%">
<listhead>
<listheader
label="${c:l('relatorioVendasBilheteiroSinteticoController.lbPuntoVenta.value')}" />
<listheader width="35%"
label="${c:l('relatorioVendasBilheteiroSinteticoController.lbEmpresa.value')}" />
<listheader width="20%"
label="${c:l('relatorioVendasBilheteiroSinteticoController.lbNumero.value')}" />
<listheader width="5%" />
</listhead>
</listbox>
<paging id="pagingSelPuntoVenta" pageSize="10" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>