wilian 2016-04-18 18:10:55 +00:00
parent 3d694acd8d
commit 598ffe543f
4 changed files with 49 additions and 16 deletions

View File

@ -70,6 +70,7 @@ public class RelatorioAnaliticoVoucher extends Relatorio {
sql.append(" case when b.motivocancelacion_id in (31, 32) then b.preciopagado * -1 else b.preciopagado end as tarifa, ");
sql.append(" case when b.motivocancelacion_id in (31, 32) then b.importepedagio * -1 else b.importepedagio end as pedagio, ");
sql.append(" case when b.motivocancelacion_id in (31, 32) then b.importetaxaembarque * -1 else b.importetaxaembarque end as embarque, ");
sql.append(" case when b.motivocancelacion_id in (31, 32) then b.importeseguro * -1 else b.importeseguro end as seguro, ");
sql.append(" case when mc.descmotivo is null then 'VOUCHER' else mc.descmotivo end as status ");
sql.append(" from boleto b ");
sql.append(" join empresa e on b.marca_id = e.empresa_id ");
@ -104,6 +105,7 @@ public class RelatorioAnaliticoVoucher extends Relatorio {
item.setTarifa(rset.getBigDecimal("tarifa"));
item.setPedagio(rset.getBigDecimal("pedagio"));
item.setEmbarque(rset.getBigDecimal("embarque"));
item.setSeguro(rset.getBigDecimal("seguro"));
item.setStatus(rset.getString("status"));
TotalRelatorioVoucher total = null;
@ -117,6 +119,7 @@ public class RelatorioAnaliticoVoucher extends Relatorio {
total.setTarifa(total.getTarifa().add(item.getTarifa().intValue() < 0 ? item.getTarifa().multiply(new BigDecimal(-1)) : item.getTarifa()));
total.setPedagio(total.getPedagio().add(item.getPedagio().intValue() < 0 ? item.getPedagio().multiply(new BigDecimal(-1)) : item.getPedagio()));
total.setEmbarque(total.getEmbarque().add(item.getEmbarque().intValue() < 0 ? item.getEmbarque().multiply(new BigDecimal(-1)) : item.getEmbarque()));
total.setSeguro(total.getSeguro().add(item.getSeguro().intValue() < 0 ? item.getSeguro().multiply(new BigDecimal(-1)) : item.getSeguro()));
totais.put(item.getStatus(), total);
list.add(item);

View File

@ -1,7 +1,7 @@
<?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="RelatorioAnaliticoVoucher" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0e8aff42-5ba8-48ac-9950-da8178561888">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.x" value="14"/>
<property name="ireport.y" value="0"/>
<subDataset name="dataset1" uuid="74edbc6d-4647-4e5a-ab51-73e65607c36e">
<field name="status" class="java.lang.String"/>
@ -9,6 +9,7 @@
<field name="embarque" class="java.math.BigDecimal"/>
<field name="pedagio" class="java.math.BigDecimal"/>
<field name="total" class="java.math.BigDecimal"/>
<field name="seguro" class="java.math.BigDecimal"/>
</subDataset>
<parameter name="inicio" class="java.util.Date"/>
<parameter name="fim" class="java.util.Date"/>
@ -23,6 +24,7 @@
<field name="tarifa" class="java.math.BigDecimal"/>
<field name="pedagio" class="java.math.BigDecimal"/>
<field name="embarque" class="java.math.BigDecimal"/>
<field name="seguro" class="java.math.BigDecimal"/>
<background>
<band splitType="Stretch"/>
</background>
@ -117,28 +119,28 @@
<textFieldExpression><![CDATA["Tipo Venda"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="375" y="2" width="135" height="20" uuid="f74f8fc8-d3dd-4459-9f4f-426b5a3d1949"/>
<reportElement stretchType="RelativeToTallestObject" x="375" y="2" width="125" height="20" uuid="f74f8fc8-d3dd-4459-9f4f-426b5a3d1949"/>
<textElement markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<textFieldExpression><![CDATA["Status"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="510" y="2" width="96" height="20" uuid="3e9b6264-c5df-4ecd-b739-9030e097fc99"/>
<reportElement stretchType="RelativeToTallestObject" x="500" y="2" width="84" height="20" uuid="3e9b6264-c5df-4ecd-b739-9030e097fc99"/>
<textElement textAlignment="Right" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<textFieldExpression><![CDATA["Tarifa"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="606" y="2" width="92" height="20" uuid="d0e7d648-5347-4345-a95b-13a6895e77ed"/>
<reportElement stretchType="RelativeToTallestObject" x="584" y="2" width="71" height="20" uuid="d0e7d648-5347-4345-a95b-13a6895e77ed"/>
<textElement textAlignment="Right" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<textFieldExpression><![CDATA["Pedagio"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="698" y="2" width="103" height="20" uuid="5f93a22b-64e8-4393-9d9c-fabb30e54b61"/>
<reportElement stretchType="RelativeToTallestObject" x="655" y="2" width="73" height="20" uuid="5f93a22b-64e8-4393-9d9c-fabb30e54b61"/>
<textElement textAlignment="Right" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
@ -154,6 +156,13 @@
</textElement>
<textFieldExpression><![CDATA["Data Emissão"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="729" y="2" width="73" height="20" uuid="8ba8c64a-e023-433b-9e42-2a96011c029e"/>
<textElement textAlignment="Right" markup="none">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<textFieldExpression><![CDATA["Seguro"]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
@ -194,33 +203,40 @@
<textFieldExpression><![CDATA[$F{tipoVenda}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="375" y="0" width="135" height="20" uuid="45664dba-aceb-4198-bcc7-5e6567daf0a5"/>
<reportElement stretchType="RelativeToTallestObject" x="375" y="0" width="125" height="20" uuid="45664dba-aceb-4198-bcc7-5e6567daf0a5"/>
<textElement>
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="510" y="0" width="96" height="20" uuid="c3aa8f19-46d6-4c0b-9703-e74adaa2b5d7"/>
<reportElement stretchType="RelativeToTallestObject" x="500" y="0" width="84" height="20" uuid="c3aa8f19-46d6-4c0b-9703-e74adaa2b5d7"/>
<textElement textAlignment="Right">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="606" y="0" width="92" height="20" uuid="655984a8-3e4a-4ac7-8816-317469c6a3ee"/>
<reportElement stretchType="RelativeToTallestObject" x="584" y="0" width="71" height="20" uuid="655984a8-3e4a-4ac7-8816-317469c6a3ee"/>
<textElement textAlignment="Right">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="698" y="0" width="103" height="20" uuid="fced1969-520a-4be8-b126-45c7dc8fae72"/>
<reportElement stretchType="RelativeToTallestObject" x="655" y="0" width="73" height="20" uuid="fced1969-520a-4be8-b126-45c7dc8fae72"/>
<textElement textAlignment="Right">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{embarque}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="728" y="0" width="73" height="20" uuid="f13ecbfe-3b3f-48ad-8c7c-e93b8bfe3445"/>
<textElement textAlignment="Right">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{seguro}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
@ -232,12 +248,12 @@
<summary>
<band height="69">
<componentElement>
<reportElement x="0" y="47" width="610" height="20" uuid="1d137acc-1a93-441e-80c7-f7fc3096be62"/>
<reportElement x="0" y="47" width="711" height="20" uuid="1d137acc-1a93-441e-80c7-f7fc3096be62"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset1" uuid="c0ca26e9-9598-4df2-bdac-196cc2c8130d">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{totais})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="20" width="610">
<jr:listContents height="20" width="711">
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="209" y="0" width="100" height="20" uuid="08b44c7e-53eb-4a90-a24a-aad5a023ebc9"/>
<textElement textAlignment="Right">
@ -260,19 +276,26 @@
<textFieldExpression><![CDATA[$F{status}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="409" y="0" width="100" height="20" uuid="341d8526-54c6-4fcf-b806-4cef7314f66a"/>
<reportElement x="409" y="0" width="101" height="20" uuid="341d8526-54c6-4fcf-b806-4cef7314f66a"/>
<textElement textAlignment="Right">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="509" y="0" width="100" height="20" uuid="86f554f9-e1e2-4142-89c1-9fbf9b1b397d"/>
<reportElement x="610" y="0" width="100" height="20" uuid="86f554f9-e1e2-4142-89c1-9fbf9b1b397d"/>
<textElement textAlignment="Right">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{total}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="510" y="0" width="100" height="20" uuid="d3c3c2af-12dd-425c-906c-be13fe65eb91"/>
<textElement textAlignment="Right">
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{seguro}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
@ -291,7 +314,7 @@
<text><![CDATA[Tarifa]]></text>
</staticText>
<staticText>
<reportElement x="510" y="25" width="100" height="20" uuid="3d1b6b71-cfec-46f5-a933-dfffe71e9035"/>
<reportElement x="611" y="25" width="100" height="20" uuid="3d1b6b71-cfec-46f5-a933-dfffe71e9035"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
@ -321,6 +344,13 @@
<line>
<reportElement x="0" y="3" width="802" height="1" uuid="4142d01b-d6e1-486d-9659-df1e445b9d91"/>
</line>
<staticText>
<reportElement x="510" y="25" width="100" height="20" uuid="26c51b2e-1d63-4910-a1d7-96bef42fccbe"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="6" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
</textElement>
<text><![CDATA[Seguro]]></text>
</staticText>
</band>
</summary>
</jasperReport>

View File

@ -237,7 +237,7 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioAproveitamentoController.window.title"), args, MODAL);
Labels.getLabel("busquedaImportacionFiscalRelatorioFinanceiroController.window.title"), args, MODAL);
} catch (SQLException e) {
log.error(e.getMessage(), e);
@ -266,7 +266,7 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioAproveitamentoController.window.title"), args, MODAL);
Labels.getLabel("busquedaImportacionFiscalRelatorioVoucherController.window.title"), args, MODAL);
} catch (SQLException e) {
log.error(e.getMessage(), e);