BrightSide Workbench Full Report + Source Code
IncomeEntry.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2023 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.book;
20 
21 import java.util.Date;
22 import org.turro.util.Comparison;
23 
28 public class IncomeEntry implements Comparable<IncomeEntry> {
29 
30  private final String docNumber, globalIdentifier, customer;
31  private final Date docDate;
32  private final double tax, taxable, taxAmount, retention, total;
33 
34  public IncomeEntry(String docNumber, String globalIdentifier, String customer,
35  Date docDate, double tax, double taxable, double taxAmount, double retention, double total) {
36  this.docNumber = docNumber;
37  this.globalIdentifier = globalIdentifier;
38  this.customer = customer;
39  this.docDate = docDate;
40  this.tax = tax;
41  this.taxable = taxable;
42  this.taxAmount = taxAmount;
43  this.retention = retention;
44  this.total = total;
45  }
46 
47  public String getDocNumber() {
48  return docNumber;
49  }
50 
51  public String getGlobalIdentifier() {
52  return globalIdentifier;
53  }
54 
55  public String getCustomer() {
56  return customer;
57  }
58 
59  public Date getDocDate() {
60  return docDate;
61  }
62 
63  public double getTax() {
64  return tax;
65  }
66 
67  public double getTaxable() {
68  return taxable;
69  }
70 
71  public double getTaxAmount() {
72  return taxAmount;
73  }
74 
75  public double getRetention() {
76  return retention;
77  }
78 
79  public double getTotal() {
80  return total;
81  }
82 
83  @Override
84  public int compareTo(IncomeEntry o) {
85  return Comparison.ascendant()
86  .compareDate(docDate, o.docDate)
87  .compare(docNumber, o.docNumber)
88  .compare(globalIdentifier, o.globalIdentifier)
89  .get();
90  }
91 
92 }
IncomeEntry(String docNumber, String globalIdentifier, String customer, Date docDate, double tax, double taxable, double taxAmount, double retention, double total)