KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensourcestrategies > financials > invoice > InvoiceWithOutstandingBalance


1 /*
2  * Copyright (c) 2006 - 2007 Open Source Strategies, Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the Honest Public License.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * Honest Public License for more details.
11  *
12  * You should have received a copy of the Honest Public License
13  * along with this program; if not, write to Funambol,
14  * 643 Bair Island Road, Suite 305 - Redwood City, CA 94063, USA
15  */

16
17 package com.opensourcestrategies.financials.invoice;
18
19 import org.ofbiz.entity.GenericValue;
20 import java.math.BigDecimal JavaDoc;
21
22 /**
23  * InvoiceWithOutstandingBalance - Wrapper class for the Invoice entity with the amount of unapplied payments and
24  * whether the invoice is past due or not. This is better than just using another Map.
25  *
26  * The get methods seem to be required by Freemarker.
27  *
28  * @author <a HREF="mailto:nate@natereed.com">Nate Reed</a>
29  * @author <a HREF="mailto:sichen@opensourcestrategies.com">Nate Reed</a>
30  * @version $ $
31  * @since
32  */

33
34 public class InvoiceWithOutstandingBalance {
35     public GenericValue invoice;
36     public BigDecimal JavaDoc amount;
37     public boolean isPastDue;
38     
39     public InvoiceWithOutstandingBalance(GenericValue invoice, BigDecimal JavaDoc amount, boolean isPastDue) {
40         // tbd: check that invoice is an "Invoice" object and throw an IllegalArgumentException if not
41
this.invoice = invoice;
42         this.amount = amount;
43         this.isPastDue = isPastDue;
44     }
45     
46     public boolean isPastDue() {
47         return this.isPastDue;
48     }
49     
50     public BigDecimal JavaDoc getAmount() {
51         return this.amount;
52     }
53     
54     public GenericValue getInvoice() {
55         return this.invoice;
56     }
57 }
58
Popular Tags