fixes bug #9485
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@72494 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
35b67795a8
commit
360bbf05ad
|
@ -280,7 +280,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||||
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,0)) * ");
|
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,0)) * ");
|
||||||
if (orgaoConcedente.getIndUtilizaICMS() != null && orgaoConcedente.getIndUtilizaICMS()) {
|
if (orgaoConcedente != null && orgaoConcedente.getIndUtilizaICMS() != null && orgaoConcedente.getIndUtilizaICMS()) {
|
||||||
sb.append(" case when e.icms is null then 1 else (1/(1-e.icms/100)) end ,2) ,");
|
sb.append(" case when e.icms is null then 1 else (1/(1-e.icms/100)) end ,2) ,");
|
||||||
} else {
|
} else {
|
||||||
sb.append(" 1, 2 ) ,");
|
sb.append(" 1, 2 ) ,");
|
||||||
|
@ -289,7 +289,7 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
sb.append(" (coalesce(ct1.coeficiente,0) * coalesce(tc.kmcoeficiente1,0) + ");
|
||||||
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
sb.append(" coalesce(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,0) + ");
|
||||||
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,0)) * ");
|
sb.append(" coalesce(ct3.coeficiente,0) * coalesce(tc.kmcoeficiente3,0)) * ");
|
||||||
if (orgaoConcedente.getIndUtilizaICMS() != null && orgaoConcedente.getIndUtilizaICMS()) {
|
if (orgaoConcedente != null && orgaoConcedente.getIndUtilizaICMS() != null && orgaoConcedente.getIndUtilizaICMS()) {
|
||||||
sb.append(" case when e.icms is null then 1 else (1/(1-e.icms/100)) end ,2) ,");
|
sb.append(" case when e.icms is null then 1 else (1/(1-e.icms/100)) end ,2) ,");
|
||||||
} else {
|
} else {
|
||||||
sb.append(" 1, 2 ) ,");
|
sb.append(" 1, 2 ) ,");
|
||||||
|
@ -924,13 +924,13 @@ public class SQLBuilderOracle implements SQLBuilder {
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSQLBuscarDatosCaja(Date fechaDesde, Date fechaHasta, Boolean sembilhetesPacote) {
|
public String getSQLBuscarDatosCaja(Date fechaDesde, Date fechaHasta, Boolean sembilhetesPacote) {
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder("");
|
StringBuilder sb = new StringBuilder("");
|
||||||
|
|
||||||
|
|
||||||
sb.append(" select ");
|
sb.append(" select ");
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
sb.append(" c.CAJA_ID as \"cajaId\", ");
|
sb.append(" c.CAJA_ID as \"cajaId\", ");
|
||||||
|
|
|
@ -80,17 +80,20 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
||||||
rutaId = r.getRutaId();
|
rutaId = r.getRutaId();
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("gerarAtualizarTarifa= rudaId:" + rutaId + ";orgaoConcedenteId:" + orgaoConcedente.getOrgaoConcedenteId() + ";empresaId:" + idsEmpresas);
|
log.info("gerarAtualizarTarifa= rudaId:" + rutaId + ";orgaoConcedenteId:" + (orgaoConcedente != null ? orgaoConcedente.getOrgaoConcedenteId() : "null") + ";empresaId:" + idsEmpresas);
|
||||||
|
|
||||||
// Gerando as tarifas pelo coeficiente
|
// Gerando as tarifas pelo coeficiente
|
||||||
if (orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() != OrgaoConcedente.CODIGO_ARTESP) {
|
if (orgaoConcedente == null ||
|
||||||
|
(orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() != OrgaoConcedente.CODIGO_ARTESP)) {
|
||||||
Integer qtdTarifaCoeficiente = gerarTarifaPorCoeficiente(rutaId, orgaoConcedente, idsEmpresas);
|
Integer qtdTarifaCoeficiente = gerarTarifaPorCoeficiente(rutaId, orgaoConcedente, idsEmpresas);
|
||||||
log.info("qtdTarifaCoeficiente=" + qtdTarifaCoeficiente);
|
log.info("qtdTarifaCoeficiente=" + qtdTarifaCoeficiente);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gerando as tarifas para ARTESP
|
// Gerando as tarifas para ARTESP
|
||||||
if (orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() == OrgaoConcedente.CODIGO_ARTESP) {
|
if (orgaoConcedente == null ||
|
||||||
Integer qtdTarifaArtesp = tarifaOficialDAO.gerarTarifaArtesp(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente.getOrgaoConcedenteId(), idsEmpresas);
|
(orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() == OrgaoConcedente.CODIGO_ARTESP)) {
|
||||||
|
Integer qtdTarifaArtesp = tarifaOficialDAO.gerarTarifaArtesp(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(),
|
||||||
|
orgaoConcedente != null ? orgaoConcedente.getOrgaoConcedenteId() : null, idsEmpresas);
|
||||||
log.info("qtdTarifaArtesp=" + qtdTarifaArtesp);
|
log.info("qtdTarifaArtesp=" + qtdTarifaArtesp);
|
||||||
}
|
}
|
||||||
x--;
|
x--;
|
||||||
|
|
Loading…
Reference in New Issue