BrightSide Workbench Full Report + Source Code
Tax.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2013 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.financials.entity;
20 
21 import javax.persistence.Column;
22 import javax.persistence.Entity;
23 import javax.persistence.GeneratedValue;
24 import javax.persistence.GenerationType;
25 import javax.persistence.Id;
26 import javax.persistence.ManyToOne;
27 import org.turro.jpa.entity.IDaoEntity;
28 
33 @Entity
34 public class Tax implements java.io.Serializable, IDaoEntity {
35 
36  @Id
37  @GeneratedValue(strategy=GenerationType.IDENTITY)
38  @Column(name="IDENTIFIER")
39  private long id;
40 
41  @ManyToOne
42  private Contract contract;
43 
44  private TaxType taxType;
45 
46  private double tax, equivalenceSurcharge;
47 
48  public Contract getContract() {
49  return contract;
50  }
51 
52  public void setContract(Contract contract) {
53  this.contract = contract;
54  }
55 
56  public long getId() {
57  return id;
58  }
59 
60  public void setId(long id) {
61  this.id = id;
62  }
63 
64  public TaxType getTaxType() {
65  return taxType;
66  }
67 
68  public void setTaxType(TaxType taxType) {
69  this.taxType = taxType;
70  }
71 
72  public double getTax() {
73  return tax;
74  }
75 
76  public void setTax(double tax) {
77  this.tax = tax;
78  }
79 
80  public double getEquivalenceSurcharge() {
81  return equivalenceSurcharge;
82  }
83 
84  public void setEquivalenceSurcharge(double equivalenceSurcharge) {
85  this.equivalenceSurcharge = equivalenceSurcharge;
86  }
87 
88 
89  /* IDaoEntity */
90 
91  @Override
92  public Object entityId() {
93  return id;
94  }
95 
96  @Override
97  public boolean isEmpty() {
98  return taxType == null || tax == 0.0d;
99  }
100 
101 }
void setTax(double tax)
Definition: Tax.java:76
double getEquivalenceSurcharge()
Definition: Tax.java:80
void setTaxType(TaxType taxType)
Definition: Tax.java:68
void setEquivalenceSurcharge(double equivalenceSurcharge)
Definition: Tax.java:84
void setContract(Contract contract)
Definition: Tax.java:52