fixes bug #8970
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@68599 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
673100c432
commit
e383d89fdb
|
@ -209,4 +209,8 @@ public class NotaCreditoVendaPacote implements java.io.Serializable {
|
|||
this.ocdDatosPagamentoList = ocdDatosPagamentos;
|
||||
}
|
||||
|
||||
public Integer getSituacao() {
|
||||
return situacao;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,8 +56,10 @@ public class OCD implements java.io.Serializable {
|
|||
private Date fecpagar;
|
||||
@Column(name = "VALOR_PAGAR", precision = 7, scale = 2)
|
||||
private BigDecimal valorPagar;
|
||||
@Column(name = "SALDO_PAGAR")
|
||||
@Column(name = "SALDO_PAGAR", precision = 7, scale = 2)
|
||||
private BigDecimal saldoPagar;
|
||||
@Column(name = "VALOR_TARJETA", precision = 7, scale = 2)
|
||||
private BigDecimal valorTarjeta;
|
||||
@Column(name = "PENALIZACION", precision = 7, scale = 2)
|
||||
private BigDecimal penalizacion;
|
||||
|
||||
|
@ -321,4 +323,12 @@ public class OCD implements java.io.Serializable {
|
|||
return true;
|
||||
}
|
||||
|
||||
public BigDecimal getValorTarjeta() {
|
||||
return valorTarjeta;
|
||||
}
|
||||
|
||||
public void setValorTarjeta(BigDecimal valorTarjeta) {
|
||||
this.valorTarjeta = valorTarjeta;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.rjconsultores.ventaboletos.enums;
|
||||
|
||||
public enum SituacaoNotaCreditoVendaPacote {
|
||||
|
||||
DISPONIVEL(0,"Disponível"),
|
||||
UTILIZADA(1,"Utilizada");
|
||||
|
||||
private Integer value;
|
||||
private String descricao;
|
||||
|
||||
private SituacaoNotaCreditoVendaPacote(Integer value, String descricao) {
|
||||
this.value = value;
|
||||
this.descricao = descricao;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.descricao;
|
||||
}
|
||||
|
||||
}
|
|
@ -17,6 +17,8 @@ import com.rjconsultores.ventaboletos.entidad.CajaTarjeta;
|
|||
import com.rjconsultores.ventaboletos.entidad.NotaCreditoVendaPacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.OCD;
|
||||
import com.rjconsultores.ventaboletos.entidad.OCDDatosPagamento;
|
||||
import com.rjconsultores.ventaboletos.enums.SituacaoNotaCreditoVendaPacote;
|
||||
import com.rjconsultores.ventaboletos.utilerias.MoneyHelper;
|
||||
import com.rjconsultores.ventaboletos.utilerias.OcdUtil;
|
||||
|
||||
@XmlRootElement(name = "ocdNotaCredito")
|
||||
|
@ -341,7 +343,12 @@ public class ReembolsoOcdNotaCreditoVO {
|
|||
vo.localizador = OcdUtil.generaLocalizadorOCD(ocd);
|
||||
vo.data = ocd.getFecinc();
|
||||
vo.dataPagamento = ocd.getFecpagar();
|
||||
vo.valor = ocd.getSaldoPagar();
|
||||
|
||||
if(ocd.getIndpago() != null && ocd.getIndpago()) {
|
||||
vo.valor = MoneyHelper.somar(ocd.getValorPagar(), ocd.getValorTarjeta());
|
||||
} else {
|
||||
vo.valor = ocd.getSaldoPagar();
|
||||
}
|
||||
vo.tarjetas = new HashSet<ReembolsoOcdNotaCreditoTarjetaVO>();
|
||||
if (StringUtils.isNotEmpty(ocd.getNumtarjeta())) {
|
||||
vo.tarjetas.add(new ReembolsoOcdNotaCreditoTarjetaVO(ocd));
|
||||
|
@ -354,7 +361,12 @@ public class ReembolsoOcdNotaCreditoVO {
|
|||
vo.localizador = String.valueOf(notaCredito.getNotaCreditoVendaPacoteId());
|
||||
vo.data = notaCredito.getDatanotacredito();
|
||||
vo.dataPagamento = notaCredito.getDatapagamento();
|
||||
vo.valor = notaCredito.getValor();
|
||||
|
||||
if(notaCredito.getSituacao().equals(SituacaoNotaCreditoVendaPacote.UTILIZADA.getValue())) {
|
||||
vo.valor = notaCredito.getValor();
|
||||
} else {
|
||||
vo.valor = notaCredito.getSaldoPagar();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue