wilian 2017-05-08 18:39:25 +00:00
parent 673100c432
commit e383d89fdb
4 changed files with 54 additions and 3 deletions

View File

@ -209,4 +209,8 @@ public class NotaCreditoVendaPacote implements java.io.Serializable {
this.ocdDatosPagamentoList = ocdDatosPagamentos;
}
public Integer getSituacao() {
return situacao;
}
}

View File

@ -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;
@ -320,5 +322,13 @@ public class OCD implements java.io.Serializable {
return false;
return true;
}
public BigDecimal getValorTarjeta() {
return valorTarjeta;
}
public void setValorTarjeta(BigDecimal valorTarjeta) {
this.valorTarjeta = valorTarjeta;
}
}

View File

@ -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;
}
}

View File

@ -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;
}