diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java index c2567a4a3..f060e0465 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java @@ -2367,9 +2367,9 @@ public class FiscalHibernateDAO extends HibernateDaoSupport implements FiscalDAO sb.append(" and f.fechorfolio >= to_date(?,'DD/MM/YYYY HH24:MI:SS') and f.fechorfolio <= to_date(?,'DD/MM/YYYY HH24:MI:SS') "); sb.append(" and f.empresa_id = ? "); sb.append(" and eof.cveestado like ? "); - sb.append(" and ((b.tipoventa_id = 3 and b.indstatusboleto = 'V' and b.indreimpresion = 0) "); + sb.append(" and (f.indcancelacion = 1 or ( ((b.tipoventa_id = 3 and b.indstatusboleto = 'V' and b.indreimpresion = 0) "); sb.append(" or (b.tipoventa_id in (12,18) and b.indstatusboleto = 'E' and b.numfoliosistema = b.numfoliopreimpreso)) "); - sb.append(" and (b.motivocancelacion_id is null or b.motivocancelacion_id <> 35) "); + sb.append(" and (b.motivocancelacion_id is null or b.motivocancelacion_id <> 35) ))"); sb.append(" order by dataEmissaoRMD "); try { diff --git a/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/vo/ExportacaoBPR.java b/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/vo/ExportacaoBPR.java index 1032fb691..e817bd6f6 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/vo/ExportacaoBPR.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/vo/ExportacaoBPR.java @@ -194,6 +194,9 @@ public class ExportacaoBPR { BigDecimal porc_red_municipal = base.getPorcReducaoMunicipal(); BigDecimal porc_red_estadual = base.getPorcReducaoEstadual(); BigDecimal tributacao_importacao = base.getTributacaoImportacao(); + + if (base.getDocumentoCancelado()) + continue; if (numeroAIDF == null || numeroAIDF.trim().isEmpty() || numeroAIDF.trim().equals("0")) { continue;