This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf8 -*- | |
from django.db import models | |
# SIGNALS | |
from django.db.models import signals | |
from utils.signals_comuns import slug_pre_save | |
from datetime import datetime | |
from django.db import models | |
from django.core.urlresolvers import reverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IKCV extends TemplateDeImpostoCondicional { | |
public IKCV(Imposto outroImposto) { | |
super(outroImposto); | |
} | |
public IKCV(){} | |
public boolean deveUsarMaximaTaxacao(Orcamento orcamento) { | |
return orcamento.getValor() > 500.00 && temItemMaiorQue100Reais(orcamento); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Imposto { | |
private final Imposto outroImposto; | |
public Imposto(Imposto outroImposto){ | |
this.outroImposto = outroImposto; | |
} | |
public Imposto(){ | |
this.outroImposto = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
public class Conta { | |
private String nomeTitular; | |
private double saldo; | |
private Date dataDeAbertura; | |
public Conta(String nomeTitular,double saldo,Date dataDeAbertura) { | |
this.nomeTitular = nomeTitular; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ImpostoMuitoAlto extends Imposto{ | |
public ImpostoMuitoAlto(Imposto outroImposto){ | |
super(outroImposto); | |
} | |
public ImpostoMuitoAlto() { | |
} | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Imposto { | |
protected final Imposto outroImposto; | |
public Imposto(Imposto outroImposto){ | |
this.outroImposto = outroImposto; | |
} | |
public Imposto() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package exercise4; | |
import java.util.List; | |
public abstract class TemplateRelatorio { | |
public void gerarRelatorio(MockData mock) | |
{ | |
gerarCabecalho(mock); | |
gerarCorpo(mock.getData()); | |
gerarRodape(mock); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class TemplateImposto implements Imposto{ | |
public double calculaImposto(Orcamento orcamento) { | |
if(usarMaximaTaxacao(orcamento)) | |
return maximaTaxacao(orcamento); | |
else | |
return minimaTaxacao(orcamento); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.List; | |
public class Orcamento { | |
private double valor; | |
private List<Item> itens; | |
public Orcamento(double valor) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Requisicao { | |
private Formato formato; | |
public Requisicao(Formato formato) | |
{ | |
this.formato = formato; | |
} | |
public Formato getFormato() { | |
return formato; |