public class PurapServiceImpl extends Object implements PurapService
Constructor and Description |
---|
PurapServiceImpl() |
Modifier and Type | Method and Description |
---|---|
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.core.api.util.type.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.core.api.util.type.KualiDecimal |
getFullDiscountTaxablePrice(org.kuali.rice.core.api.util.type.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(ParameterEvaluator eval)
Helper method to work with parameter evaluator to find, allowed and found in parameter value.
|
protected boolean |
isAllowedNotFound(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(ParameterEvaluator eval)
Helper method to work with parameter evaluator to find, denied and found in parameter value.
|
protected boolean |
isDeniedNotFound(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 |
isInvoiceFullDocumentEntryCompleted(String purapDocumentStatus)
Determines if full entry mode has ended for this Invoice status
|
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 |
isPaymentRequestFullDocumentEntryCompleted(String purapDocumentStatus)
Determines if full entry mode has ended for this Payment Request status
|
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.
|
boolean |
isVendorCreditMemoFullDocumentEntryCompleted(String purapDocumentStatus)
Determines if full entry mode has ended for this Vendor Credit Memo status
|
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.krad.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.krad.service.BusinessObjectService boService) |
void |
setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService) |
void |
setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService) |
void |
setDocumentService(org.kuali.rice.krad.service.DocumentService documentService) |
void |
setNoteService(org.kuali.rice.krad.service.NoteService noteService) |
void |
setParameterService(org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService) |
void |
setPersistenceService(org.kuali.rice.krad.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
|
void |
updateUseTaxIndicator(PurchasingAccountsPayableDocument purapDocument,
boolean newUseTaxIndicatorValue)
Updates the use tax field, clearing old values if it has changed
|
public PurapServiceImpl()
public void setBusinessObjectService(org.kuali.rice.krad.service.BusinessObjectService boService)
public void setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
public void setParameterService(org.kuali.rice.coreservice.framework.parameter.ParameterService parameterService)
public void setDocumentService(org.kuali.rice.krad.service.DocumentService documentService)
public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
public void setVendorService(VendorService vendorService)
public void setPersistenceService(org.kuali.rice.krad.service.PersistenceService persistenceService)
public void setPurchaseOrderService(PurchaseOrderService purchaseOrderService)
public void setNoteService(org.kuali.rice.krad.service.NoteService noteService)
public void setUniversityDateService(UniversityDateService universityDateService)
public void setTaxService(TaxService taxService)
public void saveRoutingDataForRelatedDocuments(Integer accountsPayablePurchasingDocumentLinkIdentifier)
saveRoutingDataForRelatedDocuments
in interface PurapService
updateStatus(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument, String)
public List<String> getRelatedDocumentIds(Integer accountsPayablePurchasingDocumentLinkIdentifier)
getRelatedDocumentIds
in interface PurapService
PurapService.getRelatedDocumentIds(Integer)
@Transactional public List getRelatedViews(Class clazz, Integer accountsPayablePurchasingDocumentLinkIdentifier)
PurapService
getRelatedViews
in interface PurapService
PurapService.getRelatedViews(Class, Integer)
public void addBelowLineItems(PurchasingAccountsPayableDocument document)
PurapService
addBelowLineItems
in interface PurapService
document
- PurchasingAccountsPayableDocumentPurapService.addBelowLineItems(org.kuali.ole.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.ole.module.purap.document.service.PurapService#sortBelowTheLine(String[], java.util.List, java.util.List)
public String[] getBelowTheLineForDocument(PurchasingAccountsPayableDocument document)
PurapService
getBelowTheLineForDocument
in interface PurapService
document
- PurchasingAccountsPayableDocumentPurapService.getBelowTheLineForDocument(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument)
public PurApItem getBelowTheLineByType(PurchasingAccountsPayableDocument document, ItemType iT)
PurapService
getBelowTheLineByType
in interface PurapService
document
- the documentiT
- the itemTypePurapService.getBelowTheLineByType(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument,
org.kuali.ole.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 daysPurapService.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.ole.module.purap.document.service.PurapService#isDateAYearAfterToday(java.sql.Date)
public org.kuali.rice.core.api.util.type.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(Integer, String, String)
public boolean isFullDocumentEntryCompleted(PurchasingAccountsPayableDocument purapDocument)
PurapService
isFullDocumentEntryCompleted
in interface PurapService
purapDocument
- PurchasingAccountsPayableDocumentPurapService.isFullDocumentEntryCompleted(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument)
public boolean isPaymentRequestFullDocumentEntryCompleted(String purapDocumentStatus)
PurapService
isPaymentRequestFullDocumentEntryCompleted
in interface PurapService
purapDocumentStatus
- StringPurapService.isPaymentRequestFullDocumentEntryCompleted(String)
public boolean isVendorCreditMemoFullDocumentEntryCompleted(String purapDocumentStatus)
PurapService
isVendorCreditMemoFullDocumentEntryCompleted
in interface PurapService
purapDocumentStatus
- StringPurapService.isVendorCreditMemoFullDocumentEntryCompleted(String)
public boolean isInvoiceFullDocumentEntryCompleted(String purapDocumentStatus)
PurapService
isInvoiceFullDocumentEntryCompleted
in interface PurapService
purapDocumentStatus
- StringPurapService.isInvoiceFullDocumentEntryCompleted(String)
public void performLogicForCloseReopenPO(PurchasingAccountsPayableDocument purapDocument)
performLogicForCloseReopenPO
in interface PurapService
purapDocument
- PurchasingAccountsPayableDocumentPurapService.performLogicForCloseReopenPO(org.kuali.ole.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.api.exception.WorkflowException, Exception
PurapService
performLogicWithFakedUserSession
in interface PurapService
org.kuali.rice.kew.api.exception.WorkflowException
Exception
PurapService.performLogicWithFakedUserSession(String, org.kuali.ole.module.purap.document.service.LogicContainer, Object[])
public void saveDocumentNoValidation(org.kuali.rice.krad.document.Document document)
PurapService
saveDocumentNoValidation
in interface PurapService
document
- The purchase order document to be saved.org.kuali.ole.module.purap.document.service.PurchaseOrderService#saveDocumentNoValidation(org.kuali.ole.module.purap.document.PurchaseOrderDocument)
public boolean isDocumentStoppedInRouteNode(PurchasingAccountsPayableDocument document, String nodeName)
PurapService
isDocumentStoppedInRouteNode
in interface PurapService
PurapService.isDocumentStoppedInRouteNode(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument, String)
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.ole.module.purap.document.service.PurapService#clearTax(org.kuali.ole.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.ole.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, String, org.kuali.ole.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(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.ole.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(ParameterEvaluator eval)
eval
- protected boolean isAllowedNotFound(ParameterEvaluator eval)
eval
- protected boolean isDeniedFound(ParameterEvaluator eval)
eval
- protected boolean isDeniedNotFound(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.core.api.util.type.KualiDecimal getFullDiscountTaxablePrice(org.kuali.rice.core.api.util.type.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 policyprotected boolean isTaxDisabledForVendor(PurchasingDocument purapDocument)
purapDocument
- the PurchasingDocument with a vendor to checkpublic PurapAccountingService getPurapAccountingService()
public void setPurapAccountingService(PurapAccountingService purapAccountingService)
Copyright © 2004–2014 The Kuali Foundation. All rights reserved.