lucas.calixto 2017-03-15 17:34:40 +00:00
parent ec7ac24ec4
commit dd3b971d49
11 changed files with 141 additions and 65 deletions

View File

@ -13,6 +13,7 @@ import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import com.rjconsultores.ventaboletos.constantes.Constantes; import com.rjconsultores.ventaboletos.constantes.Constantes;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource; import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioVendasComissaoBean; import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioVendasComissaoBean;
@ -32,6 +33,7 @@ public class RelatorioVendasComissao extends Relatorio {
private Timestamp fecFinal; private Timestamp fecFinal;
private Integer empresaId; private Integer empresaId;
private Boolean apenasCancelados; private Boolean apenasCancelados;
private PuntoVenta puntoVenta;
public RelatorioVendasComissao(Map<String, Object> parametros, Connection conexao) throws Exception { public RelatorioVendasComissao(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao); super(parametros, conexao);
@ -48,6 +50,13 @@ public class RelatorioVendasComissao extends Relatorio {
} }
apenasCancelados = (Boolean) parametros.get("apenasCancelados"); apenasCancelados = (Boolean) parametros.get("apenasCancelados");
Object puntoVentaParam = parametros.get("puntoVenta");
if (puntoVentaParam != null) {
puntoVenta = (PuntoVenta) puntoVentaParam;
parametros.put("nombPuntoVenta", puntoVenta.getNombpuntoventa());
} else {
parametros.put("nombPuntoVenta", "Todas;");
}
Connection conexao = this.relatorio.getConexao(); Connection conexao = this.relatorio.getConexao();
processarVendasComissao(conexao); processarVendasComissao(conexao);
@ -118,18 +127,21 @@ public class RelatorioVendasComissao extends Relatorio {
if(indice > -1) { if(indice > -1) {
relatorioVendaComissao = lsDadosRelatorio.get(indice); relatorioVendaComissao = lsDadosRelatorio.get(indice);
} }
BigDecimal total = rset.getBigDecimal("TOTAL");
BigDecimal totalTaxas = rset.getBigDecimal("TOTAL_TAXAS");
if(isVenda(indstatusboleto, indreimpresion) || isTroca(indstatusboleto, indreimpresion)) { if(isVenda(indstatusboleto, indreimpresion) || isTroca(indstatusboleto, indreimpresion)) {
relatorioVendaComissao.setTotalVendas(relatorioVendaComissao.getTotalVendas().add(rset.getBigDecimal("TOTAL") != null ? rset.getBigDecimal("TOTAL") : new BigDecimal(0))); relatorioVendaComissao.setTotalVendas(relatorioVendaComissao.getTotalVendas().add(total));
relatorioVendaComissao.setTotalTaxasVendas(relatorioVendaComissao.getTotalTaxasVendas().add(rset.getBigDecimal("TOTAL_TAXAS") != null ? rset.getBigDecimal("TOTAL_TAXAS") : new BigDecimal(0))); relatorioVendaComissao.setTotalTaxasVendas(relatorioVendaComissao.getTotalTaxasVendas().add(totalTaxas));
} else if(isCancelamentoCaja(indstatusboleto, motivocancelacionId, indreimpresion)) { } else if(isCancelamentoCaja(indstatusboleto, motivocancelacionId, indreimpresion)) {
relatorioVendaComissao.setTotalVendasCanceladas(relatorioVendaComissao.getTotalVendasCanceladas().add(rset.getBigDecimal("TOTAL") != null ? rset.getBigDecimal("TOTAL") : new BigDecimal(0))); relatorioVendaComissao.setTotalVendasCanceladas(relatorioVendaComissao.getTotalVendasCanceladas().add(total));
relatorioVendaComissao.setTotalTaxasVendasCanceladas(relatorioVendaComissao.getTotalTaxasVendasCanceladas().add(rset.getBigDecimal("TOTAL_TAXAS") != null ? rset.getBigDecimal("TOTAL_TAXAS") : new BigDecimal(0))); relatorioVendaComissao.setTotalTaxasVendasCanceladas(relatorioVendaComissao.getTotalTaxasVendasCanceladas().add(totalTaxas));
} else if(isDevolucaoCaja(indstatusboleto, motivocancelacionId, indreimpresion) || } else if(isDevolucaoCaja(indstatusboleto, motivocancelacionId, indreimpresion) ||
isDevolucaoOcdCaja(indstatusboleto, motivocancelacionId, indreimpresion) || isDevolucaoOcdCaja(indstatusboleto, motivocancelacionId, indreimpresion) ||
isDevolucaoTrocaCaja(indstatusboleto, motivocancelacionId, indreimpresion)) { isDevolucaoTrocaCaja(indstatusboleto, motivocancelacionId, indreimpresion)) {
relatorioVendaComissao.setTotalVendasDevolucao(relatorioVendaComissao.getTotalVendasDevolucao().add(rset.getBigDecimal("TOTAL") != null ? rset.getBigDecimal("TOTAL") : new BigDecimal(0))); relatorioVendaComissao.setTotalVendasDevolucao(relatorioVendaComissao.getTotalVendasDevolucao().add(total));
relatorioVendaComissao.setTotalTaxasVendasDevolucao(relatorioVendaComissao.getTotalTaxasVendasDevolucao().add(rset.getBigDecimal("TOTAL_TAXAS") != null ? rset.getBigDecimal("TOTAL_TAXAS") : new BigDecimal(0))); relatorioVendaComissao.setTotalTaxasVendasDevolucao(relatorioVendaComissao.getTotalTaxasVendasDevolucao().add(totalTaxas));
} }
if(indice == -1) { if(indice == -1) {
@ -151,6 +163,7 @@ public class RelatorioVendasComissao extends Relatorio {
relatorioVendaComissao.setNumAsiento(rset.getString("NUMASIENTO")); relatorioVendaComissao.setNumAsiento(rset.getString("NUMASIENTO"));
relatorioVendaComissao.setPrecioTotalPagado(rset.getBigDecimal("TOTAL")); relatorioVendaComissao.setPrecioTotalPagado(rset.getBigDecimal("TOTAL"));
relatorioVendaComissao.setFecHorVenta(rset.getDate("FECHORVENTA")); relatorioVendaComissao.setFecHorVenta(rset.getDate("FECHORVENTA"));
relatorioVendaComissao.setNombPuntoVenta(rset.getString("NOMBPUNTOVENTA"));
lsDadosRelatorioCancelamento.add(relatorioVendaComissao); lsDadosRelatorioCancelamento.add(relatorioVendaComissao);
} }
@ -206,6 +219,9 @@ public class RelatorioVendasComissao extends Relatorio {
if(empresaId != null){ if(empresaId != null){
stmt.setInt("EMPRESA_ID", empresaId); stmt.setInt("EMPRESA_ID", empresaId);
} }
if (puntoVenta != null) {
stmt.setInt("puntoVentaId", puntoVenta.getPuntoventaId());
}
return stmt; return stmt;
} }
@ -219,23 +235,21 @@ public class RelatorioVendasComissao extends Relatorio {
.append("FROM CAJA C ") .append("FROM CAJA C ")
.append("JOIN PUNTO_VENTA PV ON PV.PUNTOVENTA_ID = C.PUNTOVENTA_ID ") .append("JOIN PUNTO_VENTA PV ON PV.PUNTOVENTA_ID = C.PUNTOVENTA_ID ")
.append("JOIN MARCA M ON M.MARCA_ID = C.MARCA_ID ") .append("JOIN MARCA M ON M.MARCA_ID = C.MARCA_ID ")
.append("LEFT JOIN PUNTO_VENTA PV1 ON PV1.PUNTOVENTA_ID = C.PTOVTAVENTA_ID "); .append("LEFT JOIN PUNTO_VENTA PV1 ON PV1.PUNTOVENTA_ID = C.PTOVTAVENTA_ID ")
.append("WHERE ((C.INDSTATUSBOLETO = 'V' AND C.INDREIMPRESION = 0) ")
if (apenasCancelados) { .append("OR (C.INDSTATUSBOLETO = 'T' AND C.INDREIMPRESION = 0) ")
sQuery.append(" WHERE (C.INDCANCELACION = 1 AND C.INDSTATUSBOLETO = 'C') "); .append("OR (C.INDCANCELACION = 1 AND C.INDSTATUSBOLETO = 'C')) ");
} else { if (puntoVenta != null) {
sQuery.append("WHERE ((C.INDSTATUSBOLETO = 'V' AND C.INDREIMPRESION = 0)" sQuery.append("AND C.PUNTOVENTA_ID = :puntoVentaId ");
+ " OR (C.INDSTATUSBOLETO = 'T' AND C.INDREIMPRESION = 0) "
+ "OR (C.INDCANCELACION = 1 AND C.INDSTATUSBOLETO = 'C')) ");
} }
sQuery.append("AND C.FECHORVENTA BETWEEN :fecInicio AND :fecFinal "); sQuery.append("AND C.FECHORVENTA BETWEEN :fecInicio AND :fecFinal ");
if(parametros.get("EMPRESA_ID")!= null){ if(parametros.get("EMPRESA_ID")!= null){
sQuery.append("AND M.EMPRESA_ID =:EMPRESA_ID "); sQuery.append("AND M.EMPRESA_ID =:EMPRESA_ID ");
} }
sQuery.append("GROUP BY PV.PUNTOVENTA_ID, PV.NUMPUNTOVENTA, PV.NOMBPUNTOVENTA, C.PTOVTAVENTA_ID, PV1.NUMPUNTOVENTA, PV1.NOMBPUNTOVENTA, C.INDSTATUSBOLETO, C.MOTIVOCANCELACION_ID, C.INDREIMPRESION ") sQuery.append("GROUP BY PV.PUNTOVENTA_ID, PV.NUMPUNTOVENTA, PV.NOMBPUNTOVENTA, C.PTOVTAVENTA_ID, PV1.NUMPUNTOVENTA, PV1.NOMBPUNTOVENTA, C.INDSTATUSBOLETO, C.MOTIVOCANCELACION_ID, C.INDREIMPRESION ")
.append("ORDER BY PV.NUMPUNTOVENTA, PV1.NUMPUNTOVENTA, C.INDSTATUSBOLETO"); .append("ORDER BY PV.NUMPUNTOVENTA, PV1.NUMPUNTOVENTA, C.INDSTATUSBOLETO");
return sQuery.toString(); return sQuery.toString();
} }
@ -244,17 +258,24 @@ public class RelatorioVendasComissao extends Relatorio {
StringBuilder sQuery = new StringBuilder(); StringBuilder sQuery = new StringBuilder();
sQuery.append("SELECT C.NUMFOLIOSISTEMA, C.CORRIDA_ID, C.FECHORVIAJE, C.NUMASIENTO, C.PRECIOPAGADO, C.FECHORVENTA, ") sQuery.append("SELECT C.NUMFOLIOSISTEMA, C.CORRIDA_ID, C.FECHORVIAJE, C.NUMASIENTO, C.PRECIOPAGADO, C.FECHORVENTA, PV.NOMBPUNTOVENTA, ")
.append("(COALESCE (C.PRECIOPAGADO,0) + COALESCE (C.IMPORTETAXAEMBARQUE,0) + COALESCE (C.IMPORTESEGURO,0) + COALESCE (C.IMPORTEPEDAGIO,0) + COALESCE (C.IMPORTEOUTROS,0)) AS TOTAL ") .append("(COALESCE (C.PRECIOPAGADO,0) + COALESCE (C.IMPORTETAXAEMBARQUE,0) + COALESCE (C.IMPORTESEGURO,0) + COALESCE (C.IMPORTEPEDAGIO,0) + COALESCE (C.IMPORTEOUTROS,0)) AS TOTAL ")
.append("FROM CAJA C ") .append("FROM CAJA C ")
.append("JOIN MARCA M ON M.MARCA_ID = C.MARCA_ID ") .append("JOIN MARCA M ON M.MARCA_ID = C.MARCA_ID ")
.append("WHERE C.INDCANCELACION = 1 AND C.INDSTATUSBOLETO = 'C' "); .append("JOIN PUNTO_VENTA PV ON PV.PUNTOVENTA_ID = C.PUNTOVENTA_ID ")
.append("WHERE C.INDSTATUSBOLETO = 'C' ")
.append("AND ((C.MOTIVOCANCELACION_ID IN(32, 10) AND C.INDREIMPRESION = 0) ")
.append("OR (C.MOTIVOCANCELACION_ID = 99 AND C.INDREIMPRESION = 1)) ");
sQuery.append("AND C.FECHORVENTA BETWEEN :fecInicio AND :fecFinal "); sQuery.append("AND C.FECHORVENTA BETWEEN :fecInicio AND :fecFinal ");
if(parametros.get("EMPRESA_ID")!= null) { if(parametros.get("EMPRESA_ID")!= null) {
sQuery.append("AND M.EMPRESA_ID =:EMPRESA_ID "); sQuery.append("AND M.EMPRESA_ID =:EMPRESA_ID ");
} }
if (puntoVenta != null) {
sQuery.append("AND C.PUNTOVENTA_ID = :puntoVentaId ");
}
return sQuery.toString(); return sQuery.toString();
} }

View File

@ -18,4 +18,6 @@ label.corridaId=N
label.fecHorViaje=Data Servicio label.fecHorViaje=Data Servicio
label.numAsiento=Número de Asiento label.numAsiento=Número de Asiento
label.precioTotalPagado=Valor de Entradas label.precioTotalPagado=Valor de Entradas
label.fecHorVenta=Fecha de Regreso label.fecHorVenta=Fecha de Regreso
label.puntoVenta=Agência
label.nombPuntoVenta=Nome Agência

View File

@ -18,4 +18,6 @@ label.corridaId=N
label.fecHorViaje=Data do Serviço label.fecHorViaje=Data do Serviço
label.numAsiento=Poltrona label.numAsiento=Poltrona
label.precioTotalPagado=Valor do Bilhete label.precioTotalPagado=Valor do Bilhete
label.fecHorVenta=Data da Devolução label.fecHorVenta=Data da Devolução
label.puntoVenta=Agência
label.nombPuntoVenta=Nome Agência

View File

@ -20,4 +20,5 @@ label.totalVendasCanceladas=Anula
label.totalTaxasVendasCanceladas=Taxas Anulação label.totalTaxasVendasCanceladas=Taxas Anulação
label.totalVendasDevolucao=Devolução label.totalVendasDevolucao=Devolução
label.totalTaxasVendasDevolucao=Taxas Devolução label.totalTaxasVendasDevolucao=Taxas Devolução
label.total=Total label.total=Total
label.puntoVenta=Agência:

View File

@ -20,4 +20,5 @@ label.totalVendasCanceladas=Anula
label.totalTaxasVendasCanceladas=Taxas Anulação label.totalTaxasVendasCanceladas=Taxas Anulação
label.totalVendasDevolucao=Devolução label.totalVendasDevolucao=Devolução
label.totalTaxasVendasDevolucao=Taxas Devolução label.totalTaxasVendasDevolucao=Taxas Devolução
label.total=Total label.total=Total
label.puntoVenta=Agência:

View File

@ -7,7 +7,7 @@
<parameter name="fecFinal" class="java.lang.String"/> <parameter name="fecFinal" class="java.lang.String"/>
<parameter name="noDataRelatorio" class="java.lang.String"/> <parameter name="noDataRelatorio" class="java.lang.String"/>
<parameter name="empresa" class="java.lang.String"/> <parameter name="empresa" class="java.lang.String"/>
<parameter name="apenasCancelados" class="java.lang.Boolean"/> <parameter name="nombPuntoVenta" class="java.lang.String"/>
<queryString> <queryString>
<![CDATA[]]> <![CDATA[]]>
</queryString> </queryString>
@ -74,11 +74,14 @@
<text><![CDATA[Empresa:]]></text> <text><![CDATA[Empresa:]]></text>
</staticText> </staticText>
<textField> <textField>
<reportElement uuid="f1811f21-420c-4faf-87d2-2d46e1b74118" x="0" y="61" width="139" height="20"/> <reportElement uuid="1a29d731-e121-4507-8c0b-e93f437e8d80" x="0" y="61" width="53" height="20"/>
<textElement> <textElement/>
<font isBold="true" pdfFontName="Helvetica-Bold"/> <textFieldExpression><![CDATA[$R{label.puntoVenta}]]></textFieldExpression>
</textElement> </textField>
<textFieldExpression><![CDATA[$P{apenasCancelados} ? "Apenas cancelamentos" : ""]]></textFieldExpression> <textField>
<reportElement uuid="53d53aa5-d8c9-43c6-b17d-1e6b49697237" x="53" y="61" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{nombPuntoVenta}]]></textFieldExpression>
</textField> </textField>
</band> </band>
</title> </title>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?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="RelatorioVendasComissao" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="84b9dfcf-8ec5-4f51-80cc-7339e3b158b4"> <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="RelatorioVendasComissao" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="84b9dfcf-8ec5-4f51-80cc-7339e3b158b4">
<property name="ireport.zoom" value="1.0"/> <property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="91"/> <property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="32"/>
<parameter name="fecInicio" class="java.lang.String"/> <parameter name="fecInicio" class="java.lang.String"/>
<parameter name="fecFinal" class="java.lang.String"/> <parameter name="fecFinal" class="java.lang.String"/>
<parameter name="noDataRelatorio" class="java.lang.String"/> <parameter name="noDataRelatorio" class="java.lang.String"/>
<parameter name="empresa" class="java.lang.String"/> <parameter name="empresa" class="java.lang.String"/>
<parameter name="apenasCancelados" class="java.lang.Boolean"/> <parameter name="nombPuntoVenta" class="java.lang.String"/>
<queryString> <queryString>
<![CDATA[]]> <![CDATA[]]>
</queryString> </queryString>
@ -17,6 +17,7 @@
<field name="numAsiento" class="java.lang.String"/> <field name="numAsiento" class="java.lang.String"/>
<field name="precioTotalPagado" class="java.math.BigDecimal"/> <field name="precioTotalPagado" class="java.math.BigDecimal"/>
<field name="fecHorVenta" class="java.util.Date"/> <field name="fecHorVenta" class="java.util.Date"/>
<field name="nombPuntoVenta" class="java.lang.String"/>
<variable name="vPrecioTotalPagado" class="java.math.BigDecimal" calculation="Sum"> <variable name="vPrecioTotalPagado" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{precioTotalPagado}]]></variableExpression> <variableExpression><![CDATA[$F{precioTotalPagado}]]></variableExpression>
</variable> </variable>
@ -26,47 +27,52 @@
<title> <title>
<band height="81" splitType="Stretch"> <band height="81" splitType="Stretch">
<textField> <textField>
<reportElement x="0" y="0" width="620" height="20" uuid="43b2c28d-4760-4890-b00d-25e931e79c74"/> <reportElement uuid="43b2c28d-4760-4890-b00d-25e931e79c74" x="0" y="0" width="620" height="20"/>
<textElement markup="none"> <textElement markup="none">
<font size="14" isBold="true"/> <font size="14" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{cabecalho.nome}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.nome}]]></textFieldExpression>
</textField> </textField>
<textField pattern="dd/MM/yyyy HH:mm"> <textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="638" y="0" width="164" height="20" uuid="4d1bcd65-c9a6-44b4-8dca-cc3c4c20c9a5"/> <reportElement uuid="4d1bcd65-c9a6-44b4-8dca-cc3c4c20c9a5" x="638" y="0" width="164" height="20"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font isBold="true"/> <font isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="0" y="20" width="620" height="20" uuid="fd05bd35-30d9-4baf-aa56-f8e5d3c3268b"/> <reportElement uuid="fd05bd35-30d9-4baf-aa56-f8e5d3c3268b" x="0" y="20" width="620" height="20"/>
<textElement> <textElement>
<font isBold="true"/> <font isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodo} + " " + $P{fecInicio} + " " + $R{cabecalho.periodoA} + " " + $P{fecFinal}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.periodo} + " " + $P{fecInicio} + " " + $R{cabecalho.periodoA} + " " + $P{fecFinal}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="53" y="41" width="139" height="20" uuid="8fa1c53b-1da7-4d4d-a75c-ab1543acae2a"/> <reportElement uuid="8fa1c53b-1da7-4d4d-a75c-ab1543acae2a" x="53" y="41" width="139" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{empresa}]]></textFieldExpression> <textFieldExpression><![CDATA[$P{empresa}]]></textFieldExpression>
</textField> </textField>
<staticText> <staticText>
<reportElement x="0" y="41" width="53" height="20" uuid="a91f6081-4740-4e36-8965-41b6cde4cc20"/> <reportElement uuid="a91f6081-4740-4e36-8965-41b6cde4cc20" x="0" y="41" width="53" height="20"/>
<textElement/>
<text><![CDATA[Empresa:]]></text> <text><![CDATA[Empresa:]]></text>
</staticText> </staticText>
<textField> <textField>
<reportElement x="0" y="61" width="139" height="20" uuid="f1811f21-420c-4faf-87d2-2d46e1b74118"/> <reportElement uuid="96d6ce56-5bf3-460a-b3ba-a81890a2caed" x="0" y="61" width="53" height="20"/>
<textElement> <textElement/>
<font isBold="true" pdfFontName="Helvetica-Bold"/> <textFieldExpression><![CDATA[$R{label.puntoVenta}]]></textFieldExpression>
</textElement> </textField>
<textFieldExpression><![CDATA[$P{apenasCancelados} ? "Apenas cancelamentos" : ""]]></textFieldExpression> <textField>
<reportElement uuid="b75cac86-9c93-40ec-b667-afd66f26103d" x="53" y="61" width="139" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{nombPuntoVenta}]]></textFieldExpression>
</textField> </textField>
</band> </band>
</title> </title>
<pageHeader> <pageHeader>
<band height="21" splitType="Stretch"> <band height="21" splitType="Stretch">
<textField> <textField>
<reportElement x="607" y="0" width="195" height="20" uuid="6a8a0843-7236-40a3-98ae-5fbf59b4cfec"/> <reportElement uuid="6a8a0843-7236-40a3-98ae-5fbf59b4cfec" x="607" y="0" width="195" height="20"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font isBold="true"/> <font isBold="true"/>
</textElement> </textElement>
@ -77,62 +83,82 @@
<columnHeader> <columnHeader>
<band height="23" splitType="Stretch"> <band height="23" splitType="Stretch">
<textField> <textField>
<reportElement x="0" y="0" width="102" height="20" uuid="a3dea313-f2a7-4388-bd91-5c02e8612b8e"/> <reportElement uuid="a3dea313-f2a7-4388-bd91-5c02e8612b8e" x="0" y="0" width="102" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.numFolioSistema}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.numFolioSistema}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="721" y="0" width="80" height="20" uuid="a2ea7cea-d8ab-4c0e-bee0-4dafb3866c1f"/> <reportElement uuid="a2ea7cea-d8ab-4c0e-bee0-4dafb3866c1f" x="721" y="0" width="80" height="20"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.precioTotalPagado}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.precioTotalPagado}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="556" y="0" width="120" height="20" uuid="43d6ee75-8459-4b9e-8cbe-ca2819d3198a"/> <reportElement uuid="43d6ee75-8459-4b9e-8cbe-ca2819d3198a" x="580" y="0" width="120" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.fecHorVenta}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.fecHorVenta}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="263" y="1" width="80" height="20" uuid="2d666aaf-65a6-4c3f-acd3-e65483a78256"/> <reportElement uuid="2d666aaf-65a6-4c3f-acd3-e65483a78256" x="357" y="1" width="80" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.numAsiento}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.numAsiento}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement x="388" y="1" width="120" height="20" uuid="8a39b1b1-6ebd-4f33-adea-c28a9988eaae"/> <reportElement uuid="8a39b1b1-6ebd-4f33-adea-c28a9988eaae" x="437" y="1" width="120" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.fecHorViaje}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.fecHorViaje}]]></textFieldExpression>
</textField> </textField>
<line> <line>
<reportElement positionType="Float" x="0" y="21" width="802" height="1" uuid="811af238-a027-48e9-bd6f-eee885474929"/> <reportElement uuid="811af238-a027-48e9-bd6f-eee885474929" positionType="Float" x="0" y="21" width="802" height="1"/>
</line> </line>
<textField> <textField>
<reportElement x="129" y="0" width="100" height="20" uuid="cfac237e-06b7-4c98-b7f1-285f5ec2c8b3"/> <reportElement uuid="cfac237e-06b7-4c98-b7f1-285f5ec2c8b3" x="122" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.corridaId}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.corridaId}]]></textFieldExpression>
</textField> </textField>
<textField>
<reportElement uuid="fba2b82b-5c64-4262-9f82-6a96f3c8f74e" x="244" y="0" width="112" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.nombPuntoVenta}]]></textFieldExpression>
</textField>
</band> </band>
</columnHeader> </columnHeader>
<detail> <detail>
<band height="22" splitType="Stretch"> <band height="22" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="721" y="0" width="80" height="20" isPrintWhenDetailOverflows="true" uuid="b18fae2e-6454-42b0-a68c-04cf790ddfd6"/> <reportElement uuid="b18fae2e-6454-42b0-a68c-04cf790ddfd6" stretchType="RelativeToTallestObject" x="721" y="0" width="80" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{precioTotalPagado}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{precioTotalPagado}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="129" y="0" width="100" height="20" isPrintWhenDetailOverflows="true" uuid="cebb836f-d485-4d50-98e0-0678bb715fb9"/> <reportElement uuid="cebb836f-d485-4d50-98e0-0678bb715fb9" stretchType="RelativeToTallestObject" x="122" y="0" width="100" height="20" isPrintWhenDetailOverflows="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{corridaId}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{corridaId}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="263" y="1" width="80" height="20" isPrintWhenDetailOverflows="true" uuid="09b0cd36-1946-406f-923a-172b8a4f1ac6"/> <reportElement uuid="09b0cd36-1946-406f-923a-172b8a4f1ac6" stretchType="RelativeToTallestObject" x="357" y="1" width="80" height="20" isPrintWhenDetailOverflows="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{numAsiento}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{numAsiento}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy h.mm a" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="dd/MM/yyyy h.mm a" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="388" y="1" width="120" height="20" isPrintWhenDetailOverflows="true" uuid="8cdbdd14-c9f1-45d8-bf41-a4066930f5a4"/> <reportElement uuid="8cdbdd14-c9f1-45d8-bf41-a4066930f5a4" stretchType="RelativeToTallestObject" x="437" y="1" width="120" height="20" isPrintWhenDetailOverflows="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{fecHorViaje}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{fecHorViaje}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="102" height="20" isPrintWhenDetailOverflows="true" uuid="c98526c0-c36f-42df-9308-452ac671044c"/> <reportElement uuid="c98526c0-c36f-42df-9308-452ac671044c" stretchType="RelativeToTallestObject" x="0" y="0" width="102" height="20" isPrintWhenDetailOverflows="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{numFolioSistema}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{numFolioSistema}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy h.mm a" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="dd/MM/yyyy h.mm a" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="556" y="0" width="120" height="20" isPrintWhenDetailOverflows="true" uuid="040c8de3-f836-40bc-96bd-761a7f5b46ef"/> <reportElement uuid="040c8de3-f836-40bc-96bd-761a7f5b46ef" stretchType="RelativeToTallestObject" x="580" y="0" width="120" height="20" isPrintWhenDetailOverflows="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{fecHorVenta}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{fecHorVenta}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="d3e27fd7-7159-4d76-8cc7-d346ecc188d4" stretchType="RelativeToTallestObject" x="244" y="0" width="112" height="20" isPrintWhenDetailOverflows="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{nombPuntoVenta}]]></textFieldExpression>
</textField>
</band> </band>
</detail> </detail>
<columnFooter> <columnFooter>
@ -144,15 +170,15 @@
<summary> <summary>
<band height="26" splitType="Stretch"> <band height="26" splitType="Stretch">
<line> <line>
<reportElement positionType="Float" x="0" y="2" width="802" height="1" uuid="c8dfd524-14cc-454c-afc0-3ce9f8d0ead8"/> <reportElement uuid="c8dfd524-14cc-454c-afc0-3ce9f8d0ead8" positionType="Float" x="0" y="2" width="802" height="1"/>
</line> </line>
<textField> <textField>
<reportElement x="104" y="5" width="615" height="20" uuid="38a0f957-1b50-46f9-b79f-c631baf8937b"/> <reportElement uuid="38a0f957-1b50-46f9-b79f-c631baf8937b" x="104" y="5" width="615" height="20"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true"> <textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="721" y="5" width="80" height="20" isPrintWhenDetailOverflows="true" uuid="f22b1a6f-2e0b-4771-acf3-b7460874f730"/> <reportElement uuid="f22b1a6f-2e0b-4771-acf3-b7460874f730" stretchType="RelativeToTallestObject" x="721" y="5" width="80" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"> <textElement textAlignment="Right">
<font isBold="true"/> <font isBold="true"/>
</textElement> </textElement>
@ -163,7 +189,7 @@
<noData> <noData>
<band height="24"> <band height="24">
<textField isBlankWhenNull="true"> <textField isBlankWhenNull="true">
<reportElement positionType="Float" x="0" y="0" width="555" height="20" isPrintWhenDetailOverflows="true" uuid="d7df66c6-4dc0-4f3b-88f4-b22094d29091"/> <reportElement uuid="d7df66c6-4dc0-4f3b-88f4-b22094d29091" positionType="Float" x="0" y="0" width="555" height="20" isPrintWhenDetailOverflows="true"/>
<textElement verticalAlignment="Middle"/> <textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField> </textField>

View File

@ -16,6 +16,8 @@ public class RelatorioVendasComissaoCancelamentoBean {
private BigDecimal precioTotalPagado; private BigDecimal precioTotalPagado;
private Date fecHorVenta; private Date fecHorVenta;
private String nombPuntoVenta;
public String getNumFolioSistema() { public String getNumFolioSistema() {
return numFolioSistema; return numFolioSistema;
@ -65,4 +67,12 @@ public class RelatorioVendasComissaoCancelamentoBean {
this.fecHorVenta = fecHorVenta; this.fecHorVenta = fecHorVenta;
} }
public String getNombPuntoVenta() {
return nombPuntoVenta;
}
public void setNombPuntoVenta(String nombPuntoVenta) {
this.nombPuntoVenta = nombPuntoVenta;
}
} }

View File

@ -20,11 +20,13 @@ import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox; import org.zkoss.zul.Datebox;
import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioVendasComissao; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioVendasComissao;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@Controller("relatorioVendasComissaoController") @Controller("relatorioVendasComissaoController")
@ -45,6 +47,7 @@ public class RelatorioVendasComissaoController extends MyGenericForwardComposer
private Datebox dataInicial; private Datebox dataInicial;
private Datebox dataFinal; private Datebox dataFinal;
private Checkbox chkApenasCancelados; private Checkbox chkApenasCancelados;
private MyComboboxPuntoVenta cmbPuntoVenta;
@Override @Override
public void doAfterCompose(Component comp) throws Exception { public void doAfterCompose(Component comp) throws Exception {
@ -78,6 +81,13 @@ public class RelatorioVendasComissaoController extends MyGenericForwardComposer
parametros.put("apenasCancelados", chkApenasCancelados.isChecked()); parametros.put("apenasCancelados", chkApenasCancelados.isChecked());
Comboitem cmbItemPuntoVenta = cmbPuntoVenta.getSelectedItem();
if (cmbItemPuntoVenta != null) {
PuntoVenta puntoVenta = (PuntoVenta) cmbItemPuntoVenta.getValue();
parametros.put("puntoVenta", puntoVenta);
parametros.put("nombPuntoVenta", puntoVenta.getNombpuntoventa());
}
Relatorio relatorio = new RelatorioVendasComissao(parametros, dataSourceRead.getConnection()); Relatorio relatorio = new RelatorioVendasComissao(parametros, dataSourceRead.getConnection());
Map<String, Object> args = new HashMap<String, Object>(); Map<String, Object> args = new HashMap<String, Object>();