org.geebis.books.model.terms
Class DateDrivenTerms

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

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

A DateDrivenTerms is a Terms that goes off of the day of month rather than a number of days after the invoice is due.

See Also:
Serialized Form

Constructor Summary
DateDrivenTerms()
           
DateDrivenTerms(java.lang.String name)
           
DateDrivenTerms(java.lang.String name, java.lang.Double discountPercent)
           
DateDrivenTerms(java.lang.String name, java.lang.Double discountPercent, java.lang.Integer day)
           
DateDrivenTerms(java.lang.String name, java.lang.Double discountPercent, java.lang.Integer day, java.lang.Integer cutOffDays)
           
DateDrivenTerms(java.lang.String name, java.lang.Double discountPercent, java.lang.Integer day, java.lang.Integer cutOffDays, java.lang.Integer discountDay)
           
 
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 getCutOffDays()
          Gets the cut off days for this terms.
 java.lang.Integer getDay()
          Returns the day of the month that this terms is due by
 java.lang.Integer getDiscountDay()
          Sets the discount day for this terms.
 void setCutOffDays(java.lang.Integer cutOffDays)
          Sets the cut off days for this terms.
 void setDay(java.lang.Integer day)
          Sets the day of the month that this terms is due by
 void setDiscountDay(java.lang.Integer discountDay)
          Sets the discount day of the month for 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

DateDrivenTerms

public DateDrivenTerms()

DateDrivenTerms

public DateDrivenTerms(java.lang.String name)

DateDrivenTerms

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

DateDrivenTerms

public DateDrivenTerms(java.lang.String name,
                       java.lang.Double discountPercent,
                       java.lang.Integer day)

DateDrivenTerms

public DateDrivenTerms(java.lang.String name,
                       java.lang.Double discountPercent,
                       java.lang.Integer day,
                       java.lang.Integer cutOffDays)

DateDrivenTerms

public DateDrivenTerms(java.lang.String name,
                       java.lang.Double discountPercent,
                       java.lang.Integer day,
                       java.lang.Integer cutOffDays,
                       java.lang.Integer discountDay)
Method Detail

getDay

public java.lang.Integer getDay()
Returns the day of the month that this terms is due by

Returns:
the day of the mon

setDay

public void setDay(java.lang.Integer day)
Sets the day of the month that this terms is due by

Parameters:
day - the new day of the month for this terms

getCutOffDays

public java.lang.Integer getCutOffDays()
Gets the cut off days for this terms. If an invoice is issued within this many days of the due date, then this terms is due next month instead of this one.

Returns:
the cut off number of days for this terms

setCutOffDays

public void setCutOffDays(java.lang.Integer cutOffDays)
Sets the cut off days for this terms.

Parameters:
cutOffDays - the new number of days to cut off

getDiscountDay

public java.lang.Integer getDiscountDay()
Sets the discount day for this terms. If the invoice is paid within this day of the month, then a discount is taken if there is one.

Returns:
the discount day of the month for this terms

setDiscountDay

public void setDiscountDay(java.lang.Integer discountDay)
Sets the discount day of the month for this terms

Parameters:
discountDay - the new discount day of month for this terms

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