fixes bug#24764
AL-1089 qua: dev:Valdevir git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@113885 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
f2a79f3646
commit
f0d31735d3
|
@ -2,6 +2,7 @@ package com.rjconsultores.ventaboletos.vo.comissao;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
|
@ -49,7 +50,10 @@ public class EventosFinanceirosVO {
|
|||
private Long cajaDiversosId;
|
||||
private Integer usuarioId;
|
||||
private Integer turnoId;
|
||||
private List<FormaPagoEventosFinanceirosVO> formapagos;
|
||||
|
||||
|
||||
|
||||
public EventosFinanceirosVO(Long eventoextraId, Long logconferenciaId) {
|
||||
this.eventoextraId = eventoextraId;
|
||||
this.logconferenciaId = logconferenciaId;
|
||||
|
@ -334,6 +338,36 @@ public class EventosFinanceirosVO {
|
|||
public void setTurnoId(Integer turnoId) {
|
||||
this.turnoId = turnoId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<FormaPagoEventosFinanceirosVO> getFormapagos() {
|
||||
return formapagos;
|
||||
}
|
||||
|
||||
public void setFormapagos(List<FormaPagoEventosFinanceirosVO> formapagos) {
|
||||
this.formapagos = formapagos;
|
||||
}
|
||||
|
||||
public String getDescFormapagos() {
|
||||
StringBuilder sFormapagos = new StringBuilder();
|
||||
for (FormaPagoEventosFinanceirosVO formapago : formapagos) {
|
||||
if (sFormapagos.length() > 0) {
|
||||
sFormapagos.append(", ");
|
||||
}
|
||||
sFormapagos.append(formapago.getDescpago());
|
||||
}
|
||||
return sFormapagos.toString();
|
||||
}
|
||||
|
||||
public BigDecimal getTotal() {
|
||||
BigDecimal total = BigDecimal.ZERO;
|
||||
for (FormaPagoEventosFinanceirosVO formapagoVO : formapagos) {
|
||||
total = total.add(formapagoVO.getImporte());
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
@ -366,4 +400,7 @@ public class EventosFinanceirosVO {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.rjconsultores.ventaboletos.vo.comissao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.rjconsultores.ventaboletos.utilerias.BigDecimalUtil;
|
||||
import com.rjconsultores.ventaboletos.utilerias.LocaleUtil;
|
||||
import com.rjconsultores.ventaboletos.utilerias.MoneyHelper;
|
||||
|
||||
public class FormaPagoEventosFinanceirosVO {
|
||||
|
||||
private Integer formapagoId;
|
||||
private String descpago;
|
||||
private BigDecimal importe;
|
||||
|
||||
|
||||
|
||||
|
||||
public FormaPagoEventosFinanceirosVO(Integer formapagoId, String descpago, BigDecimal importe) {
|
||||
super();
|
||||
this.formapagoId = formapagoId;
|
||||
this.descpago = descpago;
|
||||
this.importe = importe;
|
||||
}
|
||||
public Integer getFormapagoId() {
|
||||
return formapagoId;
|
||||
}
|
||||
public void setFormapagoId(Integer formapagoId) {
|
||||
this.formapagoId = formapagoId;
|
||||
}
|
||||
public String getDescpago() {
|
||||
return descpago;
|
||||
}
|
||||
public void setDescpago(String descpago) {
|
||||
this.descpago = descpago;
|
||||
}
|
||||
public BigDecimal getImporte() {
|
||||
return importe;
|
||||
}
|
||||
public void setImporte(BigDecimal importe) {
|
||||
this.importe = importe;
|
||||
}
|
||||
|
||||
|
||||
public String getImporteFormatado() {
|
||||
return BigDecimalUtil.getBigDecimalToStringDouble2CasasDecimaisFormatado(getImporte(), LocaleUtil.getLocale());
|
||||
}
|
||||
|
||||
public void add(BigDecimal importe) {
|
||||
this.importe = MoneyHelper.somar(this.importe, (importe != null ? importe : BigDecimal.ZERO));
|
||||
}
|
||||
|
||||
public void subtract(BigDecimal importe) {
|
||||
this.importe = MoneyHelper.subtrair(this.importe,(importe != null ? importe : BigDecimal.ZERO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue