|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.module.purap.service.impl.PurapAccountingServiceImpl
public class PurapAccountingServiceImpl
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. |
|
|
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 |
---|
protected static final BigDecimal ONE_HUNDRED
protected static final int SCALE
protected static final int BIG_DECIMAL_ROUNDING_MODE
protected static final Boolean ITEM_TYPES_INCLUDED_VALUE
protected static final Boolean ITEM_TYPES_EXCLUDED_VALUE
protected static final Boolean ZERO_TOTALS_RETURNED_VALUE
protected static final Boolean ZERO_TOTALS_NOT_RETURNED_VALUE
protected static final Boolean ALTERNATE_AMOUNT_USED
protected static final Boolean ALTERNATE_AMOUNT_NOT_USED
protected static final Boolean USE_TAX_INCLUDED
protected static final Boolean USE_TAX_EXCLUDED
Constructor Detail |
---|
public PurapAccountingServiceImpl()
Method Detail |
---|
protected BigDecimal getLowestPossibleRoundUpNumber()
protected void throwRuntimeException(String methodName, String errorMessage)
methodName
- the method it's coming fromerrorMessage
- the actual errorpublic List<PurApAccountingLine> generateAccountDistributionForProration(List<SourceAccountingLine> accounts, org.kuali.rice.kns.util.KualiDecimal totalAmount, Integer percentScale)
PurapAccountingService
generateAccountDistributionForProration
in interface PurapAccountingService
PurapAccountingService.generateAccountDistributionForProration(java.util.List,
org.kuali.rice.kns.util.KualiDecimal, java.lang.Integer)
public List<PurApAccountingLine> generateAccountDistributionForProration(List<SourceAccountingLine> accounts, org.kuali.rice.kns.util.KualiDecimal totalAmount, Integer percentScale, Class clazz)
PurapAccountingService
generateAccountDistributionForProration
in interface PurapAccountingService
accounts
- the incoming source accounts from generateSummarytotalAmount
- the total amount of the documentpercentScale
- the scale to round toclazz
- the class of the Purchasing Accounts Payable Account
PurapAccountingService.generateAccountDistributionForProration(java.util.List,
org.kuali.rice.kns.util.KualiDecimal, java.lang.Integer)
public List<PurApAccountingLine> generateAccountDistributionForProrationWithZeroTotal(PurchasingAccountsPayableDocument purapDoc)
PurapAccountingService
generateAccountDistributionForProrationWithZeroTotal
in interface PurapAccountingService
org.kuali.kfs.module.purap.service.PurapAccountingService#generateAccountDistributionForProrationWithZeroTotal(java.util.List,
java.lang.Integer)
public List<SourceAccountingLine> generateSummary(List<PurApItem> items)
PurapAccountingService
generateSummary
in interface PurapAccountingService
PurapAccountingService.generateSummary(java.util.List)
public List<SourceAccountingLine> generateSummaryTaxableAccounts(List<PurApItem> items)
PurapAccountingService
generateSummaryTaxableAccounts
in interface PurapAccountingService
public List<SummaryAccount> generateSummaryAccounts(PurchasingAccountsPayableDocument document)
PurapAccountingService
generateSummaryAccounts
in interface PurapAccountingService
document
- the document to generate the summary accounts from
PurapAccountingService.generateSummaryAccounts(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public List<SummaryAccount> generateSummaryAccountsWithNoZeroTotals(PurchasingAccountsPayableDocument document)
PurapAccountingService
generateSummaryAccountsWithNoZeroTotals
in interface PurapAccountingService
document
- the document to generate the summary accounts from
PurapAccountingService.generateSummaryAccountsWithNoZeroTotals(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public List<SummaryAccount> generateSummaryAccountsWithNoZeroTotalsNoUseTax(PurchasingAccountsPayableDocument document)
PurapAccountingService
generateSummaryAccountsWithNoZeroTotalsNoUseTax
in interface PurapAccountingService
document
- the document to generate the summary accounts from
PurapAccountingService.generateSummaryAccountsWithNoZeroTotals(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
protected List<SummaryAccount> generateSummaryAccounts(List<PurApItem> items, Boolean useZeroTotals, Boolean useTaxIncluded)
items
- a list of PurAp Items.
public List<SourceAccountingLine> generateSummaryWithNoZeroTotals(List<PurApItem> items)
PurapAccountingService
generateSummaryWithNoZeroTotals
in interface PurapAccountingService
items
- the items to generate source accounts from
PurapAccountingService.generateSummaryWithNoZeroTotals(java.util.List)
public List<SourceAccountingLine> generateSummaryWithNoZeroTotalsNoUseTax(List<PurApItem> items)
generateSummaryWithNoZeroTotalsNoUseTax
in interface PurapAccountingService
items
- the items to generate source accounts from
public List<SourceAccountingLine> generateSummaryWithNoZeroTotalsUsingAlternateAmount(List<PurApItem> items)
PurapAccountingService
generateSummaryWithNoZeroTotalsUsingAlternateAmount
in interface PurapAccountingService
items
- the items to generate source accounts from
PurapAccountingService.generateSummaryWithNoZeroTotalsUsingAlternateAmount(java.util.List)
public List<SourceAccountingLine> generateSummaryExcludeItemTypes(List<PurApItem> items, Set excludedItemTypeCodes)
PurapAccountingService
generateSummaryExcludeItemTypes
in interface PurapAccountingService
items
- the items to generate source accounts fromexcludedItemTypeCodes
- the item types to exclude
PurapAccountingService.generateSummaryExcludeItemTypes(java.util.List, java.util.Set)
public List<SourceAccountingLine> generateSummaryIncludeItemTypesAndNoZeroTotals(List<PurApItem> items, Set includedItemTypeCodes)
PurapAccountingService
generateSummaryIncludeItemTypesAndNoZeroTotals
in interface PurapAccountingService
items
- the items to generate source accounts from
PurapAccountingService.generateSummaryIncludeItemTypesAndNoZeroTotals(java.util.List,
java.util.Set)
public List<SourceAccountingLine> generateSummaryIncludeItemTypes(List<PurApItem> items, Set includedItemTypeCodes)
PurapAccountingService
generateSummaryIncludeItemTypes
in interface PurapAccountingService
items
- the items to generate source accounts from
PurapAccountingService.generateSummaryIncludeItemTypes(java.util.List, java.util.Set)
public List<SourceAccountingLine> generateSummaryExcludeItemTypesAndNoZeroTotals(List<PurApItem> items, Set excludedItemTypeCodes)
PurapAccountingService
generateSummaryExcludeItemTypesAndNoZeroTotals
in interface PurapAccountingService
items
- the items to generate source accounts fromexcludedItemTypeCodes
- the item types to exclude
PurapAccountingService.generateSummaryExcludeItemTypesAndNoZeroTotals(java.util.List,
java.util.Set)
protected List<SourceAccountingLine> generateAccountSummary(List<PurApItem> items, Set<String> itemTypeCodes, Boolean itemTypeCodesAreIncluded, Boolean useZeroTotals, Boolean useAlternateAmount, Boolean useTaxIncluded, Boolean taxableOnly)
items
- the items to determitemTypeCodes
- the item types to determine whether to look at an item in combination with itemTypeCodesAreIncludeditemTypeCodesAreIncluded
- value to tell whether the itemTypeCodes parameter lists inclusion or exclusion variablesuseZeroTotals
- whether to include items with a zero dollar totaluseAlternateAmount
- an alternate amount used in certain cases for GL entry
protected List<PurApItem> getProcessablePurapItems(List<PurApItem> items, Set itemTypeCodes, Boolean itemTypeCodesAreIncluded, Boolean useZeroTotals)
PurchasingApItem
objects and parses through them to see if each one should be processed
according the the other variables passed in.
items
- - list of PurchasingApItem
objects that need to be parseditemTypeCodes
- - list of ItemType
codes used in conjunction with
itemTypeCodesAreIncluded parameteritemTypeCodesAreIncluded
- - 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
)
PurchasingApItem
objects that should be used for processing by calling methodpublic void updateAccountAmounts(PurchasingAccountsPayableDocument document)
PurapAccountingService
updateAccountAmounts
in interface PurapAccountingService
document
- the documentPurapAccountingService.updateAccountAmounts(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public void updateItemAccountAmounts(PurApItem item)
PurapAccountingService
updateItemAccountAmounts
in interface PurapAccountingService
PurapAccountingService.updateItemAccountAmounts(org.kuali.kfs.module.purap.businessobject.PurApItem)
public <T extends PurApAccountingLine> void updateAccountAmountsWithTotal(List<T> sourceAccountingLines, org.kuali.rice.kns.util.KualiDecimal totalAmount)
updateAccountAmountsWithTotal
in interface PurapAccountingService
sourceAccountingLines
- totalAmount
- public List<PurApAccountingLine> generatePercentSummary(PurchasingAccountsPayableDocument purapDoc)
public void convertMoneyToPercent(PaymentRequestDocument pr)
PurapAccountingService
convertMoneyToPercent
in interface PurapAccountingService
pr
- The payment request document containing the accounts whose percentage would be set.PurapAccountingService.convertMoneyToPercent(org.kuali.kfs.module.purap.document.PaymentRequestDocument)
public void deleteSummaryAccounts(Integer purapDocumentIdentifier, String docType)
PurapAccountingService
deleteSummaryAccounts
in interface PurapAccountingService
purapDocumentIdentifier
- The purapDocumentIdentifier of the document whose summary accounts are to be deleted.PurapAccountingService.deleteSummaryAccounts(java.lang.Integer, java.lang.String)
public List getAccountsPayableSummaryAccounts(Integer purapDocumentIdentifier, String docType)
PurapAccountingService
getAccountsPayableSummaryAccounts
in interface PurapAccountingService
purapDocumentIdentifier
- The purapDocumentIdentifier of the document.public List<PurApAccountingLine> getAccountsFromItem(PurApItem item)
getAccountsFromItem
in interface PurapAccountingService
public List<SourceAccountingLine> generateSourceAccountsForVendorRemit(PurchasingAccountsPayableDocument document)
PurapAccountingService
generateSourceAccountsForVendorRemit
in interface PurapAccountingService
protected org.kuali.rice.kns.util.KualiDecimal calculateSumTotal(List<SourceAccountingLine> accounts)
accounts
-
protected void convertAmtToTax(List<PurApAccountingLine> accounts, org.kuali.rice.kns.util.KualiDecimal useTax, List<SourceAccountingLine> newSourceLines)
accounts
- list of accountsuseTax
- tax to be allocated to these accountsnewSourceLines
- rewrites the source account linespublic List<UseTaxContainer> generateUseTaxAccount(PurchasingAccountsPayableDocument document)
PurapAccountingService
generateUseTaxAccount
in interface PurapAccountingService
PurapAccountingService.generateUseTaxAccount(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public boolean isTaxAccount(PurchasingAccountsPayableDocument document, SourceAccountingLine account)
PurapAccountingService
isTaxAccount
in interface PurapAccountingService
document
- the specified PurAP documentaccount
- the specified accounting line
PurapAccountingService.isTaxAccount(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument, org.kuali.kfs.sys.businessobject.SourceAccountingLine)
public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
public void setPurApAccountingDao(PurApAccountingDao purApAccountingDao)
public void setPurapService(PurapService purapService)
public List<SourceAccountingLine> mergeAccountingLineLists(List<SourceAccountingLine> accountingLines1, List<SourceAccountingLine> accountingLines2)
PurapAccountingService
mergeAccountingLineLists
in interface PurapAccountingService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |