bug#11600

dev: julio
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@84228 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2018-08-14 18:20:13 +00:00
parent 2aa59a8270
commit 8002dd7c9f
3 changed files with 54 additions and 51 deletions

View File

@ -70,19 +70,19 @@ public class RelatorioDevolucaoBilhetes extends Relatorio {
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
ResultSet rset = null;
if(dataVendaInicial != null) {
if (dataVendaInicial != null && !isBpe) {
stmt.setString("dataVendaInicial", DateUtil.getStringDate(dataVendaInicial, "dd/MM/yyyy HH:mm"));
}
if(dataVendaFinal != null) {
if (dataVendaFinal != null && !isBpe) {
stmt.setString("dataVendaFinal", DateUtil.getStringDate(dataVendaFinal, "dd/MM/yyyy HH:mm"));
}
if(dataDevolucaoInicial != null) {
if (dataDevolucaoInicial != null) {
stmt.setString("dataDevolucaoInicial", DateUtil.getStringDate(dataDevolucaoInicial, "dd/MM/yyyy HH:mm"));
}
if(dataDevolucaoFinal != null) {
if (dataDevolucaoFinal != null) {
stmt.setString("dataDevolucaoFinal", DateUtil.getStringDate(dataDevolucaoFinal, "dd/MM/yyyy HH:mm"));
}
@ -143,30 +143,30 @@ public class RelatorioDevolucaoBilhetes extends Relatorio {
db.setEstadual(isEstadual);
BigDecimal valorContabil = BigDecimal.ZERO;
if(isEstadual) {
if(db.getIndPedadioEstdual()) {
if (isEstadual) {
if (db.getIndPedadioEstdual()) {
valorContabil = valorContabil.add(db.getImportepedagio());
}
if(db.getIndSeguroEstadual()) {
if (db.getIndSeguroEstadual()) {
valorContabil = valorContabil.add(db.getImporteseguro());
}
if(db.getIndTarifaEstadual()) {
if (db.getIndTarifaEstadual()) {
valorContabil = valorContabil.add(db.getPrecioPagado());
}
if(db.getIndTxEmbarqueEstadual()) {
if (db.getIndTxEmbarqueEstadual()) {
valorContabil = valorContabil.add(db.getImportetaxaembarque());
}
} else {
if(db.getIndPedagioMunicipal()) {
if (db.getIndPedagioMunicipal()) {
valorContabil = valorContabil.add(db.getImportepedagio());
}
if(db.getIndSeguroMunicipal()) {
if (db.getIndSeguroMunicipal()) {
valorContabil = valorContabil.add(db.getImporteseguro());
}
if(db.getIndTarifaMunicipal()) {
if (db.getIndTarifaMunicipal()) {
valorContabil = valorContabil.add(db.getPrecioPagado());
}
if(db.getIndTxEmbarqueMunicipal()) {
if (db.getIndTxEmbarqueMunicipal()) {
valorContabil = valorContabil.add(db.getImportetaxaembarque());
}
}
@ -285,35 +285,40 @@ public class RelatorioDevolucaoBilhetes extends Relatorio {
sql.append("LEFT JOIN ESTADO ESAIDF ON ESAIDF.ESTADO_ID = AIDF.ESTADO_ID ");
sql.append("LEFT JOIN BOLETO BORI ON BORI.BOLETO_ID = B.BOLETOORIGINAL_ID ");
sql.append(isBpe ? "INNER JOIN BPE BPE ON BPE.BOLETO_ID = B.BOLETO_ID " : "");
sql.append(isBpe ? "INNER JOIN ESTADO EST_BPE ON BPE.UF = EST_BPE.CODIBGE " : "");
sql.append("WHERE ");
sql.append(isBpe ? "B.MOTIVOCANCELACION_ID IN (31,32,10,23,37,99,36) " : " B.MOTIVOCANCELACION_ID IN (31,32,10,37,99,36) ");
sql.append(isBpe ? " " : " B.MOTIVOCANCELACION_ID IN (31,32,10,37,99,36) AND B.INDSTATUSBOLETO = 'C' AND B.INDCANCELACION = 1 ");
sql.append(isBpe ? " ( (BPE.CODSTAT = 135 AND BPE.TIPOEVENTO = 110115) OR BPE.CHBPE_SUBSTITUICAO IS NOT NULL "
+ "OR (BPE.CODSTAT = 135 AND TO_CHAR(BORI.FECHORVENTA, 'MM/YYYY') < TO_CHAR(B.FECHORVENTA, 'MM/YYYY')) )" : " ");
sql.append(isBpe ? " AND B.INDSTATUSBOLETO in ('C', 'T') " : " AND B.INDSTATUSBOLETO = 'C' ");
sql.append(isBpe ? " " : " AND B.INDCANCELACION = 1 ");
if(isApenasBilhetesImpressos) {
if (isApenasBilhetesImpressos) {
sql.append("AND B.NUMFOLIOPREIMPRESO IS NOT NULL ");
}
if(dataVendaInicial != null) {
if (dataVendaInicial != null && !isBpe) {
sql.append("AND BORI.FECHORVENTA >= TO_DATE(:dataVendaInicial,'DD/MM/YYYY HH24:MI') ");
}
if(dataVendaFinal != null) {
if (dataVendaFinal != null && !isBpe) {
sql.append("AND BORI.FECHORVENTA <= TO_DATE(:dataVendaFinal,'DD/MM/YYYY HH24:MI') ");
}
if(dataDevolucaoInicial != null) {
if (dataDevolucaoInicial != null) {
sql.append("AND B.FECHORVENTA >= TO_DATE(:dataDevolucaoInicial,'DD/MM/YYYY HH24:MI') ");
}
if(dataDevolucaoFinal != null) {
if (dataDevolucaoFinal != null) {
sql.append("AND B.FECHORVENTA <= TO_DATE(:dataDevolucaoFinal,'DD/MM/YYYY HH24:MI') ");
}
sql.append("AND B.CATEGORIA_ID NOT IN (SELECT VALORCONSTANTE FROM CONSTANTE WHERE NOMBCONSTANTE = 'GRATUIDADE_CRIANCA') ");
sql.append(estados == null ? "" : "AND COALESCE(ESAIDF.ESTADO_ID, EOS.ESTADO_ID, EST.ESTADO_ID) IN (" + estados + ") ");
sql.append(isBpe ? "" : "AND B.CATEGORIA_ID NOT IN (SELECT VALORCONSTANTE FROM CONSTANTE WHERE NOMBCONSTANTE = 'GRATUIDADE_CRIANCA') ");
if (isBpe) {
sql.append(estados == null ? "" : "AND EST_BPE.ESTADO_ID IN (" + estados + ") ");
} else {
sql.append(estados == null ? "" : "AND COALESCE(ESAIDF.ESTADO_ID, EOS.ESTADO_ID, EST.ESTADO_ID) IN (" + estados + ") ");
}
sql.append(puntoVentas == null ? "" : "AND PTV.PUNTOVENTA_ID IN (" + puntoVentas + ") ");
sql.append(empresaId == null ? "" : "AND E.EMPRESA_ID IN (" + empresaId + ") ");
sql.append("ORDER BY NOMB_EMPRESA, ESTADO, UF, FECHOR_DEVOLUCAO, NUMFOLIOSISTEMA");

View File

@ -1,8 +1,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="RelatorioDevolucaoBilhetes" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="efbc89d4-6f08-4ea5-802f-d4f48ed208e2">
<property name="ireport.zoom" value="1.9965000000000006"/>
<property name="ireport.zoom" value="1.6500000000000004"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="ireport.y" value="7"/>
<style name="bpeStyle" isDefault="true" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false">
<conditionalStyle>
<conditionExpression><![CDATA[$F{chbpe} != null ? Boolean.TRUE : Boolean.FALSE]]></conditionExpression>
@ -263,7 +263,7 @@
<pageHeader>
<band height="78" splitType="Stretch">
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="2" y="16" width="577" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="2ed4524d-5c06-487c-a8f1-abc59a8ef7fc"/>
<reportElement mode="Transparent" x="2" y="1" width="577" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="2ed4524d-5c06-487c-a8f1-abc59a8ef7fc"/>
<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"/>
@ -289,7 +289,7 @@
<textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression>
</textField>
<textField>
<reportElement mode="Transparent" x="2" y="17" width="92" height="14" forecolor="#000000" backcolor="#FFFFFF" uuid="7f1538d0-be50-4597-bfce-dfc18da5c67a"/>
<reportElement mode="Transparent" x="2" y="17" width="92" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="7f1538d0-be50-4597-bfce-dfc18da5c67a"/>
<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
@ -422,8 +422,7 @@
</line>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="215" y="1" width="113" height="14" isPrintWhenDetailOverflows="true" uuid="1835789f-f3ff-4d8d-ba10-12c6d693b270"/>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
</textElement>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none"/>
<textFieldExpression><![CDATA[$F{chbpe} != null ? $R{label.chaveBpe} : $R{label.aidf}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
@ -529,7 +528,6 @@
<textField isBlankWhenNull="true">
<reportElement style="bpeStyle" x="215" y="0" width="113" height="14" uuid="a34502fa-62b7-44b6-9218-90034054b7ac"/>
<textElement textAlignment="Justified" verticalAlignment="Middle">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{chbpe} != null ? $F{chbpe} : $F{aidf}]]></textFieldExpression>
</textField>