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(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,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) ,");
|
||||
} else {
|
||||
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(ct2.coeficiente,0) * coalesce(tc.kmcoeficiente2,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) ,");
|
||||
} else {
|
||||
sb.append(" 1, 2 ) ,");
|
||||
|
@ -802,10 +802,10 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" and tao.ACTIVO=1 ");
|
||||
sb.append(" and v.VIGENCIATARIFA_ID=").append(vigenciaTarifaId).append(" ");
|
||||
|
||||
if(orgao != null){
|
||||
if (orgao != null) {
|
||||
sb.append(" and tao.ORGAOCONCEDENTE_ID=").append(orgao.getOrgaoConcedenteId()).append(" ");
|
||||
}
|
||||
if(empresa != null){
|
||||
if (empresa != null) {
|
||||
sb.append(" and m.EMPRESA_ID=").append(empresa.getEmpresaId()).append(" ");
|
||||
}
|
||||
|
||||
|
@ -924,13 +924,13 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSQLBuscarDatosCaja(Date fechaDesde, Date fechaHasta, Boolean sembilhetesPacote) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
|
||||
|
||||
sb.append(" select ");
|
||||
sb.append(" ");
|
||||
sb.append(" c.CAJA_ID as \"cajaId\", ");
|
||||
|
@ -1007,12 +1007,12 @@ public class SQLBuilderOracle implements SQLBuilder {
|
|||
sb.append(" where ");
|
||||
sb.append(" trunc(fechorventa) between to_date('").append(sdf.format(fechaDesde)).append("','yyyy-MM-dd') and ").append(" to_date('").append(sdf.format(fechaHasta)).append("','yyyy-MM-dd')");
|
||||
|
||||
if(sembilhetesPacote != null && sembilhetesPacote) {
|
||||
if (sembilhetesPacote != null && sembilhetesPacote) {
|
||||
sb.append("and fp.tipo_pago != ")
|
||||
.append(TipoFormapago.PACOTE.getValor())
|
||||
.append("and (c.motivocancelacion_id is null or c.motivocancelacion_id != ")
|
||||
.append(Constantes.MVO_CANCEL_VENDA_PACOTE.intValue())
|
||||
.append(" ) ");
|
||||
.append(TipoFormapago.PACOTE.getValor())
|
||||
.append("and (c.motivocancelacion_id is null or c.motivocancelacion_id != ")
|
||||
.append(Constantes.MVO_CANCEL_VENDA_PACOTE.intValue())
|
||||
.append(" ) ");
|
||||
}
|
||||
|
||||
sb.append(" order by c.fechorventa,c.usuario_id,c.caja_id asc ");
|
||||
|
|
|
@ -80,17 +80,20 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
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
|
||||
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);
|
||||
log.info("qtdTarifaCoeficiente=" + qtdTarifaCoeficiente);
|
||||
}
|
||||
|
||||
// Gerando as tarifas para ARTESP
|
||||
if (orgaoConcedente.getOrgaoConcedenteId() == null || orgaoConcedente.getOrgaoConcedenteId() == OrgaoConcedente.CODIGO_ARTESP) {
|
||||
Integer qtdTarifaArtesp = tarifaOficialDAO.gerarTarifaArtesp(rutaId, UsuarioLogado.getUsuarioLogado().getUsuarioId(), orgaoConcedente.getOrgaoConcedenteId(), idsEmpresas);
|
||||
if (orgaoConcedente == null ||
|
||||
(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);
|
||||
}
|
||||
x--;
|
||||
|
@ -182,7 +185,7 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
if(lsRuta != null && !lsRuta.isEmpty()){
|
||||
rutaId = lsRuta.get(x-1).getRutaId();
|
||||
}
|
||||
//O seguro por km é preferencial em relação ao por tarifa.
|
||||
// O seguro por km é preferencial em relação ao por tarifa.
|
||||
for (Integer orgaoConcedenteId : lsOrgaoId) {
|
||||
if (seguroKmDAO.existe(orgaoConcedenteId)) {
|
||||
atualizarSeguroPorKm(rutaId, orgaoConcedenteId, tipoSeguro);
|
||||
|
@ -223,7 +226,7 @@ public class TarifaOficialServiceImpl implements TarifaOficialService {
|
|||
}
|
||||
}
|
||||
x--;
|
||||
}while(x > 0);
|
||||
} while (x > 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue