|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.module.purap.document.service.impl.PurapServiceImpl
public class PurapServiceImpl
Constructor Summary | |
---|---|
PurapServiceImpl()
|
Method Summary | |
---|---|
void |
addBelowLineItems(PurchasingAccountsPayableDocument document)
Add the allowed below the line items to the given document |
boolean |
allowEncumberNextFiscalYear()
Returns true if the current date falls within the allowed range to encumber in the next fiscal year. |
protected String |
assemblePurchaseOrderNote(AccountsPayableDocumentBase apDocument,
String docType,
String action)
Generate a note for the close/reopen po method. |
protected void |
calculateItemTax(boolean useTaxIndicator,
String deliveryPostalCode,
Date transactionTaxDate,
PurApItem item,
Class itemUseTaxClass,
PurchasingAccountsPayableDocument purapDocument)
|
void |
calculateTax(PurchasingAccountsPayableDocument purapDocument)
Calculates sales or use tax for each item if sales tax enabled and item is taxable. |
void |
clearAllTaxes(PurchasingAccountsPayableDocument purapDoc)
|
void |
clearTax(PurchasingAccountsPayableDocument purapDocument,
boolean useTax)
Clears the tax from a document. |
void |
deleteUnenteredItems(PurapItemOperations document)
Remove items that have not been "entered" which means no data has been added to them so no more processing needs to continue on these items. |
protected boolean |
doesAccountAllowCallToTaxService(String deliveryState,
PurApItem item)
Checks if the account is taxable, based on the delivery state, fund/subfund groups, and object code level/consolidations. |
protected boolean |
doesCommodityAllowCallToTaxService(PurApItem item)
Determines if the the tax service should be called due to the commodity code. |
List<Integer> |
getAllowedFiscalYears()
Returns a list of fiscal years that can be selected from on the document (built for Requisition and Purchase Order). |
org.kuali.rice.kns.util.KualiDecimal |
getApoLimit(Integer vendorContractGeneratedIdentifier,
String chart,
String org)
Retrieve the Automatic Purchase Order Limit amount based first on the derived contract limit (see VendorService.getApoLimitFromContract(Integer, String, String) ) and if that is null
then based on the OrganizationParameter associated with the given 'chart' and 'org' values. |
PurApItem |
getBelowTheLineByType(PurchasingAccountsPayableDocument document,
ItemType iT)
Retrieve the below the line item for a doc by item type (unknown result if multiple of same below the line item type) |
String[] |
getBelowTheLineForDocument(PurchasingAccountsPayableDocument document)
Retrieves the below the line items allowed from the parameter table for the given document |
Date |
getDateFromOffsetFromToday(int offsetDays)
Return a Date object which is which is a given number of days away from today, in either direction. |
protected String |
getDeliveryPostalCode(PurchasingAccountsPayableDocument purapDocument)
|
String |
getDeliveryState(PurchasingAccountsPayableDocument purapDocument)
Retrieves the delivery state from the document |
org.kuali.rice.kns.util.KualiDecimal |
getFullDiscountTaxablePrice(org.kuali.rice.kns.util.KualiDecimal extendedPrice,
PurchasingAccountsPayableDocument purapDocument)
|
PurapAccountingService |
getPurapAccountingService()
|
List<String> |
getRelatedDocumentIds(Integer accountsPayablePurchasingDocumentLinkIdentifier)
|
List |
getRelatedViews(Class clazz,
Integer accountsPayablePurchasingDocumentLinkIdentifier)
Retrieve list of views for given identifier |
boolean |
isAccountingLineTaxable(PurApAccountingLine acctLine,
boolean deliveryStateTaxable)
Determines if the accounting line is taxable based on account and object code. |
protected boolean |
isAccountTaxable(String parameterSuffix,
PurApAccountingLine acctLine)
Checks if the account fund/subfund groups are in a set of parameters taking into account allowed/denied constraints and ultimately determines if taxable. |
protected boolean |
isAllowedFound(org.kuali.rice.kns.service.ParameterEvaluator eval)
Helper method to work with parameter evaluator to find, allowed and found in parameter value. |
protected boolean |
isAllowedNotFound(org.kuali.rice.kns.service.ParameterEvaluator eval)
Helper method to work with parameter evaluator to find, allowed and not found in parameter value. |
protected boolean |
isCommodityCodeTaxable(CommodityCode commodityCode)
|
boolean |
isDateAYearBeforeToday(Date compareDate)
We are obliged not to simply use a dateDiff and compare the result to 365, because we have to worry about leap years. |
boolean |
isDateInPast(Date compareDate)
Determine whether a given date is in the past. |
boolean |
isDateMoreThanANumberOfDaysAway(Date compareDate,
int daysAway)
Determine whether a given date is more than a given number of days away from the current date. |
boolean |
isDeliveryStateTaxable(String deliveryState)
Determines if the delivery state is taxable or not. |
protected boolean |
isDeniedFound(org.kuali.rice.kns.service.ParameterEvaluator eval)
Helper method to work with parameter evaluator to find, denied and found in parameter value. |
protected boolean |
isDeniedNotFound(org.kuali.rice.kns.service.ParameterEvaluator eval)
Helper method to work with parameter evaluator to find, denied and not found in parameter value. |
boolean |
isDocumentStoppedInRouteNode(PurchasingAccountsPayableDocument document,
String nodeName)
Determines if a document is in a specified node. |
boolean |
isFullDocumentEntryCompleted(PurchasingAccountsPayableDocument purapDocument)
Determines if full entry mode has ended for this Purchasing/Accounts Payable document. |
boolean |
isItemTypeConflictWithTaxPolicy(PurchasingDocument purchasingDocument,
PurApItem item)
Determines if the item type specified conflict with the Account tax policy. |
protected boolean |
isObjectCodeTaxable(String parameterSuffix,
PurApAccountingLine acctLine)
Checks if the object code level/consolidation groups are in a set of parameters taking into account allowed/denied constraints and ultimately determines if taxable. |
boolean |
isTaxable(boolean useTaxIndicator,
String deliveryState,
PurApItem item)
Determines if the item is taxable based on a decision tree. |
boolean |
isTaxableForSummary(boolean useTaxIndicator,
String deliveryState,
PurApItem item)
Determines if the item is taxable based on a decision tree. |
protected boolean |
isTaxDisabledForVendor(PurchasingDocument purapDocument)
Determines if tax is disabled for vendor, in default always returns false |
boolean |
isTodayWithinApoAllowedRange()
Returns true if today is within the APO allowed date range. |
void |
performLogicForCloseReopenPO(PurchasingAccountsPayableDocument purapDocument)
Main hook point for close/Reopen PO. |
Object |
performLogicWithFakedUserSession(String requiredPersonPersonUserId,
LogicContainer logicToRun,
Object... objects)
Performs the given logic with the given fake user id. |
void |
processCloseReopenPo(AccountsPayableDocumentBase apDocument,
String docType)
Actual method that will close or reopen a po. |
void |
prorateForTradeInAndFullOrderDiscount(PurchasingAccountsPayableDocument purDoc)
Proation for Trade in and Full Order Discount miscellaneous items. |
void |
saveDocumentNoValidation(org.kuali.rice.kns.document.Document document)
Saves the document without doing validation by invoking the saveDocument method of documentService. |
void |
saveRoutingDataForRelatedDocuments(Integer accountsPayablePurchasingDocumentLinkIdentifier)
|
void |
setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService boService)
|
void |
setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
|
void |
setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
|
void |
setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
|
void |
setNoteService(org.kuali.rice.kns.service.NoteService noteService)
|
void |
setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
|
void |
setPersistenceService(org.kuali.rice.kns.service.PersistenceService persistenceService)
|
void |
setPurapAccountingService(PurapAccountingService purapAccountingService)
|
void |
setPurchaseOrderService(PurchaseOrderService purchaseOrderService)
|
void |
setTaxService(TaxService taxService)
|
void |
setUniversityDateService(UniversityDateService universityDateService)
|
void |
setVendorService(VendorService vendorService)
|
void |
sortBelowTheLine(PurchasingAccountsPayableDocument document)
Sort the below the line elements of the given document |
protected void |
sortBelowTheLine(String[] itemTypes,
List<PurApItem> existingItems,
List<PurApItem> belowTheLine)
Sorts the below the line elements |
boolean |
updateStatus(PurchasingAccountsPayableDocument document,
String newStatus)
Update the status for the given Purchasing/Accounts Payable document |
void |
updateUseTaxIndicator(PurchasingAccountsPayableDocument purapDocument,
boolean newUseTaxIndicatorValue)
Updates the use tax field, clearing old values if it has changed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PurapServiceImpl()
Method Detail |
---|
public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService boService)
public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
public void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
public void setVendorService(VendorService vendorService)
public void setPersistenceService(org.kuali.rice.kns.service.PersistenceService persistenceService)
public void setPurchaseOrderService(PurchaseOrderService purchaseOrderService)
public void setNoteService(org.kuali.rice.kns.service.NoteService noteService)
public void setUniversityDateService(UniversityDateService universityDateService)
public void setTaxService(TaxService taxService)
public boolean updateStatus(PurchasingAccountsPayableDocument document, String newStatus)
PurapService
updateStatus
in interface PurapService
PurapService.updateStatus(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument, java.lang.String)
public void saveRoutingDataForRelatedDocuments(Integer accountsPayablePurchasingDocumentLinkIdentifier)
saveRoutingDataForRelatedDocuments
in interface PurapService
public List<String> getRelatedDocumentIds(Integer accountsPayablePurchasingDocumentLinkIdentifier)
getRelatedDocumentIds
in interface PurapService
PurapService.getRelatedDocumentIds(java.lang.Integer)
public List getRelatedViews(Class clazz, Integer accountsPayablePurchasingDocumentLinkIdentifier)
PurapService
getRelatedViews
in interface PurapService
PurapService.getRelatedViews(java.lang.Class, java.lang.Integer)
public void addBelowLineItems(PurchasingAccountsPayableDocument document)
PurapService
addBelowLineItems
in interface PurapService
document
- PurchasingAccountsPayableDocumentPurapService.addBelowLineItems(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
protected void sortBelowTheLine(String[] itemTypes, List<PurApItem> existingItems, List<PurApItem> belowTheLine)
itemTypes
- existingItems
- belowTheLine
- public void sortBelowTheLine(PurchasingAccountsPayableDocument document)
PurapService
sortBelowTheLine
in interface PurapService
document
- PurchasingAccountsPayableDocument to be sortedorg.kuali.kfs.module.purap.document.service.PurapService#sortBelowTheLine(java.lang.String[], java.util.List, java.util.List)
public String[] getBelowTheLineForDocument(PurchasingAccountsPayableDocument document)
PurapService
getBelowTheLineForDocument
in interface PurapService
document
- PurchasingAccountsPayableDocument
PurapService.getBelowTheLineForDocument(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public PurApItem getBelowTheLineByType(PurchasingAccountsPayableDocument document, ItemType iT)
PurapService
getBelowTheLineByType
in interface PurapService
document
- the documentiT
- the itemType
PurapService.getBelowTheLineByType(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument,
org.kuali.kfs.module.purap.businessobject.ItemType)
public Date getDateFromOffsetFromToday(int offsetDays)
PurapService
getDateFromOffsetFromToday
in interface PurapService
PurapService.getDateFromOffsetFromToday(int)
public boolean isDateInPast(Date compareDate)
PurapService
isDateInPast
in interface PurapService
compareDate
- An SQL date (not a DateFormatter date, or a util Date)
PurapService.isDateInPast(java.sql.Date)
public boolean isDateMoreThanANumberOfDaysAway(Date compareDate, int daysAway)
PurapService
isDateMoreThanANumberOfDaysAway
in interface PurapService
compareDate
- An SQL date (not a DateFormatter date, or a util Date)daysAway
- An int, positive for future days, negative for past days
PurapService.isDateMoreThanANumberOfDaysAway(java.sql.Date, int)
public boolean isDateAYearBeforeToday(Date compareDate)
PurapService
isDateAYearBeforeToday
in interface PurapService
compareDate
- An SQL date (not a DateFormatter date, or a util Date)
org.kuali.kfs.module.purap.document.service.PurapService#isDateAYearAfterToday(java.sql.Date)
public org.kuali.rice.kns.util.KualiDecimal getApoLimit(Integer vendorContractGeneratedIdentifier, String chart, String org)
PurapService
VendorService.getApoLimitFromContract(Integer, String, String)
) and if that is null
then based on the OrganizationParameter
associated with the given 'chart' and 'org' values.
getApoLimit
in interface PurapService
chart
- chart code to use when looking up limit amount on VendorContract
and
OrganizationParameter
org
- organization code to use when looking up limit amount on VendorContract
and
OrganizationParameter
PurapService.getApoLimit(java.lang.Integer, java.lang.String, java.lang.String)
public boolean isFullDocumentEntryCompleted(PurchasingAccountsPayableDocument purapDocument)
PurapService
isFullDocumentEntryCompleted
in interface PurapService
purapDocument
- PurchasingAccountsPayableDocument
PurapService.isFullDocumentEntryCompleted(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public void performLogicForCloseReopenPO(PurchasingAccountsPayableDocument purapDocument)
performLogicForCloseReopenPO
in interface PurapService
purapDocument
- PurchasingAccountsPayableDocumentPurapService.performLogicForCloseReopenPO(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public void deleteUnenteredItems(PurapItemOperations document)
deleteUnenteredItems
in interface PurapService
apDocument
- AccountsPayableDocument which contains list of items to be reviewedpublic void processCloseReopenPo(AccountsPayableDocumentBase apDocument, String docType)
apDocument
- AccountsPayableDocumentdocType
- protected String assemblePurchaseOrderNote(AccountsPayableDocumentBase apDocument, String docType, String action)
docType
- preqId
-
public Object performLogicWithFakedUserSession(String requiredPersonPersonUserId, LogicContainer logicToRun, Object... objects) throws org.kuali.rice.kew.exception.WorkflowException, Exception
PurapService
performLogicWithFakedUserSession
in interface PurapService
org.kuali.rice.kew.exception.WorkflowException
Exception
PurapService.performLogicWithFakedUserSession(java.lang.String, org.kuali.kfs.module.purap.document.service.LogicContainer, java.lang.Object[])
public void saveDocumentNoValidation(org.kuali.rice.kns.document.Document document)
PurapService
saveDocumentNoValidation
in interface PurapService
document
- The purchase order document to be saved.org.kuali.kfs.module.purap.document.service.PurchaseOrderService#saveDocumentNoValidation(org.kuali.kfs.module.purap.document.PurchaseOrderDocument)
public boolean isDocumentStoppedInRouteNode(PurchasingAccountsPayableDocument document, String nodeName)
PurapService
isDocumentStoppedInRouteNode
in interface PurapService
public boolean allowEncumberNextFiscalYear()
PurapService
allowEncumberNextFiscalYear
in interface PurapService
PurapService.allowEncumberNextFiscalYear()
public List<Integer> getAllowedFiscalYears()
PurapService
getAllowedFiscalYears
in interface PurapService
PurapService.getAllowedFiscalYears()
public boolean isTodayWithinApoAllowedRange()
PurapService
isTodayWithinApoAllowedRange
in interface PurapService
PurapService.isTodayWithinApoAllowedRange()
public void clearTax(PurchasingAccountsPayableDocument purapDocument, boolean useTax)
PurapService
clearTax
in interface PurapService
purapDocument
- documentuseTax
- the whether to clear use or salesorg.kuali.kfs.module.purap.document.service.PurapService#clearTax(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public void updateUseTaxIndicator(PurchasingAccountsPayableDocument purapDocument, boolean newUseTaxIndicatorValue)
PurapService
updateUseTaxIndicator
in interface PurapService
purapDocument
- documentnewUseTaxIndicatorValue
- useTaxIndicator to change topublic void calculateTax(PurchasingAccountsPayableDocument purapDocument)
PurapService
calculateTax
in interface PurapService
PurapService.calculateTax(org.kuali.kfs.module.purap.document.PurchasingAccountsPayableDocument)
public String getDeliveryState(PurchasingAccountsPayableDocument purapDocument)
PurapService
getDeliveryState
in interface PurapService
protected String getDeliveryPostalCode(PurchasingAccountsPayableDocument purapDocument)
public boolean isTaxable(boolean useTaxIndicator, String deliveryState, PurApItem item)
isTaxable
in interface PurapService
useTaxIndicator
- deliveryState
- item
-
public boolean isTaxableForSummary(boolean useTaxIndicator, String deliveryState, PurApItem item)
PurapService
isTaxableForSummary
in interface PurapService
PurapService.isTaxableForSummary(boolean, java.lang.String, org.kuali.kfs.module.purap.businessobject.PurApItem)
protected boolean doesCommodityAllowCallToTaxService(PurApItem item)
item
-
protected boolean isCommodityCodeTaxable(CommodityCode commodityCode)
public boolean isDeliveryStateTaxable(String deliveryState)
PurapService
isDeliveryStateTaxable
in interface PurapService
PurapService.isDeliveryStateTaxable(java.lang.String)
protected boolean doesAccountAllowCallToTaxService(String deliveryState, PurApItem item)
deliveryState
- item
-
public boolean isAccountingLineTaxable(PurApAccountingLine acctLine, boolean deliveryStateTaxable)
PurapService
isAccountingLineTaxable
in interface PurapService
PurapService.isAccountingLineTaxable(org.kuali.kfs.module.purap.businessobject.PurApAccountingLine, boolean)
protected boolean isAccountTaxable(String parameterSuffix, PurApAccountingLine acctLine)
parameterSuffix
- acctLine
-
protected boolean isObjectCodeTaxable(String parameterSuffix, PurApAccountingLine acctLine)
parameterSuffix
- acctLine
-
protected boolean isAllowedFound(org.kuali.rice.kns.service.ParameterEvaluator eval)
eval
-
protected boolean isAllowedNotFound(org.kuali.rice.kns.service.ParameterEvaluator eval)
eval
-
protected boolean isDeniedFound(org.kuali.rice.kns.service.ParameterEvaluator eval)
eval
-
protected boolean isDeniedNotFound(org.kuali.rice.kns.service.ParameterEvaluator eval)
eval
-
protected void calculateItemTax(boolean useTaxIndicator, String deliveryPostalCode, Date transactionTaxDate, PurApItem item, Class itemUseTaxClass, PurchasingAccountsPayableDocument purapDocument)
useTaxIndicator
- deliveryPostalCode
- transactionTaxDate
- item
- itemUseTaxClass
- public org.kuali.rice.kns.util.KualiDecimal getFullDiscountTaxablePrice(org.kuali.rice.kns.util.KualiDecimal extendedPrice, PurchasingAccountsPayableDocument purapDocument)
public void prorateForTradeInAndFullOrderDiscount(PurchasingAccountsPayableDocument purDoc)
PurapService
prorateForTradeInAndFullOrderDiscount
in interface PurapService
public void clearAllTaxes(PurchasingAccountsPayableDocument purapDoc)
clearAllTaxes
in interface PurapService
public boolean isItemTypeConflictWithTaxPolicy(PurchasingDocument purchasingDocument, PurApItem item)
isItemTypeConflictWithTaxPolicy
in interface PurapService
purchasingDocument
- purchasing document to checkitem
- item to check if in conflict with tax policy
protected boolean isTaxDisabledForVendor(PurchasingDocument purapDocument)
purapDocument
- the PurchasingDocument with a vendor to check
public PurapAccountingService getPurapAccountingService()
public void setPurapAccountingService(PurapAccountingService purapAccountingService)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |