org.kuali.kfs.module.ar.businessobject
Class CustomerInvoiceDetail

java.lang.Object
  extended by org.kuali.rice.kns.bo.BusinessObjectBase
      extended by org.kuali.rice.kns.bo.PersistableBusinessObjectBase
          extended by org.kuali.kfs.sys.businessobject.AccountingLineBase
              extended by org.kuali.kfs.sys.businessobject.SourceAccountingLine
                  extended by org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail
All Implemented Interfaces:
Serializable, org.apache.ojb.broker.PersistenceBrokerAware, AppliedPayment, AccountingLine, GeneralLedgerPendingEntrySourceDetail, org.kuali.rice.kns.bo.BusinessObject, org.kuali.rice.kns.bo.PersistableBusinessObject
Direct Known Subclasses:
ReceivableCustomerInvoiceDetail, SalesTaxCustomerInvoiceDetail, WriteoffCustomerInvoiceDetail, WriteoffTaxCustomerInvoiceDetail

public class CustomerInvoiceDetail
extends SourceAccountingLine
implements AppliedPayment

This class represents a customer invoice detail on the customer invoice document. This class extends SourceAccountingLine since each customer invoice detail has associated accounting line information.

Author:
Kuali Nervous System Team (kualidev@oncourse.iu.edu)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.kuali.kfs.sys.businessobject.AccountingLineBase
financialDocumentLineDescription, financialDocumentLineTypeCode, salesTaxRequired
 
Fields inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
extension, versionNumber
 
Constructor Summary
CustomerInvoiceDetail()
          Default constructor.
 
Method Summary
 ObjectCode getAccountsReceivableObject()
          Gets the accountsReceivableObject attribute.
 String getAccountsReceivableObjectCode()
          Gets the accountsReceivableObjectCode attribute.
 SubObjectCode getAccountsReceivableSubObject()
          Gets the accountsReceivableSubObject attribute.
 String getAccountsReceivableSubObjectCode()
          Gets the accountsReceivableSubObjectCode attribute.
 org.kuali.rice.kns.util.KualiDecimal getAmountApplied()
           
 org.kuali.rice.kns.util.KualiDecimal getAmountAppliedBy(String documentNumber)
           
 org.kuali.rice.kns.util.KualiDecimal getAmountAppliedExcludingAnyAmountAppliedBy(String documentNumber)
           
 org.kuali.rice.kns.util.KualiDecimal getAmountDiscounted()
          Retrieves the discounted amount.
 org.kuali.rice.kns.util.KualiDecimal getAmountOpen()
           
 org.kuali.rice.kns.util.KualiDecimal getAmountOpenByDateFromDatabase(Date date)
          This method returns the amount that remained unapplied on a given date.
 org.kuali.rice.kns.util.KualiDecimal getAmountOpenByDateFromDatabase(Date date)
           
 CustomerInvoiceDocument getCustomerInvoiceDocument()
           
 String getCustomerInvoiceWriteoffDocumentNumber()
           
 CustomerInvoiceDetail getDiscountCustomerInvoiceDetail()
           
 String getInvoiceItemCode()
          Gets the invoiceItemCode attribute.
 String getInvoiceItemDescription()
          Gets the invoiceItemDescription attribute.
 Integer getInvoiceItemDiscountLineNumber()
          Gets the invoiceItemDiscountLineNumber attribute.
 Integer getInvoiceItemNumber()
          If the detail is a discount customer invoice detail, return the parent customer invoice detail's sequence number instead
 org.kuali.rice.kns.util.KualiDecimal getInvoiceItemPreTaxAmount()
          This method returns the invoice pre tax amount
 BigDecimal getInvoiceItemQuantity()
          Gets the invoiceItemQuantity attribute.
 Date getInvoiceItemServiceDate()
          Gets the invoiceItemServiceDate attribute.
 org.kuali.rice.kns.util.KualiDecimal getInvoiceItemTaxAmount()
          Gets the invoiceItemTaxAmount attribute.
 String getInvoiceItemUnitOfMeasureCode()
          Gets the invoiceItemUnitOfMeasureCode attribute.
 BigDecimal getInvoiceItemUnitPrice()
          Gets the invoiceItemUnitPrice attribute.
 String getInvoiceReferenceNumber()
          If detail is part of an invoice that is a reversal, return the invoice that is being corrected.
 List<InvoicePaidApplied> getMatchingInvoicePaidAppliedsMatchingAnyDocumentFromDatabase()
           
 CustomerInvoiceDetail getParentDiscountCustomerInvoiceDetail()
           
 boolean getTaxableIndicator()
           
 UnitOfMeasure getUnitOfMeasure()
           
 org.kuali.rice.kns.util.KualiDecimal getWriteoffAmount()
          This method returns the writeoff amount.
 boolean isDebit()
           
 boolean isDiscountLine()
          This method should only be used to determine if detail is discount line in JSP.
 boolean isDiscountLineParent()
          This method returns true if customer invoice detail has a corresponding discount line
 boolean isTaxableIndicator()
           
 void refresh()
           
 void setAccountsReceivableObject(ObjectCode accountsReceivableObject)
          Deprecated.  
 void setAccountsReceivableObjectCode(String accountsReceivableObjectCode)
          Sets the accountsReceivableObjectCode attribute.
 void setAccountsReceivableSubObject(SubObjectCode accountsReceivableSubObject)
          Deprecated.  
 void setAccountsReceivableSubObjectCode(String accountsReceivableSubObjectCode)
          Sets the accountsReceivableSubObjectCode attribute.
 void setCustomerInvoiceDocument(CustomerInvoiceDocument customerInvoiceDocument)
           
 void setCustomerInvoiceWriteoffDocumentNumber(String customerInvoiceWriteoffDocumentNumber)
           
 void setDebit(boolean isDebit)
           
 void setDiscountCustomerInvoiceDetail(CustomerInvoiceDetail discountCustomerInvoiceDetail)
           
 void setInvoiceItemCode(String invoiceItemCode)
          Sets the invoiceItemCode attribute.
 void setInvoiceItemDescription(String invoiceItemDescription)
          Sets the invoiceItemDescription attribute.
 void setInvoiceItemDiscountLineNumber(Integer invoiceItemDiscountLineNumber)
          Sets the invoiceItemDiscountLineNumber attribute value.
 void setInvoiceItemQuantity(BigDecimal invoiceItemQuantity)
          Sets the invoiceItemQuantity attribute.
 void setInvoiceItemServiceDate(Date invoiceItemServiceDate)
          Sets the invoiceItemServiceDate attribute.
 void setInvoiceItemTaxAmount(org.kuali.rice.kns.util.KualiDecimal invoiceItemTaxAmount)
          Sets the invoiceItemTaxAmount attribute value.
 void setInvoiceItemUnitOfMeasureCode(String invoiceItemUnitOfMeasureCode)
          Sets the invoiceItemUnitOfMeasureCode attribute.
 void setInvoiceItemUnitPrice(BigDecimal invoiceItemUnitPrice)
          Sets the invoiceItemUnitPrice attribute.
 void setInvoiceItemUnitPrice(org.kuali.rice.kns.util.KualiDecimal invoiceItemUnitPrice)
           
 void setInvoiceItemUnitPriceToNegative()
          This method sets the amount to negative if it isn't already negative
 void setParentDiscountCustomerInvoiceDetail(CustomerInvoiceDetail parentDiscountCustomerInvoiceDetail)
           
 void setTaxableIndicator(boolean taxableIndicator)
           
 void setUnitOfMeasure(UnitOfMeasure unitOfMeasure)
           
 void setWriteoffAmount(org.kuali.rice.kns.util.KualiDecimal writeoffAmount)
           
protected  LinkedHashMap toStringMapper()
           
 void updateAmountBasedOnQuantityAndUnitPrice()
          Update line amount based on quantity and unit price
 
Methods inherited from class org.kuali.kfs.sys.businessobject.AccountingLineBase
copyFrom, equals, getAccount, getAccountExpiredOverride, getAccountExpiredOverrideNeeded, getAccountKey, getAccountNumber, getAmount, getBalanceTyp, getBalanceTypeCode, getChart, getChartOfAccountsCode, getDebitCreditCode, getDocumentNumber, getEncumbranceUpdateCode, getFinancialDocumentLineDescription, getFinancialDocumentLineTypeCode, getFinancialObjectCode, getFinancialSubObjectCode, getNonFringeAccountOverride, getNonFringeAccountOverrideNeeded, getObjectCode, getObjectType, getObjectTypeCode, getOrganizationReferenceId, getOverrideCode, getPostingYear, getProject, getProjectCode, getReferenceFinancialSystemDocumentTypeCode, getReferenceNumber, getReferenceOrigin, getReferenceOriginCode, getReferenceTypeCode, getSalesTax, getSequenceNumber, getSubAccount, getSubAccountNumber, getSubObjectCode, getValuesMap, hashCode, isLike, isObjectBudgetOverride, isObjectBudgetOverrideNeeded, isSalesTaxRequired, isSourceAccountingLine, isTargetAccountingLine, setAccount, setAccountExpiredOverride, setAccountExpiredOverrideNeeded, setAccountNumber, setAmount, setBalanceTyp, setBalanceTypeCode, setChart, setChartOfAccountsCode, setDebitCreditCode, setDocumentNumber, setEncumbranceUpdateCode, setFinancialDocumentLineDescription, setFinancialDocumentLineTypeCode, setFinancialObjectCode, setFinancialSubObjectCode, setNonFringeAccountOverride, setNonFringeAccountOverrideNeeded, setObjectBudgetOverride, setObjectBudgetOverrideNeeded, setObjectCode, setOrganizationReferenceId, setOverrideCode, setPostingYear, setProject, setProjectCode, setReferenceNumber, setReferenceOrigin, setReferenceOriginCode, setReferenceTypeCode, setSalesTax, setSalesTaxRequired, setSequenceNumber, setSubAccount, setSubAccountNumber, setSubObjectCode
 
Methods inherited from class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
addNote, afterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeInsert, beforeUpdate, beforeUpdate, buildListOfDeletionAwareLists, deleteNote, getAttachmentService, getBoNote, getBoNotes, getExtension, getNoteService, getObjectId, getPersistenceService, getPersistenceStructureService, getVersionNumber, isAutoIncrementSet, isBoNotesSupport, isNewCollectionRecord, linkEditableUserFields, refreshNonUpdateableReferences, refreshReferenceObject, setAutoIncrementSet, setBoNotes, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber, supportsBoNotes
 
Methods inherited from class org.kuali.rice.kns.bo.BusinessObjectBase
prepareForWorkflow, toString, toStringBuilder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.kns.bo.PersistableBusinessObject
addNote, buildListOfDeletionAwareLists, deleteNote, getBoNote, getBoNotes, getExtension, getObjectId, getVersionNumber, isBoNotesSupport, isNewCollectionRecord, linkEditableUserFields, refreshNonUpdateableReferences, refreshReferenceObject, setAutoIncrementSet, setExtension, setNewCollectionRecord, setObjectId, setVersionNumber
 
Methods inherited from interface org.kuali.rice.kns.bo.BusinessObject
prepareForWorkflow
 
Methods inherited from interface org.apache.ojb.broker.PersistenceBrokerAware
afterDelete, afterInsert, afterLookup, afterUpdate, beforeDelete, beforeInsert, beforeUpdate
 

Constructor Detail

CustomerInvoiceDetail

public CustomerInvoiceDetail()
Default constructor.

Method Detail

getAmountOpen

public org.kuali.rice.kns.util.KualiDecimal getAmountOpen()

getAmountDiscounted

public org.kuali.rice.kns.util.KualiDecimal getAmountDiscounted()
Retrieves the discounted amount. This is the amount minues any discounts that might exist. If no discount exists, then it just returns the amount. NOTE this does not subtract PaidApplieds, only discounts.

Returns:

getAmountOpenByDateFromDatabase

public org.kuali.rice.kns.util.KualiDecimal getAmountOpenByDateFromDatabase(Date date)
This method returns the amount that remained unapplied on a given date.

Parameters:
date -
Returns:

getAmountOpenByDateFromDatabase

public org.kuali.rice.kns.util.KualiDecimal getAmountOpenByDateFromDatabase(Date date)

getAmountApplied

public org.kuali.rice.kns.util.KualiDecimal getAmountApplied()

getAmountAppliedBy

public org.kuali.rice.kns.util.KualiDecimal getAmountAppliedBy(String documentNumber)
Parameters:
paymentApplicationDocument -
Returns:

getAmountAppliedExcludingAnyAmountAppliedBy

public org.kuali.rice.kns.util.KualiDecimal getAmountAppliedExcludingAnyAmountAppliedBy(String documentNumber)
Parameters:
paymentApplicationDocument -
Returns:
the sum of applied amounts according to the database, excluding any amounts applied by paymentApplicationDocument

getWriteoffAmount

public org.kuali.rice.kns.util.KualiDecimal getWriteoffAmount()
This method returns the writeoff amount. If writeoff document hasn't been approved yet, display the open amount. Else display the amount applied from the specific approved writeoff document.

Parameters:
customerInvoiceWriteoffDocumentNumber -
Returns:

getInvoiceItemPreTaxAmount

public org.kuali.rice.kns.util.KualiDecimal getInvoiceItemPreTaxAmount()
This method returns the invoice pre tax amount

Returns:

getAccountsReceivableObjectCode

public String getAccountsReceivableObjectCode()
Gets the accountsReceivableObjectCode attribute.

Returns:
Returns the accountsReceivableObjectCode

setAccountsReceivableObjectCode

public void setAccountsReceivableObjectCode(String accountsReceivableObjectCode)
Sets the accountsReceivableObjectCode attribute.

Parameters:
accountsReceivableObjectCode - The accountsReceivableObjectCode to set.

getAccountsReceivableSubObjectCode

public String getAccountsReceivableSubObjectCode()
Gets the accountsReceivableSubObjectCode attribute.

Returns:
Returns the accountsReceivableSubObjectCode

setAccountsReceivableSubObjectCode

public void setAccountsReceivableSubObjectCode(String accountsReceivableSubObjectCode)
Sets the accountsReceivableSubObjectCode attribute.

Parameters:
accountsReceivableSubObjectCode - The accountsReceivableSubObjectCode to set.

getInvoiceItemQuantity

public BigDecimal getInvoiceItemQuantity()
Gets the invoiceItemQuantity attribute.

Returns:
Returns the invoiceItemQuantity

setInvoiceItemQuantity

public void setInvoiceItemQuantity(BigDecimal invoiceItemQuantity)
Sets the invoiceItemQuantity attribute.

Parameters:
invoiceItemQuantity - The invoiceItemQuantity to set.

getInvoiceItemUnitOfMeasureCode

public String getInvoiceItemUnitOfMeasureCode()
Gets the invoiceItemUnitOfMeasureCode attribute.

Returns:
Returns the invoiceItemUnitOfMeasureCode

setInvoiceItemUnitOfMeasureCode

public void setInvoiceItemUnitOfMeasureCode(String invoiceItemUnitOfMeasureCode)
Sets the invoiceItemUnitOfMeasureCode attribute.

Parameters:
invoiceItemUnitOfMeasureCode - The invoiceItemUnitOfMeasureCode to set.

getInvoiceItemUnitPrice

public BigDecimal getInvoiceItemUnitPrice()
Gets the invoiceItemUnitPrice attribute.

Returns:
Returns the invoiceItemUnitPrice

setInvoiceItemUnitPrice

public void setInvoiceItemUnitPrice(org.kuali.rice.kns.util.KualiDecimal invoiceItemUnitPrice)
Parameters:
invoiceItemUnitPrice -

setInvoiceItemUnitPrice

public void setInvoiceItemUnitPrice(BigDecimal invoiceItemUnitPrice)
Sets the invoiceItemUnitPrice attribute.

Parameters:
invoiceItemUnitPrice - The invoiceItemUnitPrice to set.

getInvoiceItemServiceDate

public Date getInvoiceItemServiceDate()
Gets the invoiceItemServiceDate attribute.

Returns:
Returns the invoiceItemServiceDate

setInvoiceItemServiceDate

public void setInvoiceItemServiceDate(Date invoiceItemServiceDate)
Sets the invoiceItemServiceDate attribute.

Parameters:
invoiceItemServiceDate - The invoiceItemServiceDate to set.

getInvoiceItemCode

public String getInvoiceItemCode()
Gets the invoiceItemCode attribute.

Returns:
Returns the invoiceItemCode

setInvoiceItemCode

public void setInvoiceItemCode(String invoiceItemCode)
Sets the invoiceItemCode attribute.

Parameters:
invoiceItemCode - The invoiceItemCode to set.

getInvoiceItemDescription

public String getInvoiceItemDescription()
Gets the invoiceItemDescription attribute.

Returns:
Returns the invoiceItemDescription

setInvoiceItemDescription

public void setInvoiceItemDescription(String invoiceItemDescription)
Sets the invoiceItemDescription attribute.

Parameters:
invoiceItemDescription - The invoiceItemDescription to set.

getInvoiceItemTaxAmount

public org.kuali.rice.kns.util.KualiDecimal getInvoiceItemTaxAmount()
Gets the invoiceItemTaxAmount attribute. TODO Use tax service to get invoice item tax amount

Returns:
Returns the invoiceItemTaxAmount.

setInvoiceItemTaxAmount

public void setInvoiceItemTaxAmount(org.kuali.rice.kns.util.KualiDecimal invoiceItemTaxAmount)
Sets the invoiceItemTaxAmount attribute value.

Parameters:
invoiceItemTaxAmount - The invoiceItemTaxAmount to set.

getInvoiceItemDiscountLineNumber

public Integer getInvoiceItemDiscountLineNumber()
Gets the invoiceItemDiscountLineNumber attribute.

Returns:
Returns the invoiceItemDiscountLineNumber.

setInvoiceItemDiscountLineNumber

public void setInvoiceItemDiscountLineNumber(Integer invoiceItemDiscountLineNumber)
Sets the invoiceItemDiscountLineNumber attribute value.

Parameters:
invoiceItemDiscountLineNumber - The invoiceItemDiscountLineNumber to set.

getAccountsReceivableSubObject

public SubObjectCode getAccountsReceivableSubObject()
Gets the accountsReceivableSubObject attribute.

Returns:
Returns the accountsReceivableSubObject

setAccountsReceivableSubObject

public void setAccountsReceivableSubObject(SubObjectCode accountsReceivableSubObject)
Deprecated. 

Sets the accountsReceivableSubObject attribute.

Parameters:
accountsReceivableSubObject - The accountsReceivableSubObject to set.

getAccountsReceivableObject

public ObjectCode getAccountsReceivableObject()
Gets the accountsReceivableObject attribute.

Returns:
Returns the accountsReceivableObject

setAccountsReceivableObject

public void setAccountsReceivableObject(ObjectCode accountsReceivableObject)
Deprecated. 

Sets the accountsReceivableObject attribute.

Parameters:
accountsReceivableObject - The accountsReceivableObject to set.

toStringMapper

protected LinkedHashMap toStringMapper()
Overrides:
toStringMapper in class AccountingLineBase
See Also:
BusinessObjectBase.toStringMapper()

updateAmountBasedOnQuantityAndUnitPrice

public void updateAmountBasedOnQuantityAndUnitPrice()
Update line amount based on quantity and unit price


isTaxableIndicator

public boolean isTaxableIndicator()

getTaxableIndicator

public boolean getTaxableIndicator()

setTaxableIndicator

public void setTaxableIndicator(boolean taxableIndicator)

isDebit

public boolean isDebit()

setDebit

public void setDebit(boolean isDebit)

isDiscountLineParent

public boolean isDiscountLineParent()
This method returns true if customer invoice detail has a corresponding discount line

Returns:

isDiscountLine

public boolean isDiscountLine()
This method should only be used to determine if detail is discount line in JSP. If you want to determine if invoice detail is a detail line use CustomerInvoiceDocument.isDiscountLineBasedOnSequenceNumber() instead.

Returns:

setInvoiceItemUnitPriceToNegative

public void setInvoiceItemUnitPriceToNegative()
This method sets the amount to negative if it isn't already negative


getParentDiscountCustomerInvoiceDetail

public CustomerInvoiceDetail getParentDiscountCustomerInvoiceDetail()

setParentDiscountCustomerInvoiceDetail

public void setParentDiscountCustomerInvoiceDetail(CustomerInvoiceDetail parentDiscountCustomerInvoiceDetail)

getDiscountCustomerInvoiceDetail

public CustomerInvoiceDetail getDiscountCustomerInvoiceDetail()

setDiscountCustomerInvoiceDetail

public void setDiscountCustomerInvoiceDetail(CustomerInvoiceDetail discountCustomerInvoiceDetail)

getMatchingInvoicePaidAppliedsMatchingAnyDocumentFromDatabase

public List<InvoicePaidApplied> getMatchingInvoicePaidAppliedsMatchingAnyDocumentFromDatabase()
Returns:
matching InvoicePaidApplieds from the database if they exist

getCustomerInvoiceDocument

public CustomerInvoiceDocument getCustomerInvoiceDocument()

setCustomerInvoiceDocument

public void setCustomerInvoiceDocument(CustomerInvoiceDocument customerInvoiceDocument)

getCustomerInvoiceWriteoffDocumentNumber

public String getCustomerInvoiceWriteoffDocumentNumber()

setCustomerInvoiceWriteoffDocumentNumber

public void setCustomerInvoiceWriteoffDocumentNumber(String customerInvoiceWriteoffDocumentNumber)

setWriteoffAmount

public void setWriteoffAmount(org.kuali.rice.kns.util.KualiDecimal writeoffAmount)

getUnitOfMeasure

public UnitOfMeasure getUnitOfMeasure()

setUnitOfMeasure

public void setUnitOfMeasure(UnitOfMeasure unitOfMeasure)

getInvoiceItemNumber

public Integer getInvoiceItemNumber()
If the detail is a discount customer invoice detail, return the parent customer invoice detail's sequence number instead

Specified by:
getInvoiceItemNumber in interface AppliedPayment
Returns:
See Also:
AppliedPayment.getInvoiceItemNumber()

getInvoiceReferenceNumber

public String getInvoiceReferenceNumber()
If detail is part of an invoice that is a reversal, return the invoice that is being corrected. Else return the customer details document number.

Specified by:
getInvoiceReferenceNumber in interface AppliedPayment
Returns:
See Also:
AppliedPayment.getInvoiceReferenceNumber()

refresh

public void refresh()
Specified by:
refresh in interface org.kuali.rice.kns.bo.BusinessObject
Overrides:
refresh in class org.kuali.rice.kns.bo.PersistableBusinessObjectBase
See Also:
PersistableBusinessObjectBase.refresh()


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.