org.kuali.kfs.module.purap.service.impl
Class PurapAccountingServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.purap.service.impl.PurapAccountingServiceImpl
All Implemented Interfaces:
PurapAccountingService

public class PurapAccountingServiceImpl
extends Object
implements PurapAccountingService

Contains a number of helper methods to deal with accounts on Purchasing Accounts Payable Documents


Field Summary
protected static Boolean ALTERNATE_AMOUNT_NOT_USED
           
protected static Boolean ALTERNATE_AMOUNT_USED
           
protected static int BIG_DECIMAL_ROUNDING_MODE
           
protected static Boolean ITEM_TYPES_EXCLUDED_VALUE
           
protected static Boolean ITEM_TYPES_INCLUDED_VALUE
           
protected static BigDecimal ONE_HUNDRED
           
protected static int SCALE
           
protected static Boolean USE_TAX_EXCLUDED
           
protected static Boolean USE_TAX_INCLUDED
           
protected static Boolean ZERO_TOTALS_NOT_RETURNED_VALUE
           
protected static Boolean ZERO_TOTALS_RETURNED_VALUE
           
 
Constructor Summary
PurapAccountingServiceImpl()
           
 
Method Summary
protected  org.kuali.rice.kns.util.KualiDecimal calculateSumTotal(List<SourceAccountingLine> accounts)
          gets sum total of accounts
protected  void convertAmtToTax(List<PurApAccountingLine> accounts, org.kuali.rice.kns.util.KualiDecimal useTax, List<SourceAccountingLine> newSourceLines)
          Replaces amount field with prorated tax amount in list
 void convertMoneyToPercent(PaymentRequestDocument pr)
          Converts the amount to percent and updates the percent field on the CreditMemoAccount
 void deleteSummaryAccounts(Integer purapDocumentIdentifier, String docType)
          Deletes the ap summary accounts by the id of the doc type (Payment Request - PREQ or Credit Memo - CM)
 List<PurApAccountingLine> generateAccountDistributionForProration(List<SourceAccountingLine> accounts, org.kuali.rice.kns.util.KualiDecimal totalAmount, Integer percentScale)
          Deprecated.  
 List<PurApAccountingLine> generateAccountDistributionForProration(List<SourceAccountingLine> accounts, org.kuali.rice.kns.util.KualiDecimal totalAmount, Integer percentScale, Class clazz)
          Determines an appropriate account distribution for a particular Purchasing Accounts Payable list of Accounts.
 List<PurApAccountingLine> generateAccountDistributionForProrationWithZeroTotal(PurchasingAccountsPayableDocument purapDoc)
          Determines an appropriate account distribution for a particular Purchasing Accounts Payable list of Accounts.
protected  List<SourceAccountingLine> generateAccountSummary(List<PurApItem> items, Set<String> itemTypeCodes, Boolean itemTypeCodesAreIncluded, Boolean useZeroTotals, Boolean useAlternateAmount, Boolean useTaxIncluded, Boolean taxableOnly)
          Generates an account summary, that is it creates a list of source accounts by rounding up the purap accounts off of the purap items.
 List<PurApAccountingLine> generatePercentSummary(PurchasingAccountsPayableDocument purapDoc)
           
 List<SourceAccountingLine> generateSourceAccountsForVendorRemit(PurchasingAccountsPayableDocument document)
          This method generates summary accounts for a vendor payment.
 List<SourceAccountingLine> generateSummary(List<PurApItem> items)
          Generates an account summary, that is it creates a list of source accounts by rounding up the Purchasing Accounts Payable accounts off of the Purchasing Accounts Payable items.
protected  List<SummaryAccount> generateSummaryAccounts(List<PurApItem> items, Boolean useZeroTotals, Boolean useTaxIncluded)
          This creates summary accounts based on a list of items.
 List<SummaryAccount> generateSummaryAccounts(PurchasingAccountsPayableDocument document)
          This creates summary accounts based on a list of items.
 List<SummaryAccount> generateSummaryAccountsWithNoZeroTotals(PurchasingAccountsPayableDocument document)
          This creates summary accounts based on a list of items excluding zero totals.
 List<SummaryAccount> generateSummaryAccountsWithNoZeroTotalsNoUseTax(PurchasingAccountsPayableDocument document)
          This creates summary accounts based on a list of items excluding zero totals and use tax.
 List<SourceAccountingLine> generateSummaryExcludeItemTypes(List<PurApItem> items, Set excludedItemTypeCodes)
          convenience method that generates a list of source accounts while excluding items with the specified item types
 List<SourceAccountingLine> generateSummaryExcludeItemTypesAndNoZeroTotals(List<PurApItem> items, Set excludedItemTypeCodes)
          convenience method that generates a list of source accounts while excluding items with the specified item types and not including items with zero totals
 List<SourceAccountingLine> generateSummaryIncludeItemTypes(List<PurApItem> items, Set includedItemTypeCodes)
          convenience method that generates a list of source accounts while only including items with the specified item types
 List<SourceAccountingLine> generateSummaryIncludeItemTypesAndNoZeroTotals(List<PurApItem> items, Set includedItemTypeCodes)
          convenience method that generates a list of source accounts while only including items with the specified item types and not including items with zero totals
 List<SourceAccountingLine> generateSummaryTaxableAccounts(List<PurApItem> items)
          Generates an account summary with only taxable accounts.
 List<SourceAccountingLine> generateSummaryWithNoZeroTotals(List<PurApItem> items)
          convenience method that generates a list of source accounts while excluding items with $0 amounts
 List<SourceAccountingLine> generateSummaryWithNoZeroTotalsNoUseTax(List<PurApItem> items)
          calls generateSummary with no use tax included
 List<SourceAccountingLine> generateSummaryWithNoZeroTotalsUsingAlternateAmount(List<PurApItem> items)
          convenience method that generates a list of source accounts while excluding items with $0 amounts and using the alternate amount
 List<UseTaxContainer> generateUseTaxAccount(PurchasingAccountsPayableDocument document)
          Generates use tax helper class for a purap document
 List<PurApAccountingLine> getAccountsFromItem(PurApItem item)
           
 List getAccountsPayableSummaryAccounts(Integer purapDocumentIdentifier, String docType)
          Retrieves the ap summary accounts by the id of the doc type (Payment Request - PREQ or Credit Memo - CM)
protected  BigDecimal getLowestPossibleRoundUpNumber()
          gets the lowest possible number for rounding, it works for ROUND_HALF_UP
protected  List<PurApItem> getProcessablePurapItems(List<PurApItem> items, Set itemTypeCodes, Boolean itemTypeCodesAreIncluded, Boolean useZeroTotals)
          This method takes a list of PurchasingApItem objects and parses through them to see if each one should be processed according the the other variables passed in.

Example 1:
items = "ITEM", "SITM", "FRHT", "SPHD"
itemTypeCodes = "FRHT"
itemTypeCodesAreIncluded = ITEM_TYPES_EXCLUDED_VALUE
return items "ITEM", "SITM", "FRHT", "SPHD"


Example 2:
items = "ITEM", "SITM", "FRHT", "SPHD"
itemTypeCodes = "ITEM","FRHT"
itemTypeCodesAreIncluded = ITEM_TYPES_INCLUDED_VALUE
return items "ITEM", "FRHT"
 boolean isTaxAccount(PurchasingAccountsPayableDocument document, SourceAccountingLine account)
          Checks whether the specified accounting line in the specified PurAP document is used for tax withholding.
 List<SourceAccountingLine> mergeAccountingLineLists(List<SourceAccountingLine> accountingLines1, List<SourceAccountingLine> accountingLines2)
          Merges list 2 into list 1
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 void setPurApAccountingDao(PurApAccountingDao purApAccountingDao)
           
 void setPurapService(PurapService purapService)
           
protected  void throwRuntimeException(String methodName, String errorMessage)
          Helper method to log and throw an error
 void updateAccountAmounts(PurchasingAccountsPayableDocument document)
          Updates account amounts based on the percents.
<T extends PurApAccountingLine>
void
updateAccountAmountsWithTotal(List<T> sourceAccountingLines, org.kuali.rice.kns.util.KualiDecimal totalAmount)
          calculates values for a list of accounting lines based on an amount
 void updateItemAccountAmounts(PurApItem item)
          Updates a single items account amounts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE_HUNDRED

protected static final BigDecimal ONE_HUNDRED

SCALE

protected static final int SCALE
See Also:
Constant Field Values

BIG_DECIMAL_ROUNDING_MODE

protected static final int BIG_DECIMAL_ROUNDING_MODE
See Also:
Constant Field Values

ITEM_TYPES_INCLUDED_VALUE

protected static final Boolean ITEM_TYPES_INCLUDED_VALUE

ITEM_TYPES_EXCLUDED_VALUE

protected static final Boolean ITEM_TYPES_EXCLUDED_VALUE

ZERO_TOTALS_RETURNED_VALUE

protected static final Boolean ZERO_TOTALS_RETURNED_VALUE

ZERO_TOTALS_NOT_RETURNED_VALUE

protected static final Boolean ZERO_TOTALS_NOT_RETURNED_VALUE

ALTERNATE_AMOUNT_USED

protected static final Boolean ALTERNATE_AMOUNT_USED

ALTERNATE_AMOUNT_NOT_USED

protected static final Boolean ALTERNATE_AMOUNT_NOT_USED

USE_TAX_INCLUDED

protected static final Boolean USE_TAX_INCLUDED

USE_TAX_EXCLUDED

protected static final Boolean USE_TAX_EXCLUDED
Constructor Detail

PurapAccountingServiceImpl

public PurapAccountingServiceImpl()
Method Detail

getLowestPossibleRoundUpNumber

protected BigDecimal getLowestPossibleRoundUpNumber()
gets the lowest possible number for rounding, it works for ROUND_HALF_UP

Returns:
a BigDecimal representing the lowest possible number for rounding

throwRuntimeException

protected void throwRuntimeException(String methodName,
                                     String errorMessage)
Helper method to log and throw an error

Parameters:
methodName - the method it's coming from
errorMessage - the actual error

generateAccountDistributionForProration

public List<PurApAccountingLine> generateAccountDistributionForProration(List<SourceAccountingLine> accounts,
                                                                         org.kuali.rice.kns.util.KualiDecimal totalAmount,
                                                                         Integer percentScale)
Deprecated. 

Description copied from interface: PurapAccountingService
unused see other generateAccountDistribution methods

Specified by:
generateAccountDistributionForProration in interface PurapAccountingService
Returns:
See Also:
PurapAccountingService.generateAccountDistributionForProration(java.util.List, org.kuali.rice.kns.util.KualiDecimal, java.lang.Integer)

generateAccountDistributionForProration

public List<PurApAccountingLine> generateAccountDistributionForProration(List<SourceAccountingLine> accounts,
                                                                         org.kuali.rice.kns.util.KualiDecimal totalAmount,
                                                                         Integer percentScale,
                                                                         Class clazz)
Description copied from interface: PurapAccountingService
Determines an appropriate account distribution for a particular Purchasing Accounts Payable list of Accounts. It does this by looking at the accounts that were provided which should be generated from a generateSummary method. It then builds up a list of PurApAccountingLines (specified by the Class variable) and tries to determine the appropriate percents to use on the new accounts, this may require some moving of percents to the last account as a slush.

Specified by:
generateAccountDistributionForProration in interface PurapAccountingService
Parameters:
accounts - the incoming source accounts from generateSummary
totalAmount - the total amount of the document
percentScale - the scale to round to
clazz - the class of the Purchasing Accounts Payable Account
Returns:
a list of new Purchasing Accounts Payable Accounts
See Also:
PurapAccountingService.generateAccountDistributionForProration(java.util.List, org.kuali.rice.kns.util.KualiDecimal, java.lang.Integer)

generateAccountDistributionForProrationWithZeroTotal

public List<PurApAccountingLine> generateAccountDistributionForProrationWithZeroTotal(PurchasingAccountsPayableDocument purapDoc)
Description copied from interface: PurapAccountingService
Determines an appropriate account distribution for a particular Purchasing Accounts Payable list of Accounts. It does this by looking at the accounts that were provided which should be generated from a generateSummary method. It then builds up a list of PurApAccountingLines (specified by the Class variable) and tries to determine the appropriate percents to use on the new accounts, this may require some moving of percents to the last account as a slush. This is called when a document has a zero dollar total

Specified by:
generateAccountDistributionForProrationWithZeroTotal in interface PurapAccountingService
Returns:
a list of new Purchasing Accounts Payable Accounts
See Also:
org.kuali.kfs.module.purap.service.PurapAccountingService#generateAccountDistributionForProrationWithZeroTotal(java.util.List, java.lang.Integer)

generateSummary

public List<SourceAccountingLine> generateSummary(List<PurApItem> items)
Description copied from interface: PurapAccountingService
Generates an account summary, that is it creates a list of source accounts by rounding up the Purchasing Accounts Payable accounts off of the Purchasing Accounts Payable items.

Specified by:
generateSummary in interface PurapAccountingService
Returns:
a list of source accounts
See Also:
PurapAccountingService.generateSummary(java.util.List)

generateSummaryTaxableAccounts

public List<SourceAccountingLine> generateSummaryTaxableAccounts(List<PurApItem> items)
Description copied from interface: PurapAccountingService
Generates an account summary with only taxable accounts.

Specified by:
generateSummaryTaxableAccounts in interface PurapAccountingService
Returns:

generateSummaryAccounts

public List<SummaryAccount> generateSummaryAccounts(PurchasingAccountsPayableDocument document)
Description copied from interface: PurapAccountingService
This creates summary accounts based on a list of items.

Specified by:
generateSummaryAccounts in interface PurapAccountingService
Parameters:
document - the document to generate the summary accounts from
Returns:
a list of summary accounts.
See Also:
PurapAccountingService.generateSummaryAccounts(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)

generateSummaryAccountsWithNoZeroTotals

public List<SummaryAccount> generateSummaryAccountsWithNoZeroTotals(PurchasingAccountsPayableDocument document)
Description copied from interface: PurapAccountingService
This creates summary accounts based on a list of items excluding zero totals.

Specified by:
generateSummaryAccountsWithNoZeroTotals in interface PurapAccountingService
Parameters:
document - the document to generate the summary accounts from
Returns:
a list of summary accounts.
See Also:
PurapAccountingService.generateSummaryAccountsWithNoZeroTotals(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)

generateSummaryAccountsWithNoZeroTotalsNoUseTax

public List<SummaryAccount> generateSummaryAccountsWithNoZeroTotalsNoUseTax(PurchasingAccountsPayableDocument document)
Description copied from interface: PurapAccountingService
This creates summary accounts based on a list of items excluding zero totals and use tax.

Specified by:
generateSummaryAccountsWithNoZeroTotalsNoUseTax in interface PurapAccountingService
Parameters:
document - the document to generate the summary accounts from
Returns:
a list of summary accounts.
See Also:
PurapAccountingService.generateSummaryAccountsWithNoZeroTotals(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)

generateSummaryAccounts

protected List<SummaryAccount> generateSummaryAccounts(List<PurApItem> items,
                                                       Boolean useZeroTotals,
                                                       Boolean useTaxIncluded)
This creates summary accounts based on a list of items.

Parameters:
items - a list of PurAp Items.
Returns:
a list of summary accounts.

generateSummaryWithNoZeroTotals

public List<SourceAccountingLine> generateSummaryWithNoZeroTotals(List<PurApItem> items)
Description copied from interface: PurapAccountingService
convenience method that generates a list of source accounts while excluding items with $0 amounts

Specified by:
generateSummaryWithNoZeroTotals in interface PurapAccountingService
Parameters:
items - the items to generate source accounts from
Returns:
a list of source accounts "rolled up" from the purap accounts
See Also:
PurapAccountingService.generateSummaryWithNoZeroTotals(java.util.List)

generateSummaryWithNoZeroTotalsNoUseTax

public List<SourceAccountingLine> generateSummaryWithNoZeroTotalsNoUseTax(List<PurApItem> items)
calls generateSummary with no use tax included

Specified by:
generateSummaryWithNoZeroTotalsNoUseTax in interface PurapAccountingService
Parameters:
items - the items to generate source accounts from
Returns:
a list of source accounts "rolled up" from the purap accounts

generateSummaryWithNoZeroTotalsUsingAlternateAmount

public List<SourceAccountingLine> generateSummaryWithNoZeroTotalsUsingAlternateAmount(List<PurApItem> items)
Description copied from interface: PurapAccountingService
convenience method that generates a list of source accounts while excluding items with $0 amounts and using the alternate amount

Specified by:
generateSummaryWithNoZeroTotalsUsingAlternateAmount in interface PurapAccountingService
Parameters:
items - the items to generate source accounts from
Returns:
a list of source accounts "rolled up" from the purap accounts
See Also:
PurapAccountingService.generateSummaryWithNoZeroTotalsUsingAlternateAmount(java.util.List)

generateSummaryExcludeItemTypes

public List<SourceAccountingLine> generateSummaryExcludeItemTypes(List<PurApItem> items,
                                                                  Set excludedItemTypeCodes)
Description copied from interface: PurapAccountingService
convenience method that generates a list of source accounts while excluding items with the specified item types

Specified by:
generateSummaryExcludeItemTypes in interface PurapAccountingService
Parameters:
items - the items to generate source accounts from
excludedItemTypeCodes - the item types to exclude
Returns:
a list of source accounts "rolled up" from the purap accounts
See Also:
PurapAccountingService.generateSummaryExcludeItemTypes(java.util.List, java.util.Set)

generateSummaryIncludeItemTypesAndNoZeroTotals

public List<SourceAccountingLine> generateSummaryIncludeItemTypesAndNoZeroTotals(List<PurApItem> items,
                                                                                 Set includedItemTypeCodes)
Description copied from interface: PurapAccountingService
convenience method that generates a list of source accounts while only including items with the specified item types and not including items with zero totals

Specified by:
generateSummaryIncludeItemTypesAndNoZeroTotals in interface PurapAccountingService
Parameters:
items - the items to generate source accounts from
Returns:
a list of source accounts "rolled up" from the purap accounts
See Also:
PurapAccountingService.generateSummaryIncludeItemTypesAndNoZeroTotals(java.util.List, java.util.Set)

generateSummaryIncludeItemTypes

public List<SourceAccountingLine> generateSummaryIncludeItemTypes(List<PurApItem> items,
                                                                  Set includedItemTypeCodes)
Description copied from interface: PurapAccountingService
convenience method that generates a list of source accounts while only including items with the specified item types

Specified by:
generateSummaryIncludeItemTypes in interface PurapAccountingService
Parameters:
items - the items to generate source accounts from
Returns:
a list of source accounts "rolled up" from the purap accounts
See Also:
PurapAccountingService.generateSummaryIncludeItemTypes(java.util.List, java.util.Set)

generateSummaryExcludeItemTypesAndNoZeroTotals

public List<SourceAccountingLine> generateSummaryExcludeItemTypesAndNoZeroTotals(List<PurApItem> items,
                                                                                 Set excludedItemTypeCodes)
Description copied from interface: PurapAccountingService
convenience method that generates a list of source accounts while excluding items with the specified item types and not including items with zero totals

Specified by:
generateSummaryExcludeItemTypesAndNoZeroTotals in interface PurapAccountingService
Parameters:
items - the items to generate source accounts from
excludedItemTypeCodes - the item types to exclude
Returns:
a list of source accounts "rolled up" from the purap accounts
See Also:
PurapAccountingService.generateSummaryExcludeItemTypesAndNoZeroTotals(java.util.List, java.util.Set)

generateAccountSummary

protected List<SourceAccountingLine> generateAccountSummary(List<PurApItem> items,
                                                            Set<String> itemTypeCodes,
                                                            Boolean itemTypeCodesAreIncluded,
                                                            Boolean useZeroTotals,
                                                            Boolean useAlternateAmount,
                                                            Boolean useTaxIncluded,
                                                            Boolean taxableOnly)
Generates an account summary, that is it creates a list of source accounts by rounding up the purap accounts off of the purap items.

Parameters:
items - the items to determ
itemTypeCodes - the item types to determine whether to look at an item in combination with itemTypeCodesAreIncluded
itemTypeCodesAreIncluded - value to tell whether the itemTypeCodes parameter lists inclusion or exclusion variables
useZeroTotals - whether to include items with a zero dollar total
useAlternateAmount - an alternate amount used in certain cases for GL entry
Returns:
a list of source accounts

getProcessablePurapItems

protected List<PurApItem> getProcessablePurapItems(List<PurApItem> items,
                                                   Set itemTypeCodes,
                                                   Boolean itemTypeCodesAreIncluded,
                                                   Boolean useZeroTotals)
This method takes a list of PurchasingApItem objects and parses through them to see if each one should be processed according the the other variables passed in.

Example 1:
items = "ITEM", "SITM", "FRHT", "SPHD"
itemTypeCodes = "FRHT"
itemTypeCodesAreIncluded = ITEM_TYPES_EXCLUDED_VALUE
return items "ITEM", "SITM", "FRHT", "SPHD"


Example 2:
items = "ITEM", "SITM", "FRHT", "SPHD"
itemTypeCodes = "ITEM","FRHT"
itemTypeCodesAreIncluded = ITEM_TYPES_INCLUDED_VALUE
return items "ITEM", "FRHT"

Parameters:
items - - list of PurchasingApItem objects that need to be parsed
itemTypeCodes - - list of ItemType codes used in conjunction with itemTypeCodesAreIncluded parameter
itemTypeCodesAreIncluded - - value to tell whether the itemTypeCodes parameter lists inclusion or exclusion variables (see ITEM_TYPES_INCLUDED_VALUE)
useZeroTotals - - value to tell whether to include zero dollar items (see ZERO_TOTALS_RETURNED_VALUE)
Returns:
a list of PurchasingApItem objects that should be used for processing by calling method

updateAccountAmounts

public void updateAccountAmounts(PurchasingAccountsPayableDocument document)
Description copied from interface: PurapAccountingService
Updates account amounts based on the percents. If this is a preq past full entry it updates the percents based on the amounts instead

Specified by:
updateAccountAmounts in interface PurapAccountingService
Parameters:
document - the document
See Also:
PurapAccountingService.updateAccountAmounts(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)

updateItemAccountAmounts

public void updateItemAccountAmounts(PurApItem item)
Description copied from interface: PurapAccountingService
Updates a single items account amounts

Specified by:
updateItemAccountAmounts in interface PurapAccountingService
See Also:
PurapAccountingService.updateItemAccountAmounts(org.kuali.kfs.module.purap.businessobject.PurApItem)

updateAccountAmountsWithTotal

public <T extends PurApAccountingLine> void updateAccountAmountsWithTotal(List<T> sourceAccountingLines,
                                                                          org.kuali.rice.kns.util.KualiDecimal totalAmount)
calculates values for a list of accounting lines based on an amount

Specified by:
updateAccountAmountsWithTotal in interface PurapAccountingService
Parameters:
sourceAccountingLines -
totalAmount -

generatePercentSummary

public List<PurApAccountingLine> generatePercentSummary(PurchasingAccountsPayableDocument purapDoc)

convertMoneyToPercent

public void convertMoneyToPercent(PaymentRequestDocument pr)
Description copied from interface: PurapAccountingService
Converts the amount to percent and updates the percent field on the CreditMemoAccount

Specified by:
convertMoneyToPercent in interface PurapAccountingService
Parameters:
pr - The payment request document containing the accounts whose percentage would be set.
See Also:
PurapAccountingService.convertMoneyToPercent(org.kuali.kfs.module.purap.document.PaymentRequestDocument)

deleteSummaryAccounts

public void deleteSummaryAccounts(Integer purapDocumentIdentifier,
                                  String docType)
Description copied from interface: PurapAccountingService
Deletes the ap summary accounts by the id of the doc type (Payment Request - PREQ or Credit Memo - CM)

Specified by:
deleteSummaryAccounts in interface PurapAccountingService
Parameters:
purapDocumentIdentifier - The purapDocumentIdentifier of the document whose summary accounts are to be deleted.
See Also:
PurapAccountingService.deleteSummaryAccounts(java.lang.Integer, java.lang.String)

getAccountsPayableSummaryAccounts

public List getAccountsPayableSummaryAccounts(Integer purapDocumentIdentifier,
                                              String docType)
Description copied from interface: PurapAccountingService
Retrieves the ap summary accounts by the id of the doc type (Payment Request - PREQ or Credit Memo - CM)

Specified by:
getAccountsPayableSummaryAccounts in interface PurapAccountingService
Parameters:
purapDocumentIdentifier - The purapDocumentIdentifier of the document.

getAccountsFromItem

public List<PurApAccountingLine> getAccountsFromItem(PurApItem item)
Specified by:
getAccountsFromItem in interface PurapAccountingService

generateSourceAccountsForVendorRemit

public List<SourceAccountingLine> generateSourceAccountsForVendorRemit(PurchasingAccountsPayableDocument document)
Description copied from interface: PurapAccountingService
This method generates summary accounts for a vendor payment.

Specified by:
generateSourceAccountsForVendorRemit in interface PurapAccountingService
Returns:
This will get the proper amount on the items that is sent to the vendor

calculateSumTotal

protected org.kuali.rice.kns.util.KualiDecimal calculateSumTotal(List<SourceAccountingLine> accounts)
gets sum total of accounts

Parameters:
accounts -
Returns:

convertAmtToTax

protected void convertAmtToTax(List<PurApAccountingLine> accounts,
                               org.kuali.rice.kns.util.KualiDecimal useTax,
                               List<SourceAccountingLine> newSourceLines)
Replaces amount field with prorated tax amount in list

Parameters:
accounts - list of accounts
useTax - tax to be allocated to these accounts
newSourceLines - rewrites the source account lines

generateUseTaxAccount

public List<UseTaxContainer> generateUseTaxAccount(PurchasingAccountsPayableDocument document)
Description copied from interface: PurapAccountingService
Generates use tax helper class for a purap document

Specified by:
generateUseTaxAccount in interface PurapAccountingService
Returns:
useTaxContainer
See Also:
PurapAccountingService.generateUseTaxAccount(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)

isTaxAccount

public boolean isTaxAccount(PurchasingAccountsPayableDocument document,
                            SourceAccountingLine account)
Description copied from interface: PurapAccountingService
Checks whether the specified accounting line in the specified PurAP document is used for tax withholding. This applies only to PaymentRequestDocument; otherwise it always returns false.

Specified by:
isTaxAccount in interface PurapAccountingService
Parameters:
document - the specified PurAP document
account - the specified accounting line
Returns:
true if the accounting line is a tax account
See Also:
PurapAccountingService.isTaxAccount(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument, org.kuali.kfs.sys.businessobject.SourceAccountingLine)

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)

setPurApAccountingDao

public void setPurApAccountingDao(PurApAccountingDao purApAccountingDao)

setPurapService

public void setPurapService(PurapService purapService)

mergeAccountingLineLists

public List<SourceAccountingLine> mergeAccountingLineLists(List<SourceAccountingLine> accountingLines1,
                                                           List<SourceAccountingLine> accountingLines2)
Description copied from interface: PurapAccountingService
Merges list 2 into list 1

Specified by:
mergeAccountingLineLists in interface PurapAccountingService
Returns:


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