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 PurapServiceupdateStatus(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument, String)public List<String> getRelatedDocumentIds(Integer accountsPayablePurchasingDocumentLinkIdentifier)
getRelatedDocumentIds in interface PurapServicePurapService.getRelatedDocumentIds(Integer)@Transactional public List getRelatedViews(Class clazz, Integer accountsPayablePurchasingDocumentLinkIdentifier)
PurapServicegetRelatedViews in interface PurapServicePurapService.getRelatedViews(Class, Integer)public void addBelowLineItems(PurchasingAccountsPayableDocument document)
PurapServiceaddBelowLineItems in interface PurapServicedocument - 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)
PurapServicesortBelowTheLine in interface PurapServicedocument - PurchasingAccountsPayableDocument to be sortedorg.kuali.ole.module.purap.document.service.PurapService#sortBelowTheLine(String[], java.util.List, java.util.List)public String[] getBelowTheLineForDocument(PurchasingAccountsPayableDocument document)
PurapServicegetBelowTheLineForDocument in interface PurapServicedocument - PurchasingAccountsPayableDocumentPurapService.getBelowTheLineForDocument(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument)public PurApItem getBelowTheLineByType(PurchasingAccountsPayableDocument document, ItemType iT)
PurapServicegetBelowTheLineByType in interface PurapServicedocument - the documentiT - the itemTypePurapService.getBelowTheLineByType(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument,
org.kuali.ole.module.purap.businessobject.ItemType)public Date getDateFromOffsetFromToday(int offsetDays)
PurapServicegetDateFromOffsetFromToday in interface PurapServicePurapService.getDateFromOffsetFromToday(int)public boolean isDateInPast(Date compareDate)
PurapServiceisDateInPast in interface PurapServicecompareDate - An SQL date (not a DateFormatter date, or a util Date)PurapService.isDateInPast(java.sql.Date)public boolean isDateMoreThanANumberOfDaysAway(Date compareDate, int daysAway)
PurapServiceisDateMoreThanANumberOfDaysAway in interface PurapServicecompareDate - 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)
PurapServiceisDateAYearBeforeToday in interface PurapServicecompareDate - 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)
PurapServiceVendorService.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 PurapServicechart - chart code to use when looking up limit amount on VendorContract and
OrganizationParameterorg - organization code to use when looking up limit amount on VendorContract and
OrganizationParameterPurapService.getApoLimit(Integer, String, String)public boolean isFullDocumentEntryCompleted(PurchasingAccountsPayableDocument purapDocument)
PurapServiceisFullDocumentEntryCompleted in interface PurapServicepurapDocument - PurchasingAccountsPayableDocumentPurapService.isFullDocumentEntryCompleted(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument)public boolean isPaymentRequestFullDocumentEntryCompleted(String purapDocumentStatus)
PurapServiceisPaymentRequestFullDocumentEntryCompleted in interface PurapServicepurapDocumentStatus - StringPurapService.isPaymentRequestFullDocumentEntryCompleted(String)public boolean isVendorCreditMemoFullDocumentEntryCompleted(String purapDocumentStatus)
PurapServiceisVendorCreditMemoFullDocumentEntryCompleted in interface PurapServicepurapDocumentStatus - StringPurapService.isVendorCreditMemoFullDocumentEntryCompleted(String)public boolean isInvoiceFullDocumentEntryCompleted(String purapDocumentStatus)
PurapServiceisInvoiceFullDocumentEntryCompleted in interface PurapServicepurapDocumentStatus - StringPurapService.isInvoiceFullDocumentEntryCompleted(String)public void performLogicForCloseReopenPO(PurchasingAccountsPayableDocument purapDocument)
performLogicForCloseReopenPO in interface PurapServicepurapDocument - PurchasingAccountsPayableDocumentPurapService.performLogicForCloseReopenPO(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument)public void deleteUnenteredItems(PurapItemOperations document)
deleteUnenteredItems in interface PurapServiceapDocument - 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
PurapServiceperformLogicWithFakedUserSession in interface PurapServiceorg.kuali.rice.kew.api.exception.WorkflowExceptionExceptionPurapService.performLogicWithFakedUserSession(String, org.kuali.ole.module.purap.document.service.LogicContainer, Object[])public void saveDocumentNoValidation(org.kuali.rice.krad.document.Document document)
PurapServicesaveDocumentNoValidation in interface PurapServicedocument - 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)
PurapServiceisDocumentStoppedInRouteNode in interface PurapServicePurapService.isDocumentStoppedInRouteNode(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument, String)public boolean allowEncumberNextFiscalYear()
PurapServiceallowEncumberNextFiscalYear in interface PurapServicePurapService.allowEncumberNextFiscalYear()public List<Integer> getAllowedFiscalYears()
PurapServicegetAllowedFiscalYears in interface PurapServicePurapService.getAllowedFiscalYears()public boolean isTodayWithinApoAllowedRange()
PurapServiceisTodayWithinApoAllowedRange in interface PurapServicePurapService.isTodayWithinApoAllowedRange()public void clearTax(PurchasingAccountsPayableDocument purapDocument, boolean useTax)
PurapServiceclearTax in interface PurapServicepurapDocument - 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)
PurapServiceupdateUseTaxIndicator in interface PurapServicepurapDocument - documentnewUseTaxIndicatorValue - useTaxIndicator to change topublic void calculateTax(PurchasingAccountsPayableDocument purapDocument)
PurapServicecalculateTax in interface PurapServicePurapService.calculateTax(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument)public String getDeliveryState(PurchasingAccountsPayableDocument purapDocument)
PurapServicegetDeliveryState in interface PurapServiceprotected String getDeliveryPostalCode(PurchasingAccountsPayableDocument purapDocument)
public boolean isTaxable(boolean useTaxIndicator, String deliveryState, PurApItem item)
isTaxable in interface PurapServiceuseTaxIndicator - deliveryState - item - public boolean isTaxableForSummary(boolean useTaxIndicator, String deliveryState, PurApItem item)
PurapServiceisTaxableForSummary in interface PurapServicePurapService.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)
PurapServiceisDeliveryStateTaxable in interface PurapServicePurapService.isDeliveryStateTaxable(String)protected boolean doesAccountAllowCallToTaxService(String deliveryState, PurApItem item)
deliveryState - item - public boolean isAccountingLineTaxable(PurApAccountingLine acctLine, boolean deliveryStateTaxable)
PurapServiceisAccountingLineTaxable in interface PurapServicePurapService.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)
PurapServiceprorateForTradeInAndFullOrderDiscount in interface PurapServicepublic void clearAllTaxes(PurchasingAccountsPayableDocument purapDoc)
clearAllTaxes in interface PurapServicepublic boolean isItemTypeConflictWithTaxPolicy(PurchasingDocument purchasingDocument, PurApItem item)
isItemTypeConflictWithTaxPolicy in interface PurapServicepurchasingDocument - 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.