org.geebis.books.model.terms
Class DaysDrivenTerms

java.lang.Object
  extended by org.geebis.books.model.terms.Terms
      extended by org.geebis.books.model.terms.DaysDrivenTerms
All Implemented Interfaces:
java.io.Serializable

@Name(value="daysDrivenTerms")
public class DaysDrivenTerms
extends Terms
implements java.io.Serializable

A DaysDrivenTerms is a Terms that is based off of a number of days from when an invoice is sent. An example would be "NET 30" where an invoice is due in 30 days.

See Also:
Serialized Form

Constructor Summary
DaysDrivenTerms()
           
DaysDrivenTerms(java.lang.String name)
           
DaysDrivenTerms(java.lang.String name, java.lang.Double discountPercent)
           
DaysDrivenTerms(java.lang.String name, java.lang.Double discountPercent, java.lang.Integer days)
           
DaysDrivenTerms(java.lang.String name, java.lang.Double discountPercent, java.lang.Integer days, java.lang.Integer discountDays)
           
 
Method Summary
 java.util.Date calculateDiscountDate(java.util.Date issuedDate)
          Gets the cut off date that a discount can be taken at with this terms
 java.util.Date calculateDueDate(java.util.Date issuedDate)
          Gets the due date of an invoice with the passed in date
 java.lang.Integer getDays()
          Gets the number of days before this terms is due
 java.lang.Integer getDiscountDays()
          Gets the number of days that a discount may be taken on this terms
 void setDays(java.lang.Integer days)
          Sets the number of days until this terms is due
 void setDiscountDays(java.lang.Integer discountDays)
          Sets the number of days that a discount may be take on this terms
 
Methods inherited from class org.geebis.books.model.terms.Terms
calculateDiscountAmount, calculateStatus, getDiscountPercent, getId, getName, getVersion, setDiscountPercent, setId, setName, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaysDrivenTerms

public DaysDrivenTerms()

DaysDrivenTerms

public DaysDrivenTerms(java.lang.String name)

DaysDrivenTerms

public DaysDrivenTerms(java.lang.String name,
                       java.lang.Double discountPercent)

DaysDrivenTerms

public DaysDrivenTerms(java.lang.String name,
                       java.lang.Double discountPercent,
                       java.lang.Integer days)

DaysDrivenTerms

public DaysDrivenTerms(java.lang.String name,
                       java.lang.Double discountPercent,
                       java.lang.Integer days,
                       java.lang.Integer discountDays)
Method Detail

getDays

public java.lang.Integer getDays()
Gets the number of days before this terms is due

Returns:
the number of days before this terms is due

setDays

public void setDays(java.lang.Integer days)
Sets the number of days until this terms is due

Parameters:
days - the new number of days before this terms is due

getDiscountDays

public java.lang.Integer getDiscountDays()
Gets the number of days that a discount may be taken on this terms

Returns:
the number of days that a discount may be taken on this terms

setDiscountDays

public void setDiscountDays(java.lang.Integer discountDays)
Sets the number of days that a discount may be take on this terms

Parameters:
discountDays - the new number of days that a discount may be taken on this temr

calculateDiscountDate

public java.util.Date calculateDiscountDate(java.util.Date issuedDate)
Description copied from class: Terms
Gets the cut off date that a discount can be taken at with this terms

Specified by:
calculateDiscountDate in class Terms
Parameters:
issuedDate - the date the invoice was issued
Returns:
the cut off date for taking a discount

calculateDueDate

public java.util.Date calculateDueDate(java.util.Date issuedDate)
Description copied from class: Terms
Gets the due date of an invoice with the passed in date

Specified by:
calculateDueDate in class Terms
Parameters:
issuedDate - the date the invoice was issued
Returns:
the date the invoice is due