diff --git a/pom.xml b/pom.xml index fa8eafac9..72d278c68 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 br.com.rjconsultores ventaboletosadm - 1.7.3 + 1.7.4 war diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioComissaoSintetico.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioComissaoSintetico.java index b92e81dc7..634543173 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioComissaoSintetico.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioComissaoSintetico.java @@ -75,11 +75,11 @@ private Set pontoVendaConfiguracao; Integer retEmpresaID = rset.getInt("empresa_id"); Integer estadoId = rset.getInt("estado_id"); Date fecCorrida = rset.getDate("feccorrida"); - BigDecimal totalPassgens = rset.getBigDecimal("total_passagem"); - BigDecimal totalImpPost = rset.getBigDecimal("total_imp_posterior"); - BigDecimal totalVendaImpPost = rset.getBigDecimal("total_venda_imp_posterior"); - BigDecimal totalSeguro = rset.getBigDecimal("total_seguro"); - BigDecimal totalVenda = rset.getBigDecimal("total_venda"); + BigDecimal totalPassgens = rset.getBigDecimal("total_passagem") == null ? BigDecimal.ZERO : rset.getBigDecimal("total_passagem"); + BigDecimal totalImpPost = rset.getBigDecimal("total_imp_posterior") == null ? BigDecimal.ZERO : rset.getBigDecimal("total_imp_posterior"); + BigDecimal totalVendaImpPost = rset.getBigDecimal("total_venda_imp_posterior") == null ? BigDecimal.ZERO : rset.getBigDecimal("total_venda_imp_posterior"); + BigDecimal totalSeguro = rset.getBigDecimal("total_seguro") == null ? BigDecimal.ZERO : rset.getBigDecimal("total_seguro"); + BigDecimal totalVenda = rset.getBigDecimal("total_venda") == null ? BigDecimal.ZERO : rset.getBigDecimal("total_venda"); RelatorioComissaoSinteticoBean existingBean = findExistingBean(lsDadosRelatorio, agenciaID, retEmpresaID); if (existingBean != null) { // Registro já existe, adicionar os valores aos existentes @@ -103,8 +103,15 @@ private Set pontoVendaConfiguracao; comissaoBean.setTotalTarifa(totalPassgens); comissaoBean.setTotalImpPosterior(totalImpPost); comissaoBean.setTotalVendaImpPosterior(totalVendaImpPost); + comissaoBean.setTotalOutros(BigDecimal.ZERO); + comissaoBean.setTotalExcBagagem(BigDecimal.ZERO); comissaoBean.setTotalSeguro(totalSeguro); comissaoBean.setTotalPagado(totalVenda); + comissaoBean.setComissaoTarifa(BigDecimal.ZERO); + comissaoBean.setComissaoVendaImpPosterior(BigDecimal.ZERO); + comissaoBean.setComissaoImpPosterior(BigDecimal.ZERO); + comissaoBean.setComissaoExcBagagem(BigDecimal.ZERO); + comissaoBean.setComissaoOutros(BigDecimal.ZERO); //aplica comissão dos totais if (configComissao != null) { @@ -262,6 +269,14 @@ private Set pontoVendaConfiguracao; } public void setLsDadosRelatorio(List lsDadosRelatorio) { + lsDadosRelatorio.forEach(bean -> { + BigDecimal totalComissoes = bean.getComissaoTarifa() + .add(bean.getComissaoImpPosterior()) + .add(bean.getComissaoVendaImpPosterior()) + .add(bean.getComissaoExcBagagem()) + .add(bean.getComissaoOutros()); + bean.setComissaoTotal(totalComissoes); + }); this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); this.lsDadosRelatorio = lsDadosRelatorio; } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioComissaoSintetico.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioComissaoSintetico.jasper index 44aff27ca..8551b005c 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioComissaoSintetico.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioComissaoSintetico.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioComissaoSintetico.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioComissaoSintetico.jrxml index aa7b7792f..eeed1a7b6 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioComissaoSintetico.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioComissaoSintetico.jrxml @@ -1,6 +1,6 @@ - - + + @@ -14,6 +14,7 @@ + @@ -33,11 +34,7 @@ - + @@ -77,107 +74,71 @@ - <band height="127"> - <textField pattern="dd/MM/yyyy HH:mm"> - <reportElement uuid="32538cdd-7697-4a03-8035-f9474e869395" x="495" y="0" width="80" height="16"/> - <textElement textAlignment="Right" verticalAlignment="Middle"> - <font size="8"/> + <band height="69"> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="7d6110a7-d2cc-43d4-85f4-748b1dfef63f" mode="Transparent" x="0" y="1" width="455" height="46" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="16" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{header.titulo}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false"> + <reportElement uuid="af7a6042-c9c4-4d13-ae07-24c189ead5fa" mode="Transparent" x="741" y="1" width="80" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Right" 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"/> </textElement> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> </textField> <textField> - <reportElement uuid="abc399f3-d012-46aa-b4e9-678ab812bee4" x="382" y="0" width="113" height="16"/> - <textElement textAlignment="Right" verticalAlignment="Middle"> - <font size="8"/> + <reportElement uuid="54e92cd2-863e-4030-819d-6708b15288d4" x="525" y="1" width="216" height="15"/> + <textElement textAlignment="Right"> + <font size="9" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression> </textField> - <textField> - <reportElement uuid="f25e6675-4dcb-4d37-8586-e50abe4013af" x="70" y="53" width="505" height="20"/> - <textElement> - <font size="8"/> - </textElement> - <textFieldExpression><![CDATA[($P{DATA_INICIAL} != null ? new SimpleDateFormat("dd/MM/yyyy").format($P{DATA_INICIAL}) + " à " + new SimpleDateFormat("dd/MM/yyyy").format($P{DATA_FINAL}) : "")]]></textFieldExpression> - </textField> - <textField> - <reportElement uuid="e15cecc4-995a-4cbc-934e-44970c809849" x="2" y="53" width="68" height="20"/> - <textElement/> - <textFieldExpression><![CDATA[$R{header.periodo.venda}]]></textFieldExpression> - </textField> - <textField> - <reportElement uuid="d3d41ddb-2dbb-4b0e-bf82-02af7f81b63f" x="2" y="72" width="68" height="20" isRemoveLineWhenBlank="true"/> - <textElement/> - <textFieldExpression><![CDATA[$R{header.empresa}]]></textFieldExpression> - </textField> - <textField> - <reportElement uuid="7bc881ef-b270-4178-8416-54ad2602eaab" x="70" y="92" width="505" height="20" isRemoveLineWhenBlank="true"/> - <textElement> - <font size="8"/> - </textElement> - <textFieldExpression><![CDATA[$P{NUMPUNTOVENTA}]]></textFieldExpression> - </textField> - <textField> - <reportElement uuid="33bc773a-8bd3-4bc0-946c-664d78a19f5c" x="70" y="72" width="505" height="20" isRemoveLineWhenBlank="true"/> - <textElement> - <font size="8"/> - </textElement> - <textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression> - </textField> - <textField> - <reportElement uuid="c3b8e525-e015-4aaa-a505-1a92f3d6b0fb" x="2" y="92" width="68" height="20" isRemoveLineWhenBlank="true"/> - <textElement/> - <textFieldExpression><![CDATA[$R{header.filtro.pontoVenda}]]></textFieldExpression> - </textField> - <textField isStretchWithOverflow="true"> - <reportElement uuid="3bc4a172-01c3-4821-a595-9b2f7e794e90" stretchType="RelativeToTallestObject" x="70" y="112" width="505" height="14"/> - <textElement> - <font size="8"/> - </textElement> - <textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression> - </textField> <textField pattern="" isBlankWhenNull="false"> - <reportElement uuid="7057e2fc-1c0c-4600-9052-26476c93b8f1" mode="Transparent" x="2" y="112" width="42" height="14" forecolor="#000000" backcolor="#FFFFFF"/> - <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <reportElement uuid="b2356913-1078-4115-9eb1-3cd8f39871cf" mode="Transparent" x="525" y="16" width="270" height="16" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Right" 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"/> </textElement> - <textFieldExpression><![CDATA[$R{header.filtros}]]></textFieldExpression> + <textFieldExpression><![CDATA[$R{header.pagina}+" "+$V{PAGE_NUMBER}+" "+$R{header.de}]]></textFieldExpression> </textField> - <textField> - <reportElement uuid="83ba776d-57a0-428e-a059-7e0f7412ba27" x="357" y="36" width="218" height="16"/> - <textElement textAlignment="Right" verticalAlignment="Middle"> - <font size="8"/> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="6778dcc2-1b22-4309-9b98-2c394396ec0b" stretchType="RelativeToBandHeight" mode="Transparent" x="525" y="32" width="296" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Right" 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"/> </textElement> - <textFieldExpression><![CDATA[$R{header.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression> + <textFieldExpression><![CDATA[$R{header.impressorPor}+" "+$P{USUARIO}+" - "+$P{USUARIO_NOME}]]></textFieldExpression> </textField> - <textField> - <reportElement uuid="46a0fd96-3aa5-4f54-9315-5402efe99381" x="2" y="0" width="355" height="53"/> - <textElement> - <font size="20" isBold="true"/> - </textElement> - <textFieldExpression><![CDATA[$R{header.titulo}]]></textFieldExpression> - </textField> - <textField evaluationTime="Report"> - <reportElement uuid="4458c46c-d661-4cf5-999e-fd9b7e5d60ad" x="546" y="16" width="29" height="20"/> - <textElement textAlignment="Right" verticalAlignment="Middle"> - <font size="8"/> + <textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> + <reportElement uuid="f47919d9-1e34-4ca4-990b-f0167628068e" mode="Transparent" x="795" y="16" width="26" height="16" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Right" 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"/> </textElement> <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> - <textField> - <reportElement uuid="8b45dca8-0cf5-4c10-aaa7-fce7b2d596c5" x="470" y="16" width="76" height="20"/> - <textElement textAlignment="Right" verticalAlignment="Middle"> - <font size="8"/> - <paragraph rightIndent="2"/> + <textField isStretchWithOverflow="true"> + <reportElement uuid="99f553a0-2256-4eb5-81bf-215b7ba57fd1" x="0" y="47" width="819" height="21"/> + <box leftPadding="2"> + <topPen lineWidth="0.75"/> + <bottomPen lineWidth="0.75"/> + </box> + <textElement verticalAlignment="Middle"> + <font size="12" isBold="true"/> </textElement> - <textFieldExpression><![CDATA[$R{header.pagina}+" "+$V{PAGE_NUMBER}+" de"]]></textFieldExpression> + <textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression> </textField> </band> - + - + @@ -185,12 +146,12 @@ - + - + @@ -198,12 +159,12 @@ - + - + @@ -211,12 +172,12 @@ - + - + @@ -224,12 +185,12 @@ - + - + @@ -237,12 +198,12 @@ - + - + @@ -250,12 +211,12 @@ - + - + @@ -263,12 +224,12 @@ - + - + @@ -276,12 +237,12 @@ - + - + @@ -289,12 +250,12 @@ - + - + @@ -302,25 +263,25 @@ - + - + - - + + - + @@ -328,12 +289,12 @@ - + - + @@ -341,16 +302,16 @@ - + - + - + @@ -360,98 +321,98 @@ - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + @@ -460,125 +421,125 @@ - + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioComissaoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioComissaoController.java index f15dff16c..04f00d1ef 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioComissaoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioComissaoController.java @@ -146,6 +146,7 @@ public class RelatorioComissaoController extends MyGenericForwardComposer { parametros.put("DATA_FINAL", (java.util.Date) this.datFinal.getValue()); parametros.put("TITULO", Labels.getLabel("relatorioComissaoController.window.title")); parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString()); + parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario()); parametros.put("NUMPUNTOVENTA", puntoVentaIds); filtro.append(" Empresa: ");