fixed bug #7837: Corrigido o filtro que mostra bilhetes agrupados
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@59646 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
2f2319b53d
commit
a14b4d6be3
|
@ -18,9 +18,7 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.hibernate.Hibernate;
|
||||
|
@ -32,7 +30,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.dao.ConferenciaComissaoDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.ContaCorrenteAgenciaDAO;
|
||||
|
@ -53,7 +50,8 @@ import com.rjconsultores.ventaboletos.vo.comissao.LogConferenciaVO;
|
|||
import com.rjconsultores.ventaboletos.vo.comissao.OcdVO;
|
||||
|
||||
@Repository("conferenciaComissaoDAO")
|
||||
public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Conferencia, Long> implements ConferenciaComissaoDAO {
|
||||
public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Conferencia, Long>
|
||||
implements ConferenciaComissaoDAO {
|
||||
|
||||
private static Logger log = Logger.getLogger(ConferenciaComissaoHibernateDAO.class);
|
||||
|
||||
|
@ -69,7 +67,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
public List<ConferenciaComissaoVO> carregarConferenciaComissao(String competencia,
|
||||
Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
Connection con = null;
|
||||
try {
|
||||
con = dataSourceRead.getConnection();
|
||||
|
@ -84,24 +83,27 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
Collections.sort(lsConferencias);
|
||||
|
||||
return lsConferencias;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
if (con != null && !con.isClosed()) {
|
||||
con.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
}
|
||||
catch (SQLException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
private void carregarPuntoVentas(List<ConferenciaComissaoVO> lsConferencias, String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
private void carregarPuntoVentas(List<ConferenciaComissaoVO> lsConferencias, String competencia,
|
||||
Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
try {
|
||||
|
||||
if (puntoVenta != null && puntoVenta.getPuntoventaId() > -1) {
|
||||
Set<Integer> diasSemMovimentos = DateUtil.carregarDiasCompetencia(competencia);
|
||||
ConferenciaComissaoVO conferenciaComissao = new ConferenciaComissaoVO();
|
||||
|
@ -111,12 +113,15 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
conferenciaComissao.setCompetencia(competencia);
|
||||
conferenciaComissao.setDiasSemMovimentos(diasSemMovimentos);
|
||||
lsConferencias.add(conferenciaComissao);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
StringBuilder sQuery = new StringBuilder("SELECT PV.PUNTOVENTA_ID AS \"puntoventaId\", PV.NUMPUNTOVENTA as \"numPuntoVenta\", PV.NOMBPUNTOVENTA as \"nombpuntoventa\" ");
|
||||
sQuery.append("FROM PUNTO_VENTA PV ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT PV.PUNTOVENTA_ID AS \"puntoventaId\", ")
|
||||
.append("PV.NUMPUNTOVENTA as \"numPuntoVenta\", PV.NOMBPUNTOVENTA as \"nombpuntoventa\" ")
|
||||
.append("FROM PUNTO_VENTA PV ")
|
||||
.append("JOIN PTOVTA_EMPRESA PTE ON PTE.PUNTOVENTA_ID = PV.PUNTOVENTA_ID AND PTE.ACTIVO = 1 ")
|
||||
.append("WHERE PV.ACTIVO = 1 ");
|
||||
|
||||
|
@ -127,7 +132,6 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
sQuery.append("ORDER BY PV.NOMBPUNTOVENTA ");
|
||||
|
||||
log.info(sQuery.toString());
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("puntoventaId", Hibernate.INTEGER)
|
||||
.addScalar("numPuntoVenta", Hibernate.STRING)
|
||||
|
@ -136,36 +140,35 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
setParametros(qr, parametros);
|
||||
|
||||
processarQueryConferenciaComissao(qr.list(), lsConferencias, competencia);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private void carregarConferenciasRegistradas(List<ConferenciaComissaoVO> lsConferencias, String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
private void carregarConferenciasRegistradas(List<ConferenciaComissaoVO> lsConferencias,
|
||||
String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(competencia, empresa, puntoVenta, null);
|
||||
StringBuilder sQuery = new StringBuilder("SELECT co FROM Conferencia co ");
|
||||
sQuery.append("JOIN co.empresa em ")
|
||||
.append("JOIN co.puntoVenta pv ")
|
||||
sQuery.append("JOIN co.empresa em ").append("JOIN co.puntoVenta pv ")
|
||||
.append("WHERE co.activo = 1 ")
|
||||
.append("AND co.datamovimento BETWEEN :dataInicial AND :dataFinal ");
|
||||
|
||||
if (parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND em.empresaId = :empresaId ");
|
||||
}
|
||||
|
||||
if (parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND pv.puntoventaId = :puntoventaId ");
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
Query qr = getSession().createQuery(sQuery.toString());
|
||||
setParametros(qr, parametros);
|
||||
processarQueryConferencia(qr.list(), lsConferencias, competencia);
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -176,22 +179,28 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
for (Entry<String, Object> parametro : parametros.entrySet()) {
|
||||
if (parametro.getValue() instanceof Collection) {
|
||||
qr.setParameterList(parametro.getKey(), (Collection) parametro.getValue());
|
||||
} else if(parametro.getValue() instanceof List) {
|
||||
}
|
||||
else if (parametro.getValue() instanceof List) {
|
||||
qr.setParameterList(parametro.getKey(), (List) parametro.getValue());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
qr.setParameter(parametro.getKey(), parametro.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void carregarMovimentoVendas(Connection con, List<ConferenciaComissaoVO> lsConferencias, String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException, SQLException {
|
||||
private void carregarMovimentoVendas(Connection con, List<ConferenciaComissaoVO> lsConferencias,
|
||||
String competencia, Empresa empresa, PuntoVenta puntoVenta)
|
||||
throws BusinessException, SQLException {
|
||||
PreparedStatement stmt = null;
|
||||
ResultSet rset = null;
|
||||
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(competencia, empresa, puntoVenta, null);
|
||||
StringBuilder sQuery = new StringBuilder("SELECT PV.PUNTOVENTA_ID AS \"puntoventaId\", PV.NUMPUNTOVENTA as \"numPuntoVenta\", PV.NOMBPUNTOVENTA as \"nombpuntoventa\", TO_DATE(B.FECHORVENTA, 'DD/MM/YY') as \"datamovimento\" ");
|
||||
sQuery.append("FROM BOLETO B ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT PV.PUNTOVENTA_ID AS \"puntoventaId\", PV.NUMPUNTOVENTA as \"numPuntoVenta\", ")
|
||||
.append("PV.NOMBPUNTOVENTA as \"nombpuntoventa\", TO_DATE(B.FECHORVENTA, 'DD/MM/YY') as \"datamovimento\" ")
|
||||
.append("FROM BOLETO B ")
|
||||
.append("INNER JOIN PUNTO_VENTA PV ON B.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ")
|
||||
.append("INNER JOIN MARCA M ON B.MARCA_ID = M.MARCA_ID ")
|
||||
.append("WHERE PV.ACTIVO = 1 ")
|
||||
|
@ -200,20 +209,16 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
if (parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND M.EMPRESA_ID = ? ");
|
||||
}
|
||||
|
||||
if (parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND PV.PUNTOVENTA_ID = ? ");
|
||||
}
|
||||
|
||||
sQuery.append("GROUP BY PV.PUNTOVENTA_ID, PV.NUMPUNTOVENTA, PV.NOMBPUNTOVENTA, TO_DATE(B.FECHORVENTA, 'DD/MM/YY') ");
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
stmt = con.prepareStatement(sQuery.toString());
|
||||
int idxParametro = 1;
|
||||
stmt = con.prepareStatement(sQuery.toString());
|
||||
stmt.setString(idxParametro++, DateUtil.getStringDate(DateUtil.inicioFecha((Date) parametros.get("dataInicial")), "dd/MM/yyyy HH:mm"));
|
||||
stmt.setString(idxParametro++, DateUtil.getStringDate(DateUtil.fimFecha((Date) parametros.get("dataFinal")), "dd/MM/yyyy HH:mm"));
|
||||
|
||||
if (parametros.containsKey("empresaId")) {
|
||||
stmt.setInt(idxParametro++, (Integer) parametros.get("empresaId"));
|
||||
}
|
||||
|
@ -234,10 +239,12 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
}
|
||||
|
||||
processarQueryConferenciaComissao(movimentos, lsConferencias, competencia);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
if (rset != null && !rset.isClosed()) {
|
||||
rset.close();
|
||||
}
|
||||
|
@ -248,14 +255,17 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
}
|
||||
|
||||
/**
|
||||
* Carrega a {@link ConferenciaComissaoVO} a partir de uma consulta com sql nativo, transformando o resultado em uma coleção de {@link ConferenciaComissaoVO}
|
||||
* Carrega a {@link ConferenciaComissaoVO} a partir de uma consulta com sql nativo,
|
||||
* transformando o resultado em uma coleção de {@link ConferenciaComissaoVO}
|
||||
*
|
||||
* @param lsQuery
|
||||
* @param lsConferencias
|
||||
* @param competencia
|
||||
* @param corPadrao
|
||||
* @throws ParseException
|
||||
*/
|
||||
private void processarQueryConferenciaComissao(List<ConferenciaComissaoVO> lsQuery, List<ConferenciaComissaoVO> lsConferencias, String competencia) throws ParseException {
|
||||
private void processarQueryConferenciaComissao(List<ConferenciaComissaoVO> lsQuery,
|
||||
List<ConferenciaComissaoVO> lsConferencias, String competencia) throws ParseException {
|
||||
Set<Integer> diasSemMovimentos = DateUtil.carregarDiasCompetencia(competencia);
|
||||
|
||||
for (ConferenciaComissaoVO conferenciaComissaoMovimentoDiario : lsQuery) {
|
||||
|
@ -295,12 +305,14 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
/**
|
||||
* Carrega a {@link ConferenciaComissaoVO} a partir dos registros da tabela {@link Conferencia}
|
||||
*
|
||||
* @param lsQuery
|
||||
* @param lsConferencias
|
||||
* @param competencia
|
||||
* @throws ParseException
|
||||
*/
|
||||
private void processarQueryConferencia(List<Conferencia> lsQuery, List<ConferenciaComissaoVO> lsConferencias, String competencia) throws ParseException {
|
||||
private void processarQueryConferencia(List<Conferencia> lsQuery,
|
||||
List<ConferenciaComissaoVO> lsConferencias, String competencia) throws ParseException {
|
||||
Set<Integer> diasSemMovimentos = DateUtil.carregarDiasCompetencia(competencia);
|
||||
|
||||
for (Conferencia conferencia : lsQuery) {
|
||||
|
@ -344,7 +356,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
}
|
||||
}
|
||||
|
||||
private void carregarDiasSemMovimento(List<ConferenciaComissaoVO> lsConferencias, String competencia, Empresa empresa, PuntoVenta puntoVenta) throws ParseException {
|
||||
private void carregarDiasSemMovimento(List<ConferenciaComissaoVO> lsConferencias,
|
||||
String competencia, Empresa empresa, PuntoVenta puntoVenta) throws ParseException {
|
||||
for (ConferenciaComissaoVO conferenciaComissao : lsConferencias) {
|
||||
for (Integer diaSemMovimento : conferenciaComissao.getDiasSemMovimentos()) {
|
||||
DiaConferenciaComissaoVO diaConferenciaComissao = new DiaConferenciaComissaoVO();
|
||||
|
@ -361,7 +374,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
}
|
||||
}
|
||||
|
||||
private Map<String, Object> carregarParametros(String competencia, Empresa empresa, PuntoVenta puntoVenta, Date datamovimento) throws ParseException {
|
||||
private Map<String, Object> carregarParametros(String competencia, Empresa empresa,
|
||||
PuntoVenta puntoVenta, Date datamovimento) throws ParseException {
|
||||
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||
if (empresa != null) {
|
||||
parametros.put("empresaId", empresa.getEmpresaId());
|
||||
|
@ -381,8 +395,10 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
cal.set(Calendar.MONTH, Integer.valueOf(vetCompetencia[0]) - 1);
|
||||
cal.set(Calendar.YEAR, Integer.valueOf(vetCompetencia[1]));
|
||||
|
||||
parametros.put("dataInicial", DateUtil.getDateFromString(cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "/" + competencia + " 00:00:00", "dd/MM/yyyy hh:mm:ss"));
|
||||
parametros.put("dataFinal", DateUtil.getDateFromString(cal.getActualMaximum(Calendar.DAY_OF_MONTH) + "/" + competencia + " 23:59:59", "dd/MM/yyyy hh:mm:ss"));
|
||||
parametros.put("dataInicial", DateUtil.getDateFromString(
|
||||
cal.getActualMinimum(Calendar.DAY_OF_MONTH) + "/" + competencia + " 00:00:00", "dd/MM/yyyy hh:mm:ss"));
|
||||
parametros.put("dataFinal", DateUtil.getDateFromString(
|
||||
cal.getActualMaximum(Calendar.DAY_OF_MONTH) + "/" + competencia + " 23:59:59", "dd/MM/yyyy hh:mm:ss"));
|
||||
}
|
||||
|
||||
return parametros;
|
||||
|
@ -397,7 +413,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
return encerrarMovimentoDiario(conferencia);
|
||||
}
|
||||
return suscribirOrActualizacion(conferencia);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -408,7 +425,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
public Conferencia suscribirOrActualizacion(Conferencia entidad) {
|
||||
if (entidad.getConferenciaId() == null) {
|
||||
return suscribir(entidad);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return actualizacion(entidad);
|
||||
}
|
||||
}
|
||||
|
@ -423,7 +441,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
gerarLancamentoContaCorrente(conferencia);
|
||||
return suscribirOrActualizacion(conferencia);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -435,45 +454,45 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
try {
|
||||
conferencia.setIndconferido(Boolean.FALSE);
|
||||
return suscribirOrActualizacion(conferencia);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isMovimentoDiarioBoletoGerado(Conferencia conferencia) throws BusinessException {
|
||||
private boolean isMovimentoDiarioBoletoGerado(Conferencia conferencia)
|
||||
throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta(), null);
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT FECHAMENTOCNTCORRENTE_ID ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT FECHAMENTOCNTCORRENTE_ID ")
|
||||
.append("FROM FECHAMENTO_CNTCORRENTE ")
|
||||
.append("WHERE ACTIVO = 1 ")
|
||||
.append("AND :datamovimento BETWEEN FECINIFECHAMENTO AND FECFINFECHAMENTO ");
|
||||
|
||||
parametros.put("datamovimento", conferencia.getDatamovimento());
|
||||
|
||||
if (parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND EMPRESA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if (parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString());
|
||||
setParametros(qr, parametros);
|
||||
|
||||
return !qr.list().isEmpty();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isMovimentoDiarioPendencia(Conferencia conferencia) {
|
||||
Query qr = getSession().createQuery("SELECT COUNT(log) FROM LogConferencia log WHERE log.activo = 1 AND log.conferencia.conferenciaId = :conferenciaId AND log.status = :status");
|
||||
Query qr = getSession().createQuery(
|
||||
"SELECT COUNT(log) FROM LogConferencia log WHERE log.activo = 1 AND log.conferencia.conferenciaId = :conferenciaId AND log.status = :status");
|
||||
qr.setParameter("conferenciaId", conferencia.getConferenciaId());
|
||||
qr.setParameter("status", StatusLogConferencia.PENDENCIA);
|
||||
return !qr.list().isEmpty() && ((Long) qr.list().get(0)) > 0;
|
||||
|
@ -481,11 +500,13 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
public List<EventosFinanceirosVO> carregarEventosFinanceiros(Conferencia conferencia) throws BusinessException {
|
||||
public List<EventosFinanceirosVO> carregarEventosFinanceiros(Conferencia conferencia)
|
||||
throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT EE.EVENTOEXTRA_ID AS \"eventoextraId\", EE.NUMDOCUMENTO AS \"numdocumento\", ")
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(),
|
||||
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT EE.EVENTOEXTRA_ID AS \"eventoextraId\", EE.NUMDOCUMENTO AS \"numdocumento\", ")
|
||||
.append("EE.IMPINGRESO AS \"impingreso\", TEE.DESCTIPOEVENTO AS \"desctipoevento\", EE.DESCINFO AS \"descinfo\", ")
|
||||
.append("LOG.STATUS AS \"status\", FP.FORMAPAGO_ID AS \"formapagoId\", FP.DESCPAGO AS \"descpago\", ")
|
||||
.append("TEE.INDTIPO AS \"indtipo\", U.NOMBUSUARIO AS \"nombusuario\", LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", ")
|
||||
|
@ -505,22 +526,17 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
if (parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND EE.EMPRESA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if (parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND EE.PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
sQuery.append("ORDER BY TEE.DESCTIPOEVENTO ");
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("eventoextraId", Hibernate.LONG)
|
||||
.addScalar("numdocumento", Hibernate.STRING)
|
||||
.addScalar("impingreso", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("desctipoevento", Hibernate.STRING)
|
||||
.addScalar("descinfo", Hibernate.STRING)
|
||||
.addScalar("status", Hibernate.INTEGER)
|
||||
.addScalar("descinfo", Hibernate.STRING).addScalar("status", Hibernate.INTEGER)
|
||||
.addScalar("formapagoId", Hibernate.INTEGER)
|
||||
.addScalar("descpago", Hibernate.STRING)
|
||||
.addScalar("comempformapagoId", Hibernate.INTEGER)
|
||||
|
@ -533,7 +549,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
setParametros(qr, parametros);
|
||||
|
||||
return qr.list();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -541,11 +558,12 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
@Override
|
||||
@SuppressWarnings({ "deprecation", "unchecked" })
|
||||
public List<LogConferenciaVO> carregarLogConferencia(Conferencia conferencia) throws BusinessException {
|
||||
public List<LogConferenciaVO> carregarLogConferencia(Conferencia conferencia)
|
||||
throws BusinessException {
|
||||
try {
|
||||
if (conferencia != null && conferencia.getConferenciaId() != null) {
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", LOG.OBSERVACAO AS \"observacao\", LOG.PRECO AS \"preco\", ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", LOG.OBSERVACAO AS \"observacao\", LOG.PRECO AS \"preco\", ")
|
||||
.append("LOG.STATUS AS \"status\", B.NUMFOLIOSISTEMA AS \"numfoliosistema\", LOG.TIPO AS \"tipo\", ")
|
||||
.append("O.NUMOPERACION AS \"numoperacion\", TEE.DESCTIPOEVENTO AS \"desctipoevento\", U.NOMBUSUARIO AS \"nombusuario\", ")
|
||||
.append("LOG.FECMODIF AS \"fecmodif\", LOG.INDCREDITO AS \"indcredito\", B.BOLETO_ID AS \"boletoId\", O.OCD_ID AS \"ocdId\", EE.EVENTOEXTRA_ID AS \"eventoextraId\" ")
|
||||
|
@ -570,15 +588,15 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
.addScalar("nombusuario", Hibernate.STRING)
|
||||
.addScalar("fecmodif", Hibernate.TIMESTAMP)
|
||||
.addScalar("indcredito", Hibernate.BOOLEAN)
|
||||
.addScalar("boletoId", Hibernate.LONG)
|
||||
.addScalar("ocdId", Hibernate.LONG)
|
||||
.addScalar("boletoId", Hibernate.LONG).addScalar("ocdId", Hibernate.LONG)
|
||||
.addScalar("eventoextraId", Hibernate.LONG)
|
||||
.setResultTransformer(Transformers.aliasToBean(LogConferenciaVO.class));
|
||||
qr.setParameter("conferenciaId", conferencia.getConferenciaId());
|
||||
|
||||
return qr.list();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -588,7 +606,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
@Override
|
||||
@Transactional
|
||||
public LogConferencia suscribirLogConferencia(LogConferencia logConferencia) throws BusinessException {
|
||||
public LogConferencia suscribirLogConferencia(LogConferencia logConferencia)
|
||||
throws BusinessException {
|
||||
try {
|
||||
if (logConferencia.getConferencia().getConferenciaId() == null) {
|
||||
logConferencia.setConferencia(suscribir(logConferencia.getConferencia()));
|
||||
|
@ -596,7 +615,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
getSession().save(logConferencia);
|
||||
return logConferencia;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -615,7 +635,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
contaCorrenteAgenciaDAO.actualizacion(contaCorrentePtoVta);
|
||||
}
|
||||
getSession().merge(logConferencia);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -625,19 +646,22 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
public LogConferencia obtenerLogConferenciaID(Long logconferenciaId) {
|
||||
try {
|
||||
return (LogConferencia) this.getHibernateTemplate().get(LogConferencia.class.getName(), logconferenciaId);
|
||||
} catch (final HibernateException ex) {
|
||||
}
|
||||
catch (final HibernateException ex) {
|
||||
throw convertHibernateAccessException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia) throws BusinessException {
|
||||
public List<BoletoComissao> carregarBilhetesComissao(Conferencia conferencia)
|
||||
throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(),
|
||||
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT B.BOLETO_ID AS \"boletoId\", B.NUMASIENTO AS \"numAsiento\", B.NUMASIENTOVINCULADO AS \"numAsientoVinculado\", ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT B.BOLETO_ID AS \"boletoId\", B.NUMASIENTO AS \"numAsiento\", B.NUMASIENTOVINCULADO AS \"numAsientoVinculado\", ")
|
||||
.append("B.NUMOPERACION AS \"numoperacion\", B.NUMFOLIOSISTEMA AS \"numFolioSistema\", B.NUMSERIEPREIMPRESA AS \"numSeriePreimpresa\", ")
|
||||
.append("B.NUMFOLIOPREIMPRESO AS \"numFolioPreImpreso\", EST.CVEESTADO AS \"uf\", CAT.DESCCATEGORIA AS \"desccategoria\", ")
|
||||
.append("NVL(B.PRECIOPAGADO,0) AS \"valorpagado\", NVL(B.IMPORTEOUTROS,0) AS \"seguroOutros\", ")
|
||||
|
@ -648,7 +672,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
.append("BF.IMPORTE AS \"importeFp\", COMFP.COMEMPFORMAPAGO_ID AS \"comempformapagoId\", COMCAT.COMEMPCATEGORIA_ID AS \"comempcategoriaId\", ")
|
||||
.append("BO1.TIPOVENTA_ID \"tipoVentaOriginal1\", BO2.TIPOVENTA_ID \"tipoVentaOriginal2\", OCD.OCD_ID \"ocdId\", ")
|
||||
.append("B.NOMBPASAJERO AS \"nombpasajero\", E.INDCARBOLETOSDEVOLVIDOSCONF AS \"indcarboletosdevolvidosconf\", ")
|
||||
.append("B.FECCORRIDA AS \"feccorrida\", B.CORRIDA_ID \"corridaId\" ")
|
||||
.append("B.FECCORRIDA AS \"feccorrida\", B.CORRIDA_ID \"corridaId\", B.BOLETOORIGINAL_ID AS \"boletoOriginalId\", ")
|
||||
.append("BO1.MOTIVOCANCELACION_ID \"motivoCancelacionOriginal1\", BO2.MOTIVOCANCELACION_ID \"motivoCancelacionOriginal2\" ")
|
||||
.append("FROM BOLETO B ")
|
||||
.append("LEFT JOIN BOLETO BO1 ON BO1.BOLETO_ID = B.BOLETOORIGINAL_ID ")
|
||||
.append("LEFT JOIN BOLETO BO2 ON BO2.BOLETO_ID = BO1.BOLETOORIGINAL_ID ")
|
||||
|
@ -672,29 +697,24 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
if (parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND M.MARCA_ID = :empresaId ");
|
||||
}
|
||||
|
||||
if (parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND B.PUNTOVENTA_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(conferencia.getNumfoliosistema())) {
|
||||
sQuery.append("AND B.NUMFOLIOSISTEMA = :numfoliosistema ");
|
||||
parametros.put("numfoliosistema", conferencia.getNumfoliosistema());
|
||||
}
|
||||
|
||||
sQuery.append("ORDER BY B.BOLETO_ID ");
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("boletoId", Hibernate.LONG)
|
||||
.addScalar("boletoOriginalId", Hibernate.LONG)
|
||||
.addScalar("numAsiento", Hibernate.STRING)
|
||||
.addScalar("numAsientoVinculado", Hibernate.STRING)
|
||||
.addScalar("numFolioSistema", Hibernate.STRING)
|
||||
.addScalar("numSeriePreimpresa", Hibernate.STRING)
|
||||
.addScalar("numFolioPreImpreso", Hibernate.STRING)
|
||||
.addScalar("uf", Hibernate.STRING)
|
||||
.addScalar("desccategoria", Hibernate.STRING)
|
||||
.addScalar("uf", Hibernate.STRING).addScalar("desccategoria", Hibernate.STRING)
|
||||
.addScalar("valorpagado", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("seguroOutros", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("pedagio", Hibernate.BIG_DECIMAL)
|
||||
|
@ -709,6 +729,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
.addScalar("descmotivocancelacion", Hibernate.STRING)
|
||||
.addScalar("nombusuario", Hibernate.STRING)
|
||||
.addScalar("motivoCancelacionId", Hibernate.INTEGER)
|
||||
.addScalar("motivoCancelacionOriginal1", Hibernate.INTEGER)
|
||||
.addScalar("motivoCancelacionOriginal2", Hibernate.INTEGER)
|
||||
.addScalar("importeFp", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("comempformapagoId", Hibernate.INTEGER)
|
||||
.addScalar("comempcategoriaId", Hibernate.INTEGER)
|
||||
|
@ -732,18 +754,28 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
if (lsBoletoComissao.contains(boletoComissao)) {
|
||||
BoletoComissao aux = lsBoletoComissao.get(lsBoletoComissao.indexOf(boletoComissao));
|
||||
aux.setComempcategoriaId(boletoComissao.getComempcategoriaId() != null ? boletoComissao.getComempcategoriaId() : aux.getComempcategoriaId());
|
||||
aux.setComempformapagoId(boletoComissao.getComempformapagoId() != null ? boletoComissao.getComempformapagoId() : aux.getComempformapagoId());
|
||||
aux.getFormapagos().add(new FormapagoVO(boletoComissao.getFormapagoId(), boletoComissao.getDescpago(), boletoComissao.getIndconferenciafisicacomissao(), boletoComissao.getImporteFp()));
|
||||
aux.setComempcategoriaId(boletoComissao.getComempcategoriaId() != null
|
||||
? boletoComissao.getComempcategoriaId() : aux.getComempcategoriaId());
|
||||
aux.setComempformapagoId(boletoComissao.getComempformapagoId() != null
|
||||
? boletoComissao.getComempformapagoId() : aux.getComempformapagoId());
|
||||
aux.getFormapagos().add(new FormapagoVO(boletoComissao.getFormapagoId(),
|
||||
boletoComissao.getDescpago(),
|
||||
boletoComissao.getIndconferenciafisicacomissao(),
|
||||
boletoComissao.getImporteFp()));
|
||||
lsBoletoComissao.set(lsBoletoComissao.indexOf(boletoComissao), aux);
|
||||
} else {
|
||||
boletoComissao.getFormapagos().add(new FormapagoVO(boletoComissao.getFormapagoId(), boletoComissao.getDescpago(), boletoComissao.getIndconferenciafisicacomissao(), boletoComissao.getImporteFp()));
|
||||
}
|
||||
else {
|
||||
boletoComissao.getFormapagos().add(new FormapagoVO(boletoComissao.getFormapagoId(),
|
||||
boletoComissao.getDescpago(),
|
||||
boletoComissao.getIndconferenciafisicacomissao(),
|
||||
boletoComissao.getImporteFp()));
|
||||
lsBoletoComissao.add(boletoComissao);
|
||||
}
|
||||
}
|
||||
|
||||
return lsBoletoComissao;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -753,14 +785,14 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
@SuppressWarnings({ "unchecked", "deprecation" })
|
||||
public List<OcdVO> carregarOcds(Conferencia conferencia) throws BusinessException {
|
||||
try {
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(), conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||
Map<String, Object> parametros = carregarParametros(null, conferencia.getEmpresa(),
|
||||
conferencia.getPuntoVenta(), conferencia.getDatamovimento());
|
||||
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT DISTINCT O.OCD_ID AS \"ocdId\", O.NUMOPERACION AS \"numoperacion\", O.FECINC AS \"fecinc\", O.FECPAGAR AS \"fecpagar\", O.FECPAGO AS \"fecpago\", ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT DISTINCT O.OCD_ID AS \"ocdId\", O.NUMOPERACION AS \"numoperacion\", O.FECINC AS \"fecinc\", O.FECPAGAR AS \"fecpagar\", O.FECPAGO AS \"fecpago\", ")
|
||||
.append("O.INDPAGO AS \"indpago\", O.VALOR_PAGAR AS \"valorPagar\", (B.PRECIOPAGADO * (O.PENALIZACION / 100)) AS \"penalizacion\", LOG.STATUS AS \"status\", ")
|
||||
.append("U.NOMBUSUARIO AS \"nombusuario\", LOG.LOGCONFERENCIA_ID AS \"logconferenciaId\", U.CVEUSUARIO AS \"login\", B.NUMFOLIOSISTEMA AS \"numFolioSistema\", ")
|
||||
.append("CEC.INDOCD AS \"exigeConferenciaAba\" ")
|
||||
.append("FROM OCD O ")
|
||||
.append("CEC.INDOCD AS \"exigeConferenciaAba\" ").append("FROM OCD O ")
|
||||
.append("INNER JOIN BOLETO B ON B.BOLETO_ID = O.BOLETO_ID ")
|
||||
.append("INNER JOIN MARCA M ON B.MARCA_ID = M.MARCA_ID ")
|
||||
.append("LEFT JOIN LOG_CONFERENCIA LOG ON LOG.OCD_ID = O.OCD_ID AND LOG.ACTIVO = 1 ")
|
||||
|
@ -774,20 +806,14 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
if (parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND ((B.EMPRESACORRIDA_ID IS NOT NULL AND B.EMPRESACORRIDA_ID = :empresaId) OR(m.EMPRESA_ID = :empresaId)) ");
|
||||
}
|
||||
|
||||
if (parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND O.PUNTOVENTAPAGO_ID = :puntoventaId ");
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("ocdId", Hibernate.LONG)
|
||||
.addScalar("numoperacion", Hibernate.STRING)
|
||||
.addScalar("fecinc", Hibernate.DATE)
|
||||
.addScalar("fecpagar", Hibernate.DATE)
|
||||
.addScalar("fecpago", Hibernate.DATE)
|
||||
.addScalar("indpago", Hibernate.BOOLEAN)
|
||||
.addScalar("ocdId", Hibernate.LONG).addScalar("numoperacion", Hibernate.STRING)
|
||||
.addScalar("fecinc", Hibernate.DATE).addScalar("fecpagar", Hibernate.DATE)
|
||||
.addScalar("fecpago", Hibernate.DATE).addScalar("indpago", Hibernate.BOOLEAN)
|
||||
.addScalar("valorPagar", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("penalizacion", Hibernate.BIG_DECIMAL)
|
||||
.addScalar("status", Hibernate.INTEGER)
|
||||
|
@ -800,24 +826,23 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
setParametros(qr, parametros);
|
||||
|
||||
return qr.list();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Conferencia obtenerConferenciaDataMovimento(Date datamovimento, Integer puntoventaId, Integer empresaId) throws BusinessException {
|
||||
public Conferencia obtenerConferenciaDataMovimento(Date datamovimento, Integer puntoventaId,
|
||||
Integer empresaId) throws BusinessException {
|
||||
try {
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT co ")
|
||||
.append("FROM Conferencia co ")
|
||||
.append("WHERE co.activo = 1 ")
|
||||
.append("AND co.datamovimento = :datamovimento ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT co ").append("FROM Conferencia co ")
|
||||
.append("WHERE co.activo = 1 ").append("AND co.datamovimento = :datamovimento ")
|
||||
.append("AND co.empresa.empresaId = :empresaId ")
|
||||
.append("AND co.puntoVenta.puntoventaId = :puntoventaId ");
|
||||
|
||||
log.info(sQuery.toString());
|
||||
Query qr = getSession().createQuery(sQuery.toString());
|
||||
qr.setParameter("datamovimento", datamovimento);
|
||||
qr.setParameter("empresaId", empresaId);
|
||||
|
@ -825,7 +850,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
qr.setMaxResults(1);
|
||||
return (Conferencia) qr.uniqueResult();
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -842,29 +868,30 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
String descOperacion = "CONFERENCIA MOVIMENTO DIA - " + sDataMovimento;
|
||||
|
||||
for (LogConferencia logConferencia : lsLogConferencia) {
|
||||
if(logConferencia.getStatus().equals(StatusLogConferencia.CONFERIDO) ||
|
||||
((logConferencia.getContaCorrentePtoVta() != null &&
|
||||
logConferencia.getContaCorrentePtoVta().getActivo() != null &&
|
||||
logConferencia.getContaCorrentePtoVta().getActivo())) ||
|
||||
(logConferencia.getPreco() == null || logConferencia.getPreco().doubleValue() == 0d)) {
|
||||
if (logConferencia.getStatus().equals(StatusLogConferencia.CONFERIDO)
|
||||
|| ((logConferencia.getContaCorrentePtoVta() != null
|
||||
&& logConferencia.getContaCorrentePtoVta().getActivo() != null
|
||||
&& logConferencia.getContaCorrentePtoVta().getActivo()))
|
||||
|| (logConferencia.getPreco() == null
|
||||
|| logConferencia.getPreco().doubleValue() == 0d)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ContaCorrentePtoVta contaCorrentePtoVta = contaCorrenteAgenciaDAO.gravarContaCorrente(conferencia.getPuntoVenta().getPuntoventaId(),
|
||||
ContaCorrentePtoVta contaCorrentePtoVta = contaCorrenteAgenciaDAO
|
||||
.gravarContaCorrente(conferencia.getPuntoVenta().getPuntoventaId(),
|
||||
descOperacion, cal.getTime(), conferencia.getUsuarioId(),
|
||||
logConferencia.isIndcredito() ? Constantes.TIPO_OPERACION_CC_PAGO : Constantes.TIPO_OPERACION_CC_LQ,
|
||||
conferencia.getEmpresa().getEmpresaId(),
|
||||
Constantes.TURNO_AUTOMATICO, BigDecimal.ZERO,
|
||||
BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO,
|
||||
BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO,
|
||||
BigDecimal.ZERO, logConferencia.getPreco(), false,
|
||||
Constantes.TURNO_AUTOMATICO, BigDecimal.ZERO, BigDecimal.ZERO,
|
||||
BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO,
|
||||
BigDecimal.ZERO, BigDecimal.ZERO, logConferencia.getPreco(), false,
|
||||
BigDecimal.ZERO, BigDecimal.ZERO, logConferencia.getPreco());
|
||||
|
||||
logConferencia.setContaCorrentePtoVta(contaCorrentePtoVta);
|
||||
suscribirLogConferencia(logConferencia);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -874,22 +901,23 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
@SuppressWarnings("unchecked")
|
||||
public List<LogConferencia> carregarLogConferencia(Long conferenciaId) throws BusinessException {
|
||||
try {
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT log ")
|
||||
.append("FROM LogConferencia log ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT log ").append("FROM LogConferencia log ")
|
||||
.append("WHERE log.activo = 1 ")
|
||||
.append("AND log.conferencia.conferenciaId = :conferenciaId ");
|
||||
Query qr = getSession().createQuery(sQuery.toString());
|
||||
qr.setParameter("conferenciaId", conferenciaId);
|
||||
return qr.list();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConferenciaCompetenciaEncerrada(String competencia, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
public boolean isConferenciaCompetenciaEncerrada(String competencia, Empresa empresa,
|
||||
PuntoVenta puntoVenta) throws BusinessException {
|
||||
try {
|
||||
List<ConferenciaComissaoVO> lsConferencias = new ArrayList<ConferenciaComissaoVO>();
|
||||
|
||||
|
@ -905,7 +933,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
}
|
||||
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
|
@ -913,11 +942,9 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
@Override
|
||||
public BigDecimal carregarValorDepositoContaCorrente(Integer empresaId, Integer puntoventaId, Date datamovimento) {
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("SELECT SUM(importeTotalEfectivo) ")
|
||||
.append("FROM ContaCorrentePtoVta cc ")
|
||||
.append("WHERE cc.activo = 1 ")
|
||||
.append("AND cc.empresa.empresaId = :empresaId ")
|
||||
StringBuilder sQuery = new StringBuilder()
|
||||
.append("SELECT SUM(importeTotalEfectivo) ").append("FROM ContaCorrentePtoVta cc ")
|
||||
.append("WHERE cc.activo = 1 ").append("AND cc.empresa.empresaId = :empresaId ")
|
||||
.append("AND cc.puntoVenta.puntoventaId = :puntoventaId ")
|
||||
.append("AND cc.fecHorOperacion = :datamovimento ");
|
||||
|
||||
|
@ -932,25 +959,23 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public DiaConferenciaComissaoVO carregarConferenciaRegistrada(Date datamovimento, Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
public DiaConferenciaComissaoVO carregarConferenciaRegistrada(Date datamovimento,
|
||||
Empresa empresa, PuntoVenta puntoVenta) throws BusinessException {
|
||||
try {
|
||||
String competencia = DateUtil.getStringDate(datamovimento, "MM/yyyy");
|
||||
Map<String, Object> parametros = carregarParametros(competencia, empresa, puntoVenta, null);
|
||||
StringBuilder sQuery = new StringBuilder("SELECT co FROM Conferencia co ");
|
||||
sQuery.append("JOIN co.empresa em ")
|
||||
.append("JOIN co.puntoVenta pv ")
|
||||
StringBuilder sQuery = new StringBuilder("SELECT co FROM Conferencia co ")
|
||||
.append("JOIN co.empresa em ").append("JOIN co.puntoVenta pv ")
|
||||
.append("WHERE co.activo = 1 ")
|
||||
.append("AND co.datamovimento BETWEEN :dataInicial AND :dataFinal ");
|
||||
|
||||
if (parametros.containsKey("empresaId")) {
|
||||
sQuery.append("AND em.empresaId = :empresaId ");
|
||||
}
|
||||
|
||||
if (parametros.containsKey("puntoventaId")) {
|
||||
sQuery.append("AND pv.puntoventaId = :puntoventaId ");
|
||||
}
|
||||
|
||||
log.info(sQuery.toString());
|
||||
Query qr = getSession().createQuery(sQuery.toString());
|
||||
setParametros(qr, parametros);
|
||||
qr.setParameter("dataInicial", datamovimento);
|
||||
|
@ -960,7 +985,8 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
processarQueryConferencia(qr.list(), lsConferenciaComissao, competencia);
|
||||
|
||||
if (!lsConferenciaComissao.isEmpty()) {
|
||||
for (DiaConferenciaComissaoVO diaConferenciaComissao : lsConferenciaComissao.iterator().next().getDiasOrdenado()) {
|
||||
for (DiaConferenciaComissaoVO diaConferenciaComissao : lsConferenciaComissao
|
||||
.iterator().next().getDiasOrdenado()) {
|
||||
if (diaConferenciaComissao.getData().equals(datamovimento)) {
|
||||
return diaConferenciaComissao;
|
||||
}
|
||||
|
@ -968,10 +994,10 @@ public class ConferenciaComissaoHibernateDAO extends GenericHibernateDAO<Confere
|
|||
}
|
||||
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new BusinessException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,9 +3,7 @@ package com.rjconsultores.ventaboletos.vo.comissao;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||
import com.rjconsultores.ventaboletos.constantes.DescricaoTipoVenta;
|
||||
import com.rjconsultores.ventaboletos.enums.IndStatusBoleto;
|
||||
|
@ -15,12 +13,15 @@ import com.rjconsultores.ventaboletos.utilerias.DateUtil;
|
|||
public class BoletoComissao {
|
||||
|
||||
private Long boletoId;
|
||||
private Long boletoOriginalId;
|
||||
private Integer empresaId;
|
||||
private Integer puntoVentaId;
|
||||
private String datavenda;
|
||||
private Integer tipoVenta;
|
||||
private String indstatusboleto;
|
||||
private Integer motivoCancelacionId;
|
||||
private Integer motivoCancelacionOriginal1;
|
||||
private Integer motivoCancelacionOriginal2;
|
||||
private String descmotivocancelacion;
|
||||
private BigDecimal valorpagado;
|
||||
private BigDecimal seguro;
|
||||
|
@ -65,6 +66,7 @@ public class BoletoComissao {
|
|||
private boolean conferido;
|
||||
|
||||
private Date feccorrida;
|
||||
|
||||
private Integer corridaId;
|
||||
|
||||
public Integer getEmpresaId() {
|
||||
|
@ -187,6 +189,14 @@ public class BoletoComissao {
|
|||
this.boletoId = boletoId;
|
||||
}
|
||||
|
||||
public void setBoletoOriginalId(Long boletoOriginalId) {
|
||||
this.boletoOriginalId = boletoOriginalId;
|
||||
}
|
||||
|
||||
public Long getBoletoOriginalId() {
|
||||
return boletoOriginalId;
|
||||
}
|
||||
|
||||
public String getNumAsiento() {
|
||||
return numAsiento;
|
||||
}
|
||||
|
@ -285,7 +295,8 @@ public class BoletoComissao {
|
|||
if (getBoletoId() == null) {
|
||||
if (other.getBoletoId() != null)
|
||||
return false;
|
||||
} else if (!getBoletoId().equals(other.getBoletoId()))
|
||||
}
|
||||
else if (!getBoletoId().equals(other.getBoletoId()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -355,14 +366,12 @@ public class BoletoComissao {
|
|||
}
|
||||
|
||||
public BigDecimal getTotal() {
|
||||
BigDecimal total = BigDecimal.ZERO;
|
||||
total = total.add(getValorpagado())
|
||||
return BigDecimal.ZERO
|
||||
.add(getValorpagado())
|
||||
.add(getEmbarque())
|
||||
.add(getSeguro())
|
||||
.add(getPedagio())
|
||||
.add(getSeguro());
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public String getDescTipoVenta() {
|
||||
|
@ -372,20 +381,28 @@ public class BoletoComissao {
|
|||
public String getSituacaoBilhete() {
|
||||
if (isOcd()) {
|
||||
return "OCD";
|
||||
} else if((isStatusCancelado()) && (isMotivocancelacionDevolvido() || isMotivocancelacionCancelado()) && StringUtils.isNotBlank(getDescmotivocancelacion())) {
|
||||
}
|
||||
else if ((isStatusCancelado()) && (isMotivocancelacionDevolvido() || isMotivocancelacionCancelado())
|
||||
&& StringUtils.isNotBlank(getDescmotivocancelacion())) {
|
||||
return getDescmotivocancelacion();
|
||||
} else if((isStatusVendido() || isStatusCancelado()) && !isMotivocancelacionDevolvido() && !isMotivocancelacionCancelado()) {
|
||||
}
|
||||
else if ((isStatusVendido() || isStatusCancelado())
|
||||
&& !isMotivocancelacionDevolvido() && !isMotivocancelacionCancelado()) {
|
||||
if (isStatusCancelado() && isMotivocancelacionTrocado()) {
|
||||
return "B. VENDIDO TROCADO";
|
||||
} else if (isStatusVendido() && isMotivocancelacionTransferido()) {
|
||||
}
|
||||
else if (isStatusVendido() && isMotivocancelacionTransferido()) {
|
||||
return "B. VENDIDO TRANSFERIDO";
|
||||
}
|
||||
} else if(isStatusTroca()) {
|
||||
}
|
||||
else if (isStatusTroca()) {
|
||||
if (isVendaBilheteTroca(getTipoVenta()) || isVendaGap(getTipoVenta())) {
|
||||
return "B. DA TROCA";
|
||||
} else if (isVendaBilheteTransferencia(getTipoVenta()) || isVendaGap(getTipoVenta())) {
|
||||
}
|
||||
else if (isVendaBilheteTransferencia(getTipoVenta()) || isVendaGap(getTipoVenta())) {
|
||||
return "B. DA TRANSFERENCIA";
|
||||
} else if (isVendaBilheteConfirmaAberto(getTipoVenta())) {
|
||||
}
|
||||
else if (isVendaBilheteConfirmaAberto(getTipoVenta())) {
|
||||
return "CONFIRMAÇÃO ABERTO";
|
||||
}
|
||||
}
|
||||
|
@ -463,7 +480,8 @@ public class BoletoComissao {
|
|||
}
|
||||
|
||||
public Integer getTipoVentaOriginal() {
|
||||
return tipoVentaOriginal2 != null ? tipoVentaOriginal2 : tipoVentaOriginal1 != null ? tipoVentaOriginal1 : tipoVenta;
|
||||
return tipoVentaOriginal2 != null ? tipoVentaOriginal2
|
||||
: tipoVentaOriginal1 != null ? tipoVentaOriginal1 : tipoVenta;
|
||||
}
|
||||
|
||||
public Integer getTipoVentaOriginal1() {
|
||||
|
@ -490,14 +508,40 @@ public class BoletoComissao {
|
|||
this.ocdId = ocdId;
|
||||
}
|
||||
|
||||
private boolean isBoletoOriginal() {
|
||||
return boletoOriginalId == null
|
||||
&& getMotivoCancelacionOriginal() != null
|
||||
&& getMotivoCancelacionOriginal() == Constantes.MVO_CANCEL_BOLETO_AGRUPAMENTO.intValue();
|
||||
}
|
||||
|
||||
public Integer getMotivoCancelacionOriginal() {
|
||||
return motivoCancelacionOriginal2 != null ? motivoCancelacionOriginal2 : motivoCancelacionOriginal1;
|
||||
}
|
||||
|
||||
public Integer getMotivoCancelacionOriginal1() {
|
||||
return motivoCancelacionOriginal1;
|
||||
}
|
||||
|
||||
public void setMotivoCancelacionOriginal1(Integer motivoCancelacionOriginal1) {
|
||||
this.motivoCancelacionOriginal1 = motivoCancelacionOriginal1;
|
||||
}
|
||||
|
||||
public Integer getMotivoCancelacionOriginal2() {
|
||||
return motivoCancelacionOriginal2;
|
||||
}
|
||||
|
||||
public void setMotivoCancelacionOriginal2(Integer motivoCancelacionOriginal2) {
|
||||
this.motivoCancelacionOriginal2 = motivoCancelacionOriginal2;
|
||||
}
|
||||
|
||||
public boolean isVendaManual(Integer tipoVenta) {
|
||||
return tipoVenta == Constantes.TPV_MANUAL.intValue();
|
||||
}
|
||||
|
||||
public boolean isVendaGap(Integer tipoVenta) {
|
||||
return tipoVenta == Constantes.TPV_BOLETO_REMOTO.intValue() ||
|
||||
tipoVenta == Constantes.TPV_CALL_CENTER.intValue() ||
|
||||
tipoVenta == Constantes.TPV_POR_INTERNET.intValue();
|
||||
return tipoVenta == Constantes.TPV_BOLETO_REMOTO.intValue()
|
||||
|| tipoVenta == Constantes.TPV_CALL_CENTER.intValue()
|
||||
|| tipoVenta == Constantes.TPV_POR_INTERNET.intValue();
|
||||
}
|
||||
|
||||
public boolean isVendaBilheteNormal(Integer tipoVenta) {
|
||||
|
@ -541,25 +585,29 @@ public class BoletoComissao {
|
|||
}
|
||||
|
||||
public boolean isMotivocancelacionDevolvido() {
|
||||
return !isSemMotivocancelacion() && (getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO.intValue() ||
|
||||
getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO_CONTIGENCIA_50.intValue() ||
|
||||
getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO_CONTIGENCIA_100.intValue());
|
||||
return !isSemMotivocancelacion() && (getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO.intValue()
|
||||
|| getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO_CONTIGENCIA_50.intValue()
|
||||
|| getMotivoCancelacionId() == Constantes.MVO_CANCEL_DEVOLUCAO_CONTIGENCIA_100.intValue());
|
||||
}
|
||||
|
||||
public boolean isMotivocancelacionEntregaGap() {
|
||||
return !isSemMotivocancelacion() && getMotivoCancelacionId() == Constantes.MVO_CANCEL_BOLETO_ENTREGADO.intValue();
|
||||
return !isSemMotivocancelacion()
|
||||
&& getMotivoCancelacionId() == Constantes.MVO_CANCEL_BOLETO_ENTREGADO.intValue();
|
||||
}
|
||||
|
||||
public boolean isMotivocancelacionTransferido() {
|
||||
return !isSemMotivocancelacion() && getMotivoCancelacionId() == Constantes.MVO_CANCEL_TRANSFERENCIA.intValue();
|
||||
return !isSemMotivocancelacion()
|
||||
&& getMotivoCancelacionId() == Constantes.MVO_CANCEL_TRANSFERENCIA.intValue();
|
||||
}
|
||||
|
||||
public boolean isMotivocancelacionTrocado() {
|
||||
return !isSemMotivocancelacion() && getMotivoCancelacionId() == Constantes.MVO_CANCEL_TROCA.intValue();
|
||||
return !isSemMotivocancelacion()
|
||||
&& getMotivoCancelacionId() == Constantes.MVO_CANCEL_TROCA.intValue();
|
||||
}
|
||||
|
||||
public boolean isMotivocancelacionCheckin() {
|
||||
return !isSemMotivocancelacion() && getMotivoCancelacionId() == Constantes.MVO_CANCEL_CHECKIN.intValue();
|
||||
return !isSemMotivocancelacion()
|
||||
&& getMotivoCancelacionId() == Constantes.MVO_CANCEL_CHECKIN.intValue();
|
||||
}
|
||||
|
||||
/** ABA BILHETE MANUAL */
|
||||
|
@ -569,27 +617,32 @@ public class BoletoComissao {
|
|||
|
||||
/** ABA BILHETE VENDIDO */
|
||||
public boolean isBilheteNormalVendido() {
|
||||
return (isVendaBilheteNormal(getTipoVenta()) && isSemMotivocancelacion() && isStatusVendido()) || // Venda sem alteração
|
||||
(isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTrocado()) || // Venda trocada
|
||||
(isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTransferido()) || // Venda transferida
|
||||
(isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCancelado()) || // Venda cancelada
|
||||
(isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionDevolvido()) || // Venda devolvida
|
||||
(isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionAgrupamento()) || // Agrupamento de corrida
|
||||
(isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCheckin()) || // Venda normal Checkin
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCheckin()) || // Venda troca Checkin
|
||||
(isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCheckin()) || // Venda transferencia Checkin
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion()) || // Novo bilhete da troca
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusVendido() && isSemMotivocancelacion()) || // Novo bilhete de agrupamento de corrida
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido()) || // Novo bilhete da troca devolvido
|
||||
(isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado()) || // Novo bilhete transferido devolvido
|
||||
(isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido()) || // Novo bilhete da troca cancelado
|
||||
(isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado()) || // Novo bilhete transferido cancelado
|
||||
(isVendaBilheteTransferencia(getTipoVenta()) && isStatusEntregue() && isSemMotivocancelacion()); // bilhete transferido entregue
|
||||
if (nombpasajero.startsWith("ABILIO"))
|
||||
System.out.println("break point");
|
||||
|
||||
return (isVendaBilheteNormal(getTipoVenta()) && isSemMotivocancelacion()
|
||||
&& isStatusVendido()) // Venda sem alteração
|
||||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTrocado()) // Venda trocada
|
||||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTransferido()) // Venda transferida
|
||||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCancelado()) // Venda cancelada
|
||||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionDevolvido()) // Venda devolvida
|
||||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionAgrupamento() && isBoletoOriginal()) // Agrupamento de corrida
|
||||
|| (isVendaBilheteNormal(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCheckin()) // Venda normal Checkin
|
||||
|| (isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCheckin()) // Venda troca Checkin
|
||||
|| (isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCheckin()) // Venda transferencia Checkin
|
||||
|| (isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion()) // Novo bilhete da troca
|
||||
|| (isVendaBilheteTroca(getTipoVenta()) && isStatusVendido() && isSemMotivocancelacion()) // Novo bilhete de agrupamento de corrida
|
||||
|| (isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido()) // Novo bilhete da troca devolvido
|
||||
|| (isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado()) // Novo bilhete transferido devolvido
|
||||
|| (isVendaBilheteTroca(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido()) // Novo bilhete da troca cancelado
|
||||
|| (isVendaBilheteTransferencia(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado()) // Novo bilhete transferido cancelado
|
||||
|| (isVendaBilheteTransferencia(getTipoVenta()) && isStatusEntregue() && isSemMotivocancelacion()); // bilhete transferido entregue
|
||||
}
|
||||
|
||||
/** ABA BILHETE DEVOLVIDO */
|
||||
public boolean isBilheteNormalTrocado() {
|
||||
return isVendaBilheteNormal(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado();
|
||||
return isVendaBilheteNormal(getTipoVenta()) && isStatusCancelado()
|
||||
&& isMotivocancelacionTrocado();
|
||||
}
|
||||
|
||||
/** ABA BILHETE VENDIDO */
|
||||
|
@ -659,43 +712,49 @@ public class BoletoComissao {
|
|||
|
||||
/** ABA GAP VENDIDA */
|
||||
public boolean isBilheteGapVendido() {
|
||||
return (isVendaGap(getTipoVenta()) && isSemMotivocancelacion() && isStatusVendido() && isSemNumFolioSistema()) || // Gap sem alteração
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionEntregaGap() && isSemNumFolioSistema()) || // Gap entregue
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionEntregaGap() && isSemNumFolioSistema()) || // Gap entregue
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTrocado() && isSemNumFolioSistema()) || // Gap trocada
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTransferido() && isSemNumFolioSistema()) || // Gap transferida
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCancelado() && isSemNumFolioSistema()) || // Gap cancelada
|
||||
(isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) || // Gap devolvida
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion() && isSemNumFolioSistema()) || // Gap Novo bilhete da troca
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) || // Gap Novo bilhete da troca devolvido
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado() && isSemNumFolioSistema()) || // Gap Novo bilhete transferido devolvido
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) || // Gap Novo bilhete da troca cancelado
|
||||
(isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado() && isSemNumFolioSistema()); // Gap Novo bilhete transferido cancelado
|
||||
return (isVendaGap(getTipoVenta()) && isSemMotivocancelacion() && isStatusVendido()
|
||||
&& isSemNumFolioSistema()) // Gap sem alteração
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionEntregaGap() && isSemNumFolioSistema()) // Gap entregue
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionEntregaGap() && isSemNumFolioSistema()) // Gap entregue
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTrocado() && isSemNumFolioSistema()) // Gap trocada
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionTransferido() && isSemNumFolioSistema()) // Gap transferida
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionCancelado() && isSemNumFolioSistema()) // Gap cancelada
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusVendido() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) // Gap devolvida
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusTroca() && isSemMotivocancelacion() && isSemNumFolioSistema()) // Gap Novo bilhete da troca
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) // Gap Novo bilhete da troca devolvido
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado() && isSemNumFolioSistema()) // Gap Novo bilhete transferido devolvido
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionDevolvido() && isSemNumFolioSistema()) // Gap Novo bilhete da troca cancelado
|
||||
|| (isVendaGap(getTipoVenta()) && isStatusTroca() && isMotivocancelacionCancelado() && isSemNumFolioSistema()); // Gap Novo bilhete transferido cancelado
|
||||
}
|
||||
|
||||
/** ABA GAP DEVOLVIDO */
|
||||
public boolean isBilheteGapTrocado() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado() && isSemNumFolioSistema();
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado()
|
||||
&& isMotivocancelacionTrocado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA GAP DEVOLVIDO */
|
||||
public boolean isBilheteGapTrocadoDevolvido() {
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionTrocado() && isStatusCancelado() && isSemNumFolioSistema();
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionTrocado()
|
||||
&& isStatusCancelado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA GAP CANCELADO */
|
||||
public boolean isBilheteGapTrocadoCancelado() {
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado() && isStatusCancelado() && isSemNumFolioSistema();
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado()
|
||||
&& isStatusCancelado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA GAP CANCELADO */
|
||||
public boolean isBilheteGapCancelado() {
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado() && isStatusCancelado() && isSemNumFolioSistema();
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionCancelado()
|
||||
&& isStatusCancelado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA GAP DEVOLVIDO */
|
||||
public boolean isBilheteGapDevolvido() {
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionDevolvido() && isStatusCancelado() && isSemNumFolioSistema();
|
||||
return isVendaGap(getTipoVenta()) && isMotivocancelacionDevolvido()
|
||||
&& isStatusCancelado() && isSemNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA BILHETE VENDIDO */
|
||||
|
@ -705,17 +764,20 @@ public class BoletoComissao {
|
|||
|
||||
/** ABA BILHETE DEVOLVIDO */
|
||||
public boolean isBilheteEntregaGapTrocado() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionTrocado() && isComNumFolioSistema();
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado()
|
||||
&& isMotivocancelacionTrocado() && isComNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA BILHETE DEVOLVIDO */
|
||||
public boolean isBilheteEntregaGapDevolvido() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionDevolvido() && isComNumFolioSistema();
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado()
|
||||
&& isMotivocancelacionDevolvido() && isComNumFolioSistema();
|
||||
}
|
||||
|
||||
/** ABA BILHETE CANCELADO */
|
||||
public boolean isBilheteEntregaGapCancelado() {
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado() && isMotivocancelacionCancelado() && isComNumFolioSistema();
|
||||
return isVendaGap(getTipoVenta()) && isStatusCancelado()
|
||||
&& isMotivocancelacionCancelado() && isComNumFolioSistema();
|
||||
}
|
||||
|
||||
public boolean isStatusVendido() {
|
||||
|
@ -807,12 +869,10 @@ public class BoletoComissao {
|
|||
if (getFeccorrida() != null) {
|
||||
str.append(DateUtil.getStringDate(getFeccorrida(), "dd/MM"));
|
||||
}
|
||||
|
||||
if (getCorridaId() != null) {
|
||||
if (str.length() > 0) {
|
||||
str.append(" - ");
|
||||
}
|
||||
|
||||
str.append(getCorridaId());
|
||||
}
|
||||
|
||||
|
@ -820,11 +880,11 @@ public class BoletoComissao {
|
|||
}
|
||||
|
||||
public boolean isBilheteGap() {
|
||||
return isBilheteGapVendido() ||
|
||||
isBilheteGapCancelado() ||
|
||||
isBilheteGapTrocado() ||
|
||||
isBilheteGapTrocadoCancelado() ||
|
||||
isBilheteGapTrocadoDevolvido();
|
||||
return isBilheteGapVendido()
|
||||
|| isBilheteGapCancelado()
|
||||
|| isBilheteGapTrocado()
|
||||
|| isBilheteGapTrocadoCancelado()
|
||||
|| isBilheteGapTrocadoDevolvido();
|
||||
}
|
||||
|
||||
public boolean isTotalizarFormapago() {
|
||||
|
@ -836,20 +896,18 @@ public class BoletoComissao {
|
|||
}
|
||||
|
||||
private boolean isTotalizarTipovenda() {
|
||||
return isBilhetesManualVendido() ||
|
||||
isBilheteNormalVendido() ||
|
||||
isBilheteNormalTrocado() ||
|
||||
isBilheteNormalTrocadoCancelado() ||
|
||||
isBilheteNormalTrocadoDevolvido() ||
|
||||
isBilheteNormalCancelado() ||
|
||||
isBilheteNormalDevolvido() ||
|
||||
isBilheteAberto() ||
|
||||
isBilheteGapCancelado() ||
|
||||
isBilheteGapDevolvido() ||
|
||||
isBilheteGapVendido() ||
|
||||
isBilheteGapTrocadoCancelado() ||
|
||||
isBilheteGapTrocadoDevolvido();
|
||||
|
||||
return isBilhetesManualVendido()
|
||||
|| isBilheteNormalVendido()
|
||||
|| isBilheteNormalTrocado()
|
||||
|| isBilheteNormalTrocadoCancelado()
|
||||
|| isBilheteNormalTrocadoDevolvido()
|
||||
|| isBilheteNormalCancelado()
|
||||
|| isBilheteNormalDevolvido()
|
||||
|| isBilheteAberto()
|
||||
|| isBilheteGapCancelado()
|
||||
|| isBilheteGapDevolvido()
|
||||
|| isBilheteGapVendido()
|
||||
|| isBilheteGapTrocadoCancelado()
|
||||
|| isBilheteGapTrocadoDevolvido();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue