fixes bug #9387
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@73128 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
32dea9201e
commit
3a5f0c2827
|
@ -16,6 +16,7 @@ import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
|||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DevolucaoBilhetes;
|
||||
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
||||
import com.rjconsultores.ventaboletos.utilerias.MoneyHelper;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UtiliteriasFiscal;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
|
||||
|
||||
|
@ -165,34 +166,59 @@ public class RelatorioDevolucaoBilhetes extends Relatorio {
|
|||
}
|
||||
db.setValorContabil(valorContabil);
|
||||
|
||||
BigDecimal valorIcms = BigDecimal.ZERO;
|
||||
if(isEstadual) {
|
||||
if(db.getTributacaoimportacao() == null) {
|
||||
valorIcms = db.getValorContabil().multiply(db.getIcmsInterestadual().divide(UtiliteriasFiscal.CEM));
|
||||
} else {
|
||||
valorIcms = db.getValorContabil().multiply(db.getTributacaoimportacao().divide(UtiliteriasFiscal.CEM));
|
||||
}
|
||||
} else {
|
||||
valorIcms = db.getValorContabil().multiply(db.getIcmsIntermunicipal().divide(UtiliteriasFiscal.CEM));
|
||||
}
|
||||
if(db.isIsenta()) {
|
||||
db.setValorIsenta(valorIcms);
|
||||
} else {
|
||||
db.setValorIcms(valorIcms);
|
||||
}
|
||||
|
||||
db.setPorcMunicipal(rset.getBigDecimal("PORC_MUNICIPAL"));
|
||||
db.setPorcEstadual(rset.getBigDecimal("PORC_ESTADUAL"));
|
||||
|
||||
BigDecimal estornoMunicipal = BigDecimal.ZERO;
|
||||
BigDecimal estornoEstadual = BigDecimal.ZERO;
|
||||
if (isEstadual) {
|
||||
estornoEstadual = valorIcms.multiply(db.getPorcEstadual().divide(UtiliteriasFiscal.CEM));
|
||||
BigDecimal redBaseCalcIcms = BigDecimal.ZERO;
|
||||
if(MoneyHelper.isMaior(db.getPorcredbaseicms(), BigDecimal.ZERO)) {
|
||||
redBaseCalcIcms = db.getPorcredbaseicms().divide(UtiliteriasFiscal.CEM);
|
||||
} else {
|
||||
estornoMunicipal = valorIcms.multiply(db.getPorcMunicipal().divide(UtiliteriasFiscal.CEM));
|
||||
if(isEstadual) {
|
||||
if(MoneyHelper.isMaior(db.getPorcEstadual(), BigDecimal.ZERO)) {
|
||||
redBaseCalcIcms = db.getPorcEstadual().divide(UtiliteriasFiscal.CEM);
|
||||
} else if(db.getTributacaoimportacao() == null) {
|
||||
redBaseCalcIcms = db.getIcmsInterestadual().divide(UtiliteriasFiscal.CEM);
|
||||
} else {
|
||||
redBaseCalcIcms = db.getTributacaoimportacao().divide(UtiliteriasFiscal.CEM);
|
||||
}
|
||||
} else {
|
||||
if(MoneyHelper.isMaior(db.getPorcEstadual(), BigDecimal.ZERO)) {
|
||||
redBaseCalcIcms = db.getPorcEstadual().divide(UtiliteriasFiscal.CEM);
|
||||
} else {
|
||||
redBaseCalcIcms = db.getIcmsIntermunicipal().divide(UtiliteriasFiscal.CEM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BigDecimal valorIcms = BigDecimal.ZERO;
|
||||
if(db.isIsenta()) {
|
||||
db.setValorIsenta(valorContabil);
|
||||
} else {
|
||||
BigDecimal redutor = valorContabil.multiply(redBaseCalcIcms);
|
||||
valorIcms = valorContabil.subtract(redutor);
|
||||
|
||||
if(isEstadual) {
|
||||
if(db.getTributacaoimportacao() == null) {
|
||||
valorIcms = db.getValorContabil().multiply(db.getIcmsInterestadual().divide(UtiliteriasFiscal.CEM));
|
||||
} else {
|
||||
valorIcms = db.getValorContabil().multiply(db.getTributacaoimportacao().divide(UtiliteriasFiscal.CEM));
|
||||
}
|
||||
} else {
|
||||
valorIcms = db.getValorContabil().multiply(db.getIcmsIntermunicipal().divide(UtiliteriasFiscal.CEM));
|
||||
}
|
||||
db.setValorIcms(valorIcms);
|
||||
}
|
||||
|
||||
db.setEstornoEstadual(BigDecimal.ZERO);
|
||||
db.setEstornoMunicipal(BigDecimal.ZERO);
|
||||
|
||||
if(!db.isIsenta()) {
|
||||
if (isEstadual) {
|
||||
db.setEstornoEstadual(valorIcms);
|
||||
} else {
|
||||
db.setEstornoMunicipal(valorIcms);
|
||||
}
|
||||
}
|
||||
db.setEstornoMunicipal(estornoMunicipal);
|
||||
db.setEstornoEstadual(estornoEstadual);
|
||||
|
||||
lsDev.add(db);
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -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.5"/>
|
||||
<property name="ireport.x" value="275"/>
|
||||
<property name="ireport.y" value="0"/>
|
||||
<property name="ireport.x" value="477"/>
|
||||
<property name="ireport.y" value="124"/>
|
||||
<style name="textStyle" isDefault="true" fontSize="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
|
||||
<style name="table">
|
||||
<box>
|
||||
|
@ -145,7 +145,7 @@
|
|||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.impEstornarInterestadual}+" ( " + $F{porcEstadual} + "% )"]]></textFieldExpression>
|
||||
<textFieldExpression><![CDATA[$R{label.impEstornarInterestadual}]]></textFieldExpression>
|
||||
</textField>
|
||||
<line>
|
||||
<reportElement x="0" y="0" width="800" height="1" uuid="ddbec772-7ac5-4ca7-8bd9-f4d556cd8015"/>
|
||||
|
@ -155,23 +155,23 @@
|
|||
<textElement>
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$R{label.impEstornarIntermunicipal}+" ( " + $F{porcMunicipal} + "% )"]]></textFieldExpression>
|
||||
<textFieldExpression><![CDATA[$R{label.impEstornarIntermunicipal}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0.00">
|
||||
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement x="288" y="15" width="72" height="14" uuid="ac8a5a5d-6d23-445c-925f-81a506de6e5e"/>
|
||||
<textElement textAlignment="Right">
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$V{estornoMunicipal_1}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0.00">
|
||||
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement x="288" y="1" width="72" height="14" uuid="824c2026-e1ef-459e-88d3-a746acff0dad"/>
|
||||
<textElement textAlignment="Right">
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$V{estornoEstadual_1}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0.00">
|
||||
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement x="288" y="29" width="72" height="14" uuid="10545815-fcf1-40b9-b645-7d1e3097cf0c"/>
|
||||
<textElement textAlignment="Right">
|
||||
<font size="6"/>
|
||||
|
@ -640,37 +640,37 @@
|
|||
<textFieldExpression><![CDATA[$R{label.qtdeBilhetes}]]></textFieldExpression>
|
||||
</textField>
|
||||
<line>
|
||||
<reportElement positionType="Float" x="1" y="15" width="800" height="1" uuid="ff50b0f9-831b-428e-9177-b264920c542b"/>
|
||||
<reportElement positionType="Float" x="1" y="16" width="800" height="1" uuid="ff50b0f9-831b-428e-9177-b264920c542b"/>
|
||||
</line>
|
||||
<textField pattern="###0.00">
|
||||
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="447" y="1" width="94" height="14" uuid="5bb73e4d-a51b-4a04-bed0-8fa3eb7f8553"/>
|
||||
<textElement textAlignment="Right" verticalAlignment="Middle">
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$V{precioPagado_total}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0.00">
|
||||
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="541" y="1" width="74" height="14" uuid="7c3ce565-f549-48d2-815d-9b4d7a39b1ca"/>
|
||||
<textElement textAlignment="Right" verticalAlignment="Middle">
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$V{vTotalContabil}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern="###0.00">
|
||||
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="662" y="1" width="46" height="14" uuid="7a2dbe9b-868e-46db-b3b3-6e759d4dba98"/>
|
||||
<textElement textAlignment="Right" verticalAlignment="Middle">
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$V{valorIcms_total}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern=" ###0.00" isBlankWhenNull="true">
|
||||
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="750" y="1" width="52" height="14" uuid="fba9c1d7-5a33-4229-9371-31aacc2a9fbb"/>
|
||||
<textElement textAlignment="Right" verticalAlignment="Middle">
|
||||
<font size="6"/>
|
||||
</textElement>
|
||||
<textFieldExpression><![CDATA[$V{vTotalOutras}]]></textFieldExpression>
|
||||
</textField>
|
||||
<textField pattern=" ###0.00" isBlankWhenNull="true">
|
||||
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||
<reportElement stretchType="RelativeToTallestObject" x="708" y="1" width="42" height="14" uuid="e6928dff-a4be-42a7-bb7e-281a23110d3a"/>
|
||||
<textElement textAlignment="Right" verticalAlignment="Middle">
|
||||
<font size="6"/>
|
||||
|
|
Loading…
Reference in New Issue