fixes bug #9567
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@72464 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
719e11882f
commit
92df812ce8
|
@ -34,37 +34,38 @@ public class NotaCreditoVendaPacoteHibernateDAO extends GenericHibernateDAO<Nota
|
|||
public List<ReembolsoOcdNotaCreditoVO> busquedaDatosReembolsoOcdNotaCreditoRS(Date fecInicial, Date fecFinal, Date fecPagamentoInicial, Date fecPagamentoFinal, Boolean indPago) {
|
||||
|
||||
Map<String, Object> params = new HashMap<String,Object>();
|
||||
String queryString = "SELECT n FROM NotaCreditoVendaPacote n "
|
||||
+ "LEFT JOIN FETCH n.ocdDatosPagamentoList "
|
||||
+ "WHERE 1=1 ";
|
||||
StringBuilder queryString = new StringBuilder("SELECT n FROM NotaCreditoVendaPacote n ");
|
||||
queryString.append("LEFT JOIN FETCH n.ocdDatosPagamentoList ")
|
||||
.append("LEFT JOIN FETCH n.vendapacotecancelamento vpc ")
|
||||
.append("WHERE 1=1 ");
|
||||
|
||||
if (fecInicial != null) {
|
||||
queryString += "AND n.datanotacredito >= :fecInicial ";
|
||||
queryString.append("AND n.datanotacredito >= :fecInicial ");
|
||||
params.put("fecInicial", fecInicial);
|
||||
}
|
||||
if (fecFinal != null) {
|
||||
queryString += "AND n.datanotacredito <= :fecFinal ";
|
||||
queryString.append("AND n.datanotacredito <= :fecFinal ");
|
||||
params.put("fecFinal", fecFinal);
|
||||
}
|
||||
|
||||
if (fecPagamentoInicial != null) {
|
||||
queryString += "AND n.datapagamento >= :fecPagamentoInicial ";
|
||||
queryString.append("AND n.datapagamento >= :fecPagamentoInicial ");
|
||||
params.put("fecPagamentoInicial", fecPagamentoInicial);
|
||||
}
|
||||
if (fecPagamentoFinal != null) {
|
||||
queryString += "AND n.datapagamento <= :fecPagamentoFinal ";
|
||||
queryString.append("AND n.datapagamento <= :fecPagamentoFinal ");
|
||||
params.put("fecPagamentoFinal", fecPagamentoFinal);
|
||||
}
|
||||
if (indPago != null) {
|
||||
if (indPago) {
|
||||
queryString += "AND n.situacao = :indPago ";
|
||||
queryString.append("AND n.situacao = :indPago ");
|
||||
} else {
|
||||
queryString += "AND (n.situacao != :indPago OR n.situacao IS NULL) ";
|
||||
queryString.append("AND (n.situacao != :indPago OR n.situacao IS NULL) ");
|
||||
}
|
||||
params.put("indPago", SituacaoVendaPacote.PAGO.getShortValue());
|
||||
}
|
||||
|
||||
Query query = getSession().createQuery(queryString);
|
||||
Query query = getSession().createQuery(queryString.toString());
|
||||
for (String p : query.getNamedParameters()) {
|
||||
query.setParameter(p, params.get(p));
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import java.util.List;
|
|||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
|
@ -25,11 +27,13 @@ public class NotaCreditoVendaPacote implements java.io.Serializable {
|
|||
@Column(name = "MOTIVOCANCELVENDAPACOTE_ID", precision = 7, scale = 0)
|
||||
private Integer motivocancelvendapacoteId;
|
||||
|
||||
@Column(name = "VENDAPACOTECANCELAMENTO_ID", precision = 7, scale = 0)
|
||||
private Integer vendapacotecancelamentoId;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "VENDAPACOTECANCELAMENTO_ID")
|
||||
private VendaPacote vendapacotecancelamento;
|
||||
|
||||
@Column(name = "VENDAPACOTEPAGAMENTO_ID", precision = 7, scale = 0)
|
||||
private Integer vendapacotepagamentoId;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "VENDAPACOTEPAGAMENTO_ID")
|
||||
private VendaPacote vendapacotepagamento;
|
||||
|
||||
@Temporal(TemporalType.DATE)
|
||||
@Column(name = "DATAPAGAMENTO", length = 7)
|
||||
|
@ -89,22 +93,6 @@ public class NotaCreditoVendaPacote implements java.io.Serializable {
|
|||
this.motivocancelvendapacoteId = motivocancelvendapacoteId;
|
||||
}
|
||||
|
||||
public Integer getVendapacotecancelamentoId() {
|
||||
return vendapacotecancelamentoId;
|
||||
}
|
||||
|
||||
public void setVendapacotecancelamentoId(Integer vendapacotecancelamentoId) {
|
||||
this.vendapacotecancelamentoId = vendapacotecancelamentoId;
|
||||
}
|
||||
|
||||
public Integer getVendapacotepagamentoId() {
|
||||
return vendapacotepagamentoId;
|
||||
}
|
||||
|
||||
public void setVendapacotepagamentoId(Integer vendapacotepagamentoId) {
|
||||
this.vendapacotepagamentoId = vendapacotepagamentoId;
|
||||
}
|
||||
|
||||
public Date getDatapagamento() {
|
||||
return datapagamento;
|
||||
}
|
||||
|
@ -213,4 +201,20 @@ public class NotaCreditoVendaPacote implements java.io.Serializable {
|
|||
return situacao;
|
||||
}
|
||||
|
||||
public VendaPacote getVendapacotecancelamento() {
|
||||
return vendapacotecancelamento;
|
||||
}
|
||||
|
||||
public void setVendapacotecancelamento(VendaPacote vendapacotecancelamento) {
|
||||
this.vendapacotecancelamento = vendapacotecancelamento;
|
||||
}
|
||||
|
||||
public VendaPacote getVendapacotepagamento() {
|
||||
return vendapacotepagamento;
|
||||
}
|
||||
|
||||
public void setVendapacotepagamento(VendaPacote vendapacotepagamento) {
|
||||
this.vendapacotepagamento = vendapacotepagamento;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -361,6 +361,7 @@ public class ReembolsoOcdNotaCreditoVO {
|
|||
vo.localizador = String.valueOf(notaCredito.getNotaCreditoVendaPacoteId());
|
||||
vo.data = notaCredito.getDatanotacredito();
|
||||
vo.dataPagamento = notaCredito.getDatapagamento();
|
||||
vo.numoperacion = notaCredito.getVendapacotecancelamento().getNumoperacion();
|
||||
|
||||
if(notaCredito.getSituacao().equals(SituacaoNotaCreditoVendaPacote.UTILIZADA.getValue())) {
|
||||
vo.valor = notaCredito.getValor();
|
||||
|
|
Loading…
Reference in New Issue