fixes bug#11035
dev: julio qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@83374 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a54463fb9d
commit
bf8910ff4f
|
@ -109,7 +109,13 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
|
|||
sql.append(" and bpe.tipoamb = 1 ");
|
||||
sql.append(" and ((c.indreimpresion = 0 and c.motivocancelacion_id is null and c.numfoliosistema is not null) or (c.indstatusboleto = 'E' and c.indreimpresion = 1)) ");
|
||||
sql.append(" and ((case when coalesce(r.indtribtarifa,0) = 1 then c.preciopagado else 0 end) + (case when coalesce(r.indtribtaxaembarque,0) = 1 then c.importetaxaembarque else 0 end) + (case when coalesce(r.indtribpedagio,0) = 1 then c.importepedagio else 0 end)) > 0 ");
|
||||
sql.append(" and c.feccreacion >= to_date(?,'DD/MM/YYYY HH24:MI:SS') and c.feccreacion <= to_date(?,'DD/MM/YYYY HH24:MI:SS') ");
|
||||
|
||||
// sql.append(" and c.feccreacion >= to_date(?,'DD/MM/YYYY HH24:MI:SS') and c.feccreacion <= to_date(?,'DD/MM/YYYY HH24:MI:SS') ");
|
||||
sql.append(" and (case when (case when s.aliasorigen_id is null then ei.indtribviagem else eis.indtribviagem end) = 1 then ");
|
||||
sql.append(" c.fechorviaje else c.feccreacion end) >= to_date(?,'DD/MM/YYYY HH24:MI:SS') ");
|
||||
sql.append(" and (case when (case when s.aliasorigen_id is null then ei.indtribviagem else eis.indtribviagem end) = 1 then ");
|
||||
sql.append(" c.fechorviaje else c.feccreacion end) <= to_date(?,'DD/MM/YYYY HH24:MI:SS') ");
|
||||
|
||||
sql.append(" and c.empresacorrida_id = ? ");
|
||||
sql.append(" and ((case when s.aliasorigen_id is null then eo.cveestado else eos.cveestado end) = ?) ");
|
||||
sql.append(" order by dhrecbto, numfoliosistema ");
|
||||
|
@ -123,8 +129,6 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
|
|||
|
||||
ResultSet rs = ps.executeQuery();
|
||||
|
||||
// ExportacaoBPEBase registro = null;
|
||||
|
||||
while (rs.next()) {
|
||||
BigDecimal valortributado = BigDecimal.ZERO;
|
||||
BigDecimal valortotal = BigDecimal.ZERO;
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.math.BigDecimal;
|
|||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -130,7 +131,7 @@ public class ExportacaoBpe {
|
|||
String tipoBPe = tipoBPE.getTipoBPe();
|
||||
String chaveEletRef = VAZIO;
|
||||
// String chaveEletRef = tipoBPE.getChaveEletronicaReferencia();
|
||||
String codigoContabil = VAZIO;
|
||||
String codigoContabil = StringUtils.isBlank(tipoBPE.getCodigoContabil()) ? VAZIO : tipoBPE.getCodigoContabil();
|
||||
String codigoPrevidenciaria = tipoBPE.getIndContribuicaoPrevidenciaria();
|
||||
String codigoComplementar = VAZIO;
|
||||
String observacao = VAZIO;
|
||||
|
|
|
@ -58,8 +58,8 @@ public class ExportacaoBPEVo {
|
|||
|
||||
String indContribuicaoPrevidenciaria = "00000060";
|
||||
|
||||
boolean isInterEstadual = registro.getEstadoOrigem().equals(registro.getEstadoDestino());
|
||||
String codigoContabil = isInterEstadual ? registro.getCodigoContabilEstadual() : registro.getCodigocontabilMunicipal();
|
||||
boolean isInterMunicipal = registro.getEstadoOrigem().equals(registro.getEstadoDestino());
|
||||
String codigoContabil = isInterMunicipal ? registro.getCodigocontabilMunicipal() : registro.getCodigoContabilEstadual();
|
||||
|
||||
boolean isCancelamento = (registro.getCodstatus() == null ? false : (registro.getCodstatus().equals(StatusBpe.EVENTOS)));
|
||||
String tpDoc = isCancelamento ? "1" : (StringUtils.isBlank(registro.getChbpeSub()) ? "0" : "2");
|
||||
|
@ -109,8 +109,8 @@ public class ExportacaoBPEVo {
|
|||
|
||||
registro.getListaRegistroBPE().add(tipoBPE);
|
||||
|
||||
String cfop = isInterEstadual ? "5357" : "6357";
|
||||
String cstb = isInterEstadual ? (registro.getRedBaseCalcEstadual() == null || registro.getRedBaseCalcEstadual().equals(ZERO)) ? "00" : "20"
|
||||
String cfop = isInterMunicipal ? "5357" : "6357";
|
||||
String cstb = isInterMunicipal ? (registro.getRedBaseCalcEstadual() == null || registro.getRedBaseCalcEstadual().equals(ZERO)) ? "00" : "20"
|
||||
: (registro.getRedBaseCalcMunicipal() == null || registro.getRedBaseCalcMunicipal().equals(ZERO)) ? "00" : "20";
|
||||
|
||||
String csosnb = "";
|
||||
|
|
Loading…
Reference in New Issue