gleimar 2017-09-27 19:21:40 +00:00
parent cb7126f94d
commit 4ec97ef2a4
4 changed files with 10 additions and 6 deletions

View File

@ -38,7 +38,7 @@ public interface ConferenciaComissaoDAO extends GenericDAO<Conferencia, Long> {
public LogConferencia obtenerLogConferenciaID(Long logconferenciaId);
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia) throws BusinessException;
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia, boolean ehConsultaComissao) throws BusinessException;
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException;

View File

@ -798,7 +798,7 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
@Override
@SuppressWarnings("unchecked")
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia)
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia, boolean ehConsultaComissao)
throws BusinessException {
try {
Map<String, Object> parametros = carregarParametros(null, null, conferencia.getCompetencia(), conferencia.getEmpresa(),
@ -842,7 +842,11 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
sQuery.append("AND M.EMPRESA_ID = :empresaId ");
}
if (parametros.containsKey("puntoventaId")) {
sQuery.append("AND (C.PUNTOVENTA_ID = :puntoventaId or (C.ptovtaventa_id =:puntoventaId and C.MOTIVOCANCELACION_ID IN (32,31,10) AND C.INDSTATUSOPERACION = 'F' ) )");
if (ehConsultaComissao){
sQuery.append("AND (C.PUNTOVENTA_ID = :puntoventaId or (C.ptovtaventa_id =:puntoventaId and C.MOTIVOCANCELACION_ID IN (32,31,10) AND C.INDSTATUSOPERACION = 'F' ) )");
}else{
sQuery.append("AND C.PUNTOVENTA_ID = :puntoventaId ");
}
}
if (StringUtils.isNotBlank(conferencia.getNumfoliosistema())) {
sQuery.append("AND C.NUMFOLIOSISTEMA = :numfoliosistema ");

View File

@ -309,7 +309,7 @@ public class CalculoComissaoServiceImpl implements CalculoComissaoService {
conferencia.setPuntoVenta(new PuntoVenta(puntoVentaId));
conferencia.setEmpresa(new Empresa(empresaId));
conferencia.setCompetencia(DateUtil.getStringDate(periodo, "MM/yyyy"));
List<BoletoComissao> receitasBoleto = conferenciaComissaoDAO.carregarBilhetesComissao(conferencia);
List<BoletoComissao> receitasBoleto = conferenciaComissaoDAO.carregarBilhetesComissao(conferencia, true);
List<EventosFinanceirosVO> eventosFinanceirosVOs = conferenciaComissaoDAO.carregarEventosFinanceiros(conferencia);
Calendar calendario = Calendar.getInstance();

View File

@ -192,7 +192,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
}
if (boletoComissaos == null || boletoComissaos.isEmpty()) {
boletoComissaos = conferenciaComissaoDAO.carregarBilhetesComissao(c);
boletoComissaos = conferenciaComissaoDAO.carregarBilhetesComissao(c, false);
}
if(boletoStatusComissao == null){
@ -242,7 +242,7 @@ public class ConferenciaComissaoServiceImpl implements ConferenciaComissaoServic
@Override
public List<BoletoComissao> carregarBilhetesComissao(List<BoletoComissao> boletoComissaos, Conferencia conferencia, BoletoStatusComissao boletoStatusComissao, boolean carregarDadosFaltantes) throws BusinessException {
if (boletoComissaos == null) {
boletoComissaos = conferenciaComissaoDAO.carregarBilhetesComissao(conferencia);
boletoComissaos = conferenciaComissaoDAO.carregarBilhetesComissao(conferencia, false);
}
if (boletoStatusComissao == null) {