Rev 320 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 320 | Rev 727 | ||
|---|---|---|---|
| Line 20... | Line 20... | ||
| 20 | import org.hibernate.annotations.ForeignKey; |
20 | import org.hibernate.annotations.ForeignKey; |
| 21 | 21 | ||
| 22 | import br.com.ec.core.util.StringUtil; |
22 | import br.com.ec.core.util.StringUtil; |
| 23 | import br.com.ec.core.util.VerificadorUtil; |
23 | import br.com.ec.core.util.VerificadorUtil; |
| 24 | import br.com.ec.domain.model.tipos.TipoPersonalizacao; |
24 | import br.com.ec.domain.model.tipos.TipoPersonalizacao; |
| - | 25 | import br.com.ec.domain.model.tipos.TipoProduto; |
|
| 25 | import br.com.ec.domain.shared.ConstantesSEC; |
26 | import br.com.ec.domain.shared.ConstantesSEC; |
| 26 | 27 | ||
| 27 | @Entity |
28 | @Entity |
| 28 | @Table(name="sec_lancamento", schema="sc_sec") |
29 | @Table(name="sec_lancamento", schema="sc_sec") |
| 29 | public class Lancamento implements Serializable, Cloneable { |
30 | public class Lancamento implements Serializable, Cloneable { |
| Line 369... | Line 370... | ||
| 369 | }
|
370 | }
|
| 370 | 371 | ||
| 371 | @Transient |
372 | @Transient |
| 372 | public Long getSequencialDoCupom() { |
373 | public Long getSequencialDoCupom() { |
| 373 | return VerificadorUtil.naoEstaNulo(getCupom())? getCupom().getSequencial() : null; |
374 | return VerificadorUtil.naoEstaNulo(getCupom())? getCupom().getSequencial() : null; |
| - | 375 | }
|
|
| - | 376 | ||
| - | 377 | @Transient |
|
| - | 378 | public Double valorCashbackGerado() { |
|
| - | 379 | Double valorCashback = new Double(0.0); |
|
| - | 380 | if (VerificadorUtil.naoEstaNulo(getValorVenda()) && VerificadorUtil.naoEstaNulo(getValorVarejo())) { |
|
| - | 381 | if (VerificadorUtil.estaNulo(getCupom()) && getValorVenda() >= getValorVarejo()) { |
|
| - | 382 | valorCashback = valorCashback + getValorVenda()/100 * TipoProduto.parse(getProduto().getTipo()).getPercentualCashback(); |
|
| - | 383 | }
|
|
| - | 384 | }
|
|
| - | 385 | return valorCashback; |
|
| 374 | }
|
386 | }
|
| 375 | 387 | ||
| 376 | }
|
388 | }
|