BrightSide Workbench Full Report + Source Code
FixedAssetDepreciation.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 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 package org.turro.financials.entity;
19 
20 import java.util.Date;
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 javax.persistence.Temporal;
28 import javax.persistence.TemporalType;
29 
34 @Entity
35 public class FixedAssetDepreciation implements java.io.Serializable {
36 
37  @Id
38  @GeneratedValue(strategy=GenerationType.IDENTITY)
39  @Column(name="IDENTIFIER")
40  private long id;
41 
42  @Temporal(value = TemporalType.DATE)
43  private Date depreciationDate;
44 
45  private double perCent;
46 
47  @ManyToOne
48  private FixedAsset fixedAsset;
49 
50  private String comment;
51 
52  public String getComment() {
53  return comment;
54  }
55 
56  public void setComment(String comment) {
57  this.comment = comment;
58  }
59 
60  public Date getDepreciationDate() {
61  return depreciationDate;
62  }
63 
64  public void setDepreciationDate(Date depreciationDate) {
65  this.depreciationDate = depreciationDate;
66  }
67 
69  return fixedAsset;
70  }
71 
72  public void setFixedAsset(FixedAsset fixedAsset) {
73  this.fixedAsset = fixedAsset;
74  }
75 
76  public long getId() {
77  return id;
78  }
79 
80  public void setId(long id) {
81  this.id = id;
82  }
83 
84  public double getPerCent() {
85  return perCent;
86  }
87 
88  public void setPerCent(double perCent) {
89  this.perCent = perCent;
90  }
91 
92  /* Helper */
93 
94  public boolean isValid() {
95  return depreciationDate != null;
96  }
97 }