fixes bug#3303

master
Aristides 2023-10-31 11:35:03 -03:00
parent 9cf79e7bcc
commit ae7a632bee
5 changed files with 45 additions and 21 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId> <groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId> <artifactId>ventaboletosadm</artifactId>
<version>1.26.2</version> <version>1.26.3</version>
<packaging>war</packaging> <packaging>war</packaging>
<properties> <properties>

View File

@ -53,6 +53,7 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
} }
private void carregarDataResult(ResultSet rset, Map<String, Object> dataResult) throws SQLException { private void carregarDataResult(ResultSet rset, Map<String, Object> dataResult) throws SQLException {
dataResult.put("DATA_EVENTO", rset.getDate("DATA_EVENTO"));
dataResult.put("CODIGO_AGENCIA", rset.getString("CODIGO_AGENCIA")); dataResult.put("CODIGO_AGENCIA", rset.getString("CODIGO_AGENCIA"));
dataResult.put("NOME_AGENCIA", rset.getString("NOME_AGENCIA")); dataResult.put("NOME_AGENCIA", rset.getString("NOME_AGENCIA"));
dataResult.put("CODIGO_BILHETEIRO", rset.getString("CODIGO_BILHETEIRO")); dataResult.put("CODIGO_BILHETEIRO", rset.getString("CODIGO_BILHETEIRO"));
@ -83,11 +84,13 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
if (!StringUtils.isBlank(formasPagamento)) { if (!StringUtils.isBlank(formasPagamento)) {
final String[] formaPagamento = formasPagamento.split("\\;"); final String[] formaPagamento = formasPagamento.split("\\;");
if (formaPagamento.length > 1) { if (formaPagamento.length > 1) {
int contador = 0; int contador = 1;
while (contador < formaPagamento.length) { int contadorFormaPagamento =0;
String valorformapago = "VALORFORMAPAGO" + contador+1; while (contador <=formaPagamento.length) {
dataResult.put(valorformapago, formatarValorFormaDePagamento(formaPagamento[contador])); String valorformapago = "VALORFORMAPAGO" + contador;
dataResult.put(valorformapago, formatarValorFormaDePagamento(formaPagamento[contadorFormaPagamento]));
contador ++; contador ++;
contadorFormaPagamento++;
} }
} else { } else {
@ -100,11 +103,14 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
if (!StringUtils.isBlank(formasPagamento)) { if (!StringUtils.isBlank(formasPagamento)) {
final String[] formaPagamento = formasPagamento.split("\\;"); final String[] formaPagamento = formasPagamento.split("\\;");
if (formaPagamento.length > 1) { if (formaPagamento.length > 1) {
int contador = 0; int contador = 1;
while (contador < formaPagamento.length) { int contadorFormaPagamento =0;
String formaPago = "FORMAPAGO" + contador+1; while (contador <= formaPagamento.length) {
dataResult.put(formaPago, formatarFormaDePagamento(formaPagamento[contador])); String formaPago = "FORMAPAGO" + contador;
dataResult.put(formaPago, formatarFormaDePagamento(formaPagamento[contadorFormaPagamento]));
contador ++; contador ++;
contadorFormaPagamento ++;
} }
} else { } else {
@ -125,7 +131,7 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
} }
private void getSQL(Map<String, Object> parametros, StringBuilder sql) { private void getSQL(Map<String, Object> parametros, StringBuilder sql) {
sql.append(" select pv.NUMPUNTOVENTA CODIGO_AGENCIA, "); sql.append(" select c.feccreacion DATA_EVENTO, pv.NUMPUNTOVENTA CODIGO_AGENCIA, ");
sql.append(" pv.NOMBPUNTOVENTA NOME_AGENCIA, "); sql.append(" pv.NOMBPUNTOVENTA NOME_AGENCIA, ");
sql.append(" u.CVEUSUARIO CODIGO_BILHETEIRO, "); sql.append(" u.CVEUSUARIO CODIGO_BILHETEIRO, ");
sql.append(" u.NOMBUSUARIO NOME_BILHETEIRO, "); sql.append(" u.NOMBUSUARIO NOME_BILHETEIRO, ");
@ -144,7 +150,7 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
" (NVL(c.PRECIOPAGADO,0)+(NVL(c.IMPORTEPEDAGIO,0)+ NVL(c.IMPORTETAXAEMBARQUE,0)+ NVL(c.IMPORTESEGURO,0))) TOTAL_BILHETE, "); " (NVL(c.PRECIOPAGADO,0)+(NVL(c.IMPORTEPEDAGIO,0)+ NVL(c.IMPORTETAXAEMBARQUE,0)+ NVL(c.IMPORTESEGURO,0))) TOTAL_BILHETE, ");
sql.append(" cs.DESCCLASE CLASSE, "); sql.append(" cs.DESCCLASE CLASSE, ");
sql.append( sql.append(
" LISTAGG(fp.cvepago||' /'||CAST(cf.IMPORTE AS VARCHAR(10)),';') WITHIN GROUP( ORDER BY 1 DESC ) AS descpago, "); " LISTAGG(DISTINCT cf.cajaformapago_id||' /'|| fp.cvepago||' /'||CAST(cf.IMPORTE AS VARCHAR(10)),';') WITHIN GROUP( ORDER BY 1 DESC ) AS descpago, ");
sql.append(" e.empresa_id EMPRESAAUTORIZADORA_ID, e.nombempresa EMPRESAAUTORIZADORA, "); sql.append(" e.empresa_id EMPRESAAUTORIZADORA_ID, e.nombempresa EMPRESAAUTORIZADORA, ");
sql.append(" c.num_bpe NUMBPE "); sql.append(" c.num_bpe NUMBPE ");
@ -169,7 +175,7 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
sql.append(" and c.FECHORVENTA <= :DATA_FINAL "); sql.append(" and c.FECHORVENTA <= :DATA_FINAL ");
sql.append(" and ((c.indreimpresion = 1 "); sql.append(" and ((c.indreimpresion = 1 ");
sql.append( sql.append(
" AND (c.motivoreimpresion_id = 99 or c.motivocancelacion_id in (27) )) or c.indreimpresion = 0) "); " AND (c.motivoreimpresion_id = 99 )) or c.indreimpresion = 0) ");
if (parametros.get("NUMPUNTOVENTA") != null && !possuiFiltroTodos("NUMPUNTOVENTA")) { if (parametros.get("NUMPUNTOVENTA") != null && !possuiFiltroTodos("NUMPUNTOVENTA")) {
sql.append(" and pv.PUNTOVENTA_ID IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")"); sql.append(" and pv.PUNTOVENTA_ID IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")");
} }
@ -177,6 +183,7 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
sql.append(" and u.NOMBUSUARIO like '" + parametros.get("BILHETEIRO") + "%'"); sql.append(" and u.NOMBUSUARIO like '" + parametros.get("BILHETEIRO") + "%'");
} }
sql.append(" GROUP BY "); sql.append(" GROUP BY ");
sql.append(" c.feccreacion, ");
sql.append(" pv.numpuntoventa, "); sql.append(" pv.numpuntoventa, ");
sql.append(" pv.nombpuntoventa, "); sql.append(" pv.nombpuntoventa, ");
sql.append(" u.cveusuario, "); sql.append(" u.cveusuario, ");
@ -207,6 +214,7 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
sql.append(" u.NOMBUSUARIO, "); sql.append(" u.NOMBUSUARIO, ");
sql.append(" pv.NUMPUNTOVENTA, "); sql.append(" pv.NUMPUNTOVENTA, ");
sql.append(" pv.NOMBPUNTOVENTA, "); sql.append(" pv.NOMBPUNTOVENTA, ");
sql.append(" c.feccreacion, ");
sql.append(" c.NUMFOLIOSISTEMA, "); sql.append(" c.NUMFOLIOSISTEMA, ");
sql.append(" p_origen.DESCPARADA, "); sql.append(" p_origen.DESCPARADA, ");
sql.append(" p_destino.DESCPARADA, "); sql.append(" p_destino.DESCPARADA, ");
@ -227,7 +235,7 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
private String formatarFormaDePagamento(String formaDePagamento) { private String formatarFormaDePagamento(String formaDePagamento) {
if (formaDePagamento != null) { if (formaDePagamento != null) {
final String[] formaPagamentoAuxilar = formaDePagamento.split("\\/"); final String[] formaPagamentoAuxilar = formaDePagamento.split("\\/");
return formaPagamentoAuxilar[0]; return formaPagamentoAuxilar[1];
} }
return null; return null;
} }
@ -235,7 +243,7 @@ public class RelatorioVendaBilhetePorEmpresaAutorizadoraAnalitico extends Relato
private BigDecimal formatarValorFormaDePagamento(String formaDePagamento){ private BigDecimal formatarValorFormaDePagamento(String formaDePagamento){
if(formaDePagamento!=null){ if(formaDePagamento!=null){
final String[] formaPagamentoAuxilar = formaDePagamento.split("\\/") ; final String[] formaPagamentoAuxilar = formaDePagamento.split("\\/") ;
return formaPagamentoAuxilar.length>1? new BigDecimal(formaPagamentoAuxilar[1].replace(",", ".").trim()):new BigDecimal("0.0"); return formaPagamentoAuxilar.length>2? new BigDecimal(formaPagamentoAuxilar[2].replace(",", ".").trim()):new BigDecimal("0.0");
} }
return null; return null;
} }

View File

@ -1,7 +1,7 @@
<?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="RelatorioVendaBilhetePorEmpresaAutorizadora" pageWidth="1900" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="1860" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b92fb063-a827-4619-8a69-5c78e3afbb8c"> <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="RelatorioVendaBilhetePorEmpresaAutorizadora" pageWidth="1900" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="1860" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b92fb063-a827-4619-8a69-5c78e3afbb8c">
<property name="ireport.zoom" value="1.610510000000003"/> <property name="ireport.zoom" value="1.610510000000003"/>
<property name="ireport.x" value="1719"/> <property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/> <property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageHeader"/> <property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageHeader"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="columnHeader"/> <property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="columnHeader"/>
@ -40,6 +40,7 @@
<field name="EMPRESAAUTORIZADORA_ID" class="java.lang.String"/> <field name="EMPRESAAUTORIZADORA_ID" class="java.lang.String"/>
<field name="EMPRESAAUTORIZADORA" class="java.lang.String"/> <field name="EMPRESAAUTORIZADORA" class="java.lang.String"/>
<field name="NUMBPE" class="java.lang.String"/> <field name="NUMBPE" class="java.lang.String"/>
<field name="DATA_EVENTO" class="java.util.Date"/>
<variable name="TOTAL_TARIFA" class="java.math.BigDecimal" resetType="Group" resetGroup="EMPRESA_AUTORIZADORA" calculation="Sum"> <variable name="TOTAL_TARIFA" class="java.math.BigDecimal" resetType="Group" resetGroup="EMPRESA_AUTORIZADORA" calculation="Sum">
<variableExpression><![CDATA[$F{TARIFA}!=null && $F{STATUS_PASSAGEM}.equals("CANCELADO")?$F{TARIFA}.multiply(new java.math.BigDecimal("-1") ):$F{TARIFA}]]></variableExpression> <variableExpression><![CDATA[$F{TARIFA}!=null && $F{STATUS_PASSAGEM}.equals("CANCELADO")?$F{TARIFA}.multiply(new java.math.BigDecimal("-1") ):$F{TARIFA}]]></variableExpression>
</variable> </variable>
@ -228,14 +229,14 @@
<textFieldExpression><![CDATA["N. BPE"]]></textFieldExpression> <textFieldExpression><![CDATA["N. BPE"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false"> <textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement uuid="175c2491-a0c4-47bb-bfb1-f8cbdfff876a" x="224" y="0" width="110" height="19"/> <reportElement uuid="175c2491-a0c4-47bb-bfb1-f8cbdfff876a" x="254" y="0" width="80" height="19"/>
<textElement textAlignment="Left" markup="none"> <textElement textAlignment="Left" markup="none">
<font size="8" isBold="true"/> <font size="8" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA["Cód. Bilheteiro "]]></textFieldExpression> <textFieldExpression><![CDATA["Cód. Bilheteiro "]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false"> <textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement uuid="cf67c704-990d-476b-b216-6c6fc14f5016" x="0" y="0" width="84" height="19"/> <reportElement uuid="cf67c704-990d-476b-b216-6c6fc14f5016" x="74" y="0" width="40" height="19"/>
<textElement textAlignment="Left" markup="none"> <textElement textAlignment="Left" markup="none">
<font size="8" isBold="true"/> <font size="8" isBold="true"/>
</textElement> </textElement>
@ -281,7 +282,7 @@
<textFieldExpression><![CDATA["Tarifa"]]></textFieldExpression> <textFieldExpression><![CDATA["Tarifa"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false"> <textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement uuid="4e544fca-dc45-44b3-a40e-1f6b2982961f" x="84" y="0" width="140" height="19"/> <reportElement uuid="4e544fca-dc45-44b3-a40e-1f6b2982961f" x="114" y="0" width="140" height="19"/>
<textElement textAlignment="Left" markup="none"> <textElement textAlignment="Left" markup="none">
<font size="8" isBold="true"/> <font size="8" isBold="true"/>
</textElement> </textElement>
@ -392,19 +393,26 @@
</textElement> </textElement>
<textFieldExpression><![CDATA["Vlr. Pago1"]]></textFieldExpression> <textFieldExpression><![CDATA["Vlr. Pago1"]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement uuid="16673147-602d-4f0d-9a90-8ec5c0be12f8" x="0" y="0" width="74" height="19"/>
<textElement textAlignment="Left" markup="none">
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Data.Evento"]]></textFieldExpression>
</textField>
</band> </band>
</columnHeader> </columnHeader>
<detail> <detail>
<band height="20" splitType="Stretch"> <band height="20" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="false"> <textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement uuid="e3a43e5d-2326-47c4-9d47-8c4d69d18d99" x="84" y="0" width="140" height="20"/> <reportElement uuid="e3a43e5d-2326-47c4-9d47-8c4d69d18d99" x="114" y="0" width="140" height="20"/>
<textElement textAlignment="Left"> <textElement textAlignment="Left">
<font fontName="SansSerif" size="8"/> <font fontName="SansSerif" size="8"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{NOME_AGENCIA}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{NOME_AGENCIA}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false"> <textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement uuid="82c36c16-1662-4af9-a285-c935ab350e79" x="224" y="0" width="110" height="20"/> <reportElement uuid="82c36c16-1662-4af9-a285-c935ab350e79" x="254" y="0" width="80" height="20"/>
<textElement textAlignment="Left"> <textElement textAlignment="Left">
<font fontName="SansSerif" size="8"/> <font fontName="SansSerif" size="8"/>
</textElement> </textElement>
@ -544,7 +552,7 @@
<textFieldExpression><![CDATA[$F{VALORFORMAPAGO3}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{VALORFORMAPAGO3}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false"> <textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement uuid="bc091860-adab-47d8-8352-982bc8e484a3" x="0" y="0" width="84" height="20"/> <reportElement uuid="bc091860-adab-47d8-8352-982bc8e484a3" x="74" y="0" width="40" height="20"/>
<textElement textAlignment="Left"> <textElement textAlignment="Left">
<font fontName="SansSerif" size="8"/> <font fontName="SansSerif" size="8"/>
</textElement> </textElement>
@ -557,6 +565,13 @@
</textElement> </textElement>
<textFieldExpression><![CDATA[$F{NUMBPE}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{NUMBPE}]]></textFieldExpression>
</textField> </textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement uuid="7913b2bf-8633-4f59-8168-75ea82fbcfb3" x="0" y="0" width="74" height="20"/>
<textElement textAlignment="Left">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{DATA_EVENTO}]]></textFieldExpression>
</textField>
</band> </band>
</detail> </detail>
<summary> <summary>

View File

@ -38,6 +38,7 @@ public class MyComboboxEmpresa extends Combobox {
this.setAutodrop(false); this.setAutodrop(false);
this.setAutocomplete(false); this.setAutocomplete(false);
this.addEventListener("onOK", new EventListener() { this.addEventListener("onOK", new EventListener() {