diff --git a/pom.xml b/pom.xml
index d9e66cbb8..ad7a1eca5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0
br.com.rjconsultores
ventaboletosadm
- 1.83.0
+ 1.84.0
war
diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgenciaNovo.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgenciaNovo.java
index c90ef52b7..2ab453646 100644
--- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgenciaNovo.java
+++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioFormaPagamentoAgenciaNovo.java
@@ -3,12 +3,15 @@
*/
package com.rjconsultores.ventaboletos.relatorios.impl;
+import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
+import org.apache.commons.lang.StringUtils;
+
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
@@ -33,6 +36,7 @@ public class RelatorioFormaPagamentoAgenciaNovo extends RelatorioDemandas {
sql.append(" SELECT " );
sql.append(" c.fechorventa AS data, " );
sql.append(" c.numfoliosistema AS bilhete, " );
+ sql.append(" bpe.NBP AS bpe, " );
sql.append(" pv.nombpuntoventa AS agencia, " );
sql.append(" p_origen.CVEPARADA AS origem , " );
sql.append(" p_destino.CVEPARADA AS destino, " );
@@ -42,13 +46,18 @@ public class RelatorioFormaPagamentoAgenciaNovo extends RelatorioDemandas {
sql.append(" coalesce(c.importeseguro, 0) AS seguro, " );
sql.append(" coalesce(c.importetaxaembarque, 0) AS taxa, " );
sql.append(" coalesce(cfp.importe, 0) AS valor, " );
- sql.append(" coalesce(seg.valor, 0) AS seg_opcional " );
+ sql.append(" coalesce(seg.valor, 0) AS seg_opcional, " );
+ sql.append(" c.indstatusboleto AS status, " );
+ sql.append(" c.indcancelacion, " );
+ sql.append(" mc.descmotivo AS motivo" );
sql.append(" FROM " );
sql.append(" caja c " );
sql.append(" JOIN caja_formapago cfp ON c.caja_id = cfp.caja_id " );
sql.append(" JOIN forma_pago fp ON cfp.formapago_id = fp.formapago_id " );
sql.append(" JOIN punto_venta pv ON pv.puntoventa_id = c.puntoventa_id " );
sql.append(" JOIN marca m ON m.marca_id = c.marca_id AND m.activo = 1 " );
+ sql.append(" LEFT JOIN motivo_cancelacion mc ON (mc.motivocancelacion_id = c.motivocancelacion_id) " );
+ sql.append(" LEFT JOIN BPE bpe on c.transacao_id = bpe.boleto_id " );
sql.append(" JOIN parada p_origen ON p_origen.parada_id = c.origen_id " );
sql.append(" JOIN parada p_destino ON p_destino.parada_id = c.destino_id " );
sql.append(" LEFT JOIN segpolv seg ON c.transacao_id = seg.boleto_id " );
@@ -93,19 +102,44 @@ public class RelatorioFormaPagamentoAgenciaNovo extends RelatorioDemandas {
while (rset.next()) {
Map dataResult = new HashMap();
-
+
+ String motivoCancelamento = StringUtils.isNotBlank(rset.getString("motivo")) ? rset.getString("motivo") : StringUtils.EMPTY;
+ String indStatus = StringUtils.isNotBlank(rset.getString("status")) ? rset.getString("status") : StringUtils.EMPTY;
+ String bpe = StringUtils.isNotBlank(rset.getString("bpe")) ? rset.getString("bpe") : StringUtils.EMPTY;
+
+ Boolean isCancelamento = "1".equals(rset.getString("indcancelacion"));
+ BigDecimal tarifa = rset.getBigDecimal("tarifa");
+ BigDecimal pedagio = rset.getBigDecimal("PEDAGIO");
+ BigDecimal seguro = rset.getBigDecimal("SEGURO");
+ BigDecimal seguroOPC = rset.getBigDecimal("seg_opcional");
+ BigDecimal taxa = rset.getBigDecimal("taxa");
+ BigDecimal valor = rset.getBigDecimal("valor");
+
dataResult.put("DATA", rset.getDate("data"));
dataResult.put("BILHETE", rset.getString("bilhete"));
dataResult.put("ORIGEM", rset.getString("ORIGEM"));
dataResult.put("DESTINO", rset.getString("DESTINO"));
dataResult.put("AGENCIA", rset.getString("agencia"));
dataResult.put("FORMA_PAGAMENTO", rset.getString("forma_pagamento"));
- dataResult.put("TARIFA", rset.getBigDecimal("tarifa"));
- dataResult.put("PEDAGIO", rset.getBigDecimal("PEDAGIO"));
- dataResult.put("SEGURO", rset.getBigDecimal("SEGURO"));
- dataResult.put("SEG_OPCIONAL", rset.getBigDecimal("seg_opcional"));
- dataResult.put("TAXA", rset.getBigDecimal("taxa"));
- dataResult.put("VALOR", rset.getBigDecimal("valor"));
+ dataResult.put("NUMERO_BPE", bpe);
+ dataResult.put("STATUS", indStatus);
+ dataResult.put("MOTIVO_CANCELAMENTO", motivoCancelamento);
+
+ if(isCancelamento) {
+ dataResult.put("TARIFA", tarifa.compareTo(BigDecimal.ZERO) == 0 ? tarifa : tarifa.negate());
+ dataResult.put("PEDAGIO", pedagio.compareTo(BigDecimal.ZERO) == 0 ? pedagio : pedagio.negate());
+ dataResult.put("SEGURO", seguro.compareTo(BigDecimal.ZERO) == 0 ? seguro : seguro.negate());
+ dataResult.put("SEG_OPCIONAL", seguroOPC.compareTo(BigDecimal.ZERO) == 0 ? seguroOPC : seguroOPC.negate());
+ dataResult.put("TAXA", taxa.compareTo(BigDecimal.ZERO) == 0 ? taxa : taxa.negate());
+ dataResult.put("VALOR", valor.compareTo(BigDecimal.ZERO) == 0 ? valor : valor.negate());
+ } else {
+ dataResult.put("TARIFA", tarifa);
+ dataResult.put("PEDAGIO", pedagio);
+ dataResult.put("SEGURO", seguro);
+ dataResult.put("SEG_OPCIONAL", seguroOPC);
+ dataResult.put("TAXA", taxa);
+ dataResult.put("VALOR", valor);
+ }
this.dados.add(dataResult);
}
diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_es.properties
index f97abf049..e38db73df 100644
--- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_es.properties
+++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_es.properties
@@ -17,6 +17,9 @@ ORIGEM = ORIGEM
DESTINO = DESTINO
TOTAL_GERAL = Total Geral:
TOTAL_PV = Total Agência:
+MOTIVO_CANCELAMENTO = Motivo Cancel.
+STATUS = Status
+NUMERO_BPE = Num. BPe
#Labels cabeçalho
cabecalho.relatorio=Relatório:
diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_pt_BR.properties
index f97abf049..a243972e9 100644
--- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_pt_BR.properties
+++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioFormaPagamentoAgenciaNovo_pt_BR.properties
@@ -9,7 +9,7 @@ FORMA_PAG = FORMA DE PAG.
VALOR = TARIFA
PEDAGIO = PEDÁGIO
SEGURO = SEGURO
-SEGURO_OPCIONAL = SEG. OPCI.
+SEGURO_OPCIONAL = SEG. OP.
TAXAS = TAXAS
TOTAL = TOTAL
BILHETE = BILHETE
@@ -17,6 +17,9 @@ ORIGEM = ORIGEM
DESTINO = DESTINO
TOTAL_GERAL = Total Geral:
TOTAL_PV = Total Agência:
+MOTIVO_CANCELAMENTO = Motivo Cancel.
+STATUS = Status
+NUMERO_BPE = Num. BPe
#Labels cabeçalho
cabecalho.relatorio=Relatório:
diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jasper
index 4b63d08b3..840bf2437 100644
Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jasper differ
diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jrxml
index cdfb3bf2c..e04edbbcf 100644
--- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jrxml
+++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioFormaPagamentoAgenciaNovo.jrxml
@@ -1,7 +1,7 @@
-
-
+
+
@@ -27,6 +27,9 @@
+
+
+
@@ -68,7 +71,7 @@
-
+
@@ -80,7 +83,7 @@
-
+
@@ -93,153 +96,180 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -255,7 +285,7 @@
-
+
@@ -264,7 +294,7 @@
-
+
@@ -273,7 +303,7 @@
-
+
@@ -282,7 +312,7 @@
-
+
@@ -292,7 +322,7 @@
-
+
@@ -301,7 +331,7 @@
-
+
@@ -309,7 +339,7 @@
-
+
@@ -318,7 +348,7 @@
-
+
@@ -333,35 +363,41 @@
-
+
-
+
+
+
-
+
-
+
+
+
-
+
-
+
+
+
-
+
@@ -370,79 +406,131 @@
-
+
+
+
-
+
-
+
+
+
-
+
-
+
+
+
-
+
-
+
+
+
-
+
-
+
+
+
-
+
-
+
+
+
-
+
-
+
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -454,56 +542,56 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -511,7 +599,7 @@
-
+
@@ -541,8 +629,7 @@
-
-
+
@@ -550,8 +637,7 @@
-
-
+
@@ -559,8 +645,7 @@
-
-
+
@@ -571,7 +656,7 @@
-
+