BrightSide Workbench Full Report + Source Code
DocumentPortfolio.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2019 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.model.document.contract;
20 
21 import java.util.Date;
22 import java.util.logging.Level;
23 import java.util.logging.Logger;
24 import org.turro.elephant.context.Application;
25 import org.turro.elephant.context.ElephantContext;
26 import org.turro.financials.entity.Document;
27 import org.turro.util.CompareUtil;
28 
33 public class DocumentPortfolio implements Comparable<DocumentPortfolio> {
34 
35  private Document document;
36  private Date date;
37  private String concept;
38  private Double invoice, portfolio, settlement, balance;
39 
40  public Document getDocument() {
41  return document;
42  }
43 
44  public void setDocument(Document document) {
45  this.document = document;
46  }
47 
48  public Date getDate() {
49  return date;
50  }
51 
52  public void setDate(Date date) {
53  this.date = date;
54  }
55 
56  public String getConcept() {
57  return concept;
58  }
59 
60  public void setConcept(String concept) {
61  this.concept = concept;
62  }
63 
64  public Double getInvoice() {
65  return invoice;
66  }
67 
68  public void setInvoice(Double invoice) {
69  this.invoice = invoice;
70  }
71 
72  public Double getPortfolio() {
73  return portfolio;
74  }
75 
76  public void setPortfolio(Double portfolio) {
77  this.portfolio = portfolio;
78  }
79 
80  public Double getSettlement() {
81  return settlement;
82  }
83 
84  public void setSettlement(Double settlement) {
85  this.settlement = settlement;
86  }
87 
88  public Double getBalance() {
89  return balance;
90  }
91 
92  public void setBalance(Double balance) {
93  this.balance = balance;
94  }
95 
96  public String getPdfUrl() {
97  try {
99  } catch (Exception ex) {
100  Logger.getLogger(DocumentPortfolio.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
101  }
102  return null;
103  }
104 
105  @Override
106  public int compareTo(DocumentPortfolio o) {
107  if(document == null) return -1;
108  if(o.getDocument() == null) return 1;
109  int result = CompareUtil.compare(date, o.getDate());
110  if(result == 0) {
111  result = CompareUtil.compare(document.getId(), o.getDocument().getId());
112  }
113  return result;
114  }
115 
116 }
static String createURL(IConstructor constructor, Document document)