diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/BpeHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/BpeHibernateDAO.java index 6ce0f2208..9e94c5f59 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/BpeHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/BpeHibernateDAO.java @@ -382,6 +382,16 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { TBPe tbpe = null; if (StringUtils.isNotBlank(xml)) tbpe = new ExportacaoBPEVo().convertXmlToBpe(xml); + + if (tbpe.getInfBPe().getInfValorBPe() != null) { + for (TBPe.InfBPe.InfValorBPe.Comp comp : tbpe.getInfBPe().getInfValorBPe().getComp()) { + + + } + // vBP = tbpe.getInfBPe().getInfValorBPe().getVBP(); + // vDesconto = tbpe.getInfBPe().getInfValorBPe().getVDesconto(); + } + BigDecimal passagem = BigDecimal.ZERO; BigDecimal isentos = BigDecimal.ZERO; @@ -446,13 +456,13 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { BigDecimal total = BigDecimal.ZERO; total = total.add(det.getTarifa() == null ? BigDecimal.ZERO : det.getTarifa()); - if (isReceitaTerceiros && (det.isInterEstadual() && det.getIndTxembarqueEstadual() || !det.isInterEstadual() && det.getIndTxembarqueMunicipal())) +// if (isReceitaTerceiros && (det.isInterEstadual() && det.getIndTxembarqueEstadual() || !det.isInterEstadual() && det.getIndTxembarqueMunicipal())) total = total.add(det.getTaxaEmbarque() == null ? BigDecimal.ZERO : det.getTaxaEmbarque()); - if (isReceitaTerceiros && (det.isInterEstadual() && det.getIndPedagioEstdual() || !det.isInterEstadual() && det.getIndPedagioMunicipal())) +// if (isReceitaTerceiros && (det.isInterEstadual() && det.getIndPedagioEstdual() || !det.isInterEstadual() && det.getIndPedagioMunicipal())) total = total.add(det.getPedagio() == null ? BigDecimal.ZERO : det.getPedagio()); - if (isReceitaTerceiros && (det.isInterEstadual() && det.getIndSeguroEstadual() || !det.isInterEstadual() && det.getIndSeguroMunicipal())) +// if (isReceitaTerceiros && (det.isInterEstadual() && det.getIndSeguroEstadual() || !det.isInterEstadual() && det.getIndSeguroMunicipal())) total = total.add(det.getSeguro() == null ? BigDecimal.ZERO : det.getSeguro()); return total; @@ -591,8 +601,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { sql.append("from boleto c "); sql.append(" join bpe bpe on c.boleto_id = bpe.boleto_id "); -// sql.append(" left join bpe bpecan on bpecan.chbpe = bpe.chbpe and bpecan.codstat = 100 and bpe.codstat = 135 and bpe.tipoevento = 110111 "); - sql.append(" left join bpe bpecan on bpecan.chbpe = bpe.chbpe and bpecan.codstat = 135 and bpe.codstat = 100 and bpecan.tipoevento = 110111 "); + sql.append(" left join bpe bpecan on bpecan.chbpe = bpe.chbpe and bpecan.codstat = 135 and bpe.codstat = 100 and (bpecan.tipoevento = 110111 or bpecan.tipoevento is null) "); sql.append(" join estado e on e.codibge = bpe.uf "); sql.append(" join marca ma on c.marca_id = ma.marca_id "); sql.append(" join empresa ep on ma.empresa_id = ep.empresa_id "); diff --git a/src/com/rjconsultores/ventaboletos/utilerias/exportacao/bpe/ExportacaoBPEVo.java b/src/com/rjconsultores/ventaboletos/utilerias/exportacao/bpe/ExportacaoBPEVo.java index 7005d0815..1f9c1ac46 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/exportacao/bpe/ExportacaoBPEVo.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/exportacao/bpe/ExportacaoBPEVo.java @@ -39,6 +39,12 @@ public class ExportacaoBPEVo { static final Integer SIMPLES_NACIONAL_EXCESSO_RECEITA_BRUTA = 2; static final Integer REGIME_NORMAL = 3; } + + public static class TipoComp { + static final String CANCELAMENTO = "110111"; + static final String NAO_EMBARQUE = "110115"; + } + private List listaRegistroBaseBPE;