org.kuali.kfs.module.cab.service.impl
Class CapitalAssetBuilderModuleServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.cab.service.impl.CapitalAssetBuilderModuleServiceImpl
All Implemented Interfaces:
CapitalAssetBuilderModuleService

public class CapitalAssetBuilderModuleServiceImpl
extends Object
implements CapitalAssetBuilderModuleService


Nested Class Summary
protected static class CapitalAssetBuilderModuleServiceImpl.AccountCapitalObjectCode
           
 
Constructor Summary
CapitalAssetBuilderModuleServiceImpl()
           
 
Method Summary
protected  void activateCabGlLines(String documentNumber)
          Activates CAB GL Lines
protected  void activateCabPOLines(String documentNumber)
          Activates PO Lines
protected  String buildNoteTextForPurApDoc(String documentType, List<Long> assetNumbers)
          Build the appropriate note text being set to the purchase order document.
protected  boolean checkNewCapitalAssetFieldsExist(CapitalAssetInformation capitalAssetInformation, AccountingDocument accountingDocument)
          Check if all required fields exist on new asset
 boolean doesAccountingLineFailAutomaticPurchaseOrderRules(AccountingLine accountingLine)
          Perform the item level capital asset validation to determine if the given document is not allowed to become an Automatic Purchase Order (APO).
 boolean doesDocumentFailAutomaticPurchaseOrderRules(AccountingDocument accountingDocument)
          Perform the document level capital asset validation to determine if the given document is not allowed to become an Automatic Purchase Order (APO).
 boolean doesItemNeedCapitalAsset(String itemTypeCode, List accountingLines)
           
 List<CapitalAssetBuilderAssetTransactionType> getAllAssetTransactionTypes()
           
protected  List<Long> getAssetNumbersFromAssetGlobal(String documentNumber)
          Acquire asset numbers from CAMS asset payment document.
protected  List<Long> getAssetNumbersFromAssetPayment(String documentNumber)
          Acquire asset numbers from CAMS asset global document.
 AssetService getAssetService()
           
protected  AssetType getAssetType(String assetTypeCode)
          Retrieve the Asset type from the provided assetType Code
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
           
 CapitalAssetManagementModuleService getCapitalAssetManagementModuleService()
           
protected  CapitalAssetBuilderModuleServiceImpl.AccountCapitalObjectCode getCapitalAssetObjectSubTypeLinesFlag(AccountingDocument accountingDocument)
          Get the Capital Asset Object Code from the accounting lines.
 String getCurrentPurchaseOrderDocumentNumber(String camsDocumentNumber)
          Get current Purchase Order Document number for given CAMS Document Number
 org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
           
protected  String getDocumentTypeName(AccountingDocument accountingDocument)
          gets the document type based on the instance of a class
 org.kuali.rice.kns.service.KualiModuleService getKualiModuleService()
           
 org.kuali.rice.kns.service.ParameterService getParameterService()
           
protected  PurApInfoService getPurApInfoService()
           
protected  Integer getPurchaseOrderIdentifier(String camsDocumentNumber)
          Query PurchasingAccountsPayableItemAsset and return the purchaseOrderIdentifier if the given documentNumber is initiated from the PurAp line.
protected  String getValueFromAvailabilityMatrix(String fieldName, String systemType, String systemState)
           
 boolean hasCapitalAssetObjectSubType(AccountingDocument accountingDocument)
          determine whether there is any object code of the given source accounting lines with a capital asset object sub type
protected  boolean isAccountsPayableItemLineFullyProcessed(PurchasingAccountsPayableDocument purapDocument, String lockingInformation)
          If lockingInformation is not empty, check all item lines from the same PurAp item are fully processed.
 boolean isAssetTypeExisting(String assetTypeCode)
          Check assetTypeCode existence.
protected  boolean isCapitalAssetObjectCode(ObjectCode oc)
          Predicate to determine whether the given object code is of a specified object sub type required for purap cams.
protected  boolean isDocumentFullyProcessed(PurchasingAccountsPayableDocument purapDocument)
          Check if PurApDocument related items are fully processed.
protected  boolean isFpDocumentFullyProcessed(GeneralLedgerEntry generalLedgerEntry)
          Check all generalLedgerEntries from the same FP document are fully processed.
protected  boolean isGlEntryFullyProcessed(GeneralLedgerEntry glEntry)
          Check if Gl Entry related accounts are fully processed
protected  boolean isNewAssetBlank(CapitalAssetInformation capitalAssetInformation)
          To check if data exists on create new asset
protected  boolean isTagNumberDuplicate(List<CapitalAssetInformationDetail> capitalAssetInformationDetails, CapitalAssetInformationDetail dtl)
          To check if the tag number is duplicate or in use
protected  boolean isUpdateAssetBlank(CapitalAssetInformation capitalAssetInformation)
          To check if data exists on update asset
protected  List<String> mappedNameSplitter(String mappedName)
          Utility method to split a long String using the "." as the delimiter then add each of the array element into a List of String and return the List of String.
 void notifyRouteStatusChange(org.kuali.rice.kns.bo.DocumentHeader documentHeader)
          External modules can notify CAB if a document changed its route status.
protected  String objectCodeCapitalOrExpense(ObjectCode oc)
          Utility wrapping isCapitalAssetObjectCode for the use of processItemCapitalAssetValidation.
protected  void updateGlLinesStatusAsProcessed(String documentNumber)
          update cab non-PO lines status code for item/account/glEntry to 'P' as fully processed when possible
protected  void updatePOLinesStatusAsProcessed(String documentNumber)
          update CAB PO lines status code for item/account/glEntry to 'P' as fully processed when possible
protected  boolean validateAccountingLinesNotCapitalAndExpense(HashSet<String> capitalOrExpenseSet, String itemIdentifier, ObjectCode objectCode)
          Capital Asset validation: An item cannot have among its associated accounting lines both object codes that indicate it is a Capital Asset, and object codes that indicate that the item is not a Capital Asset.
 boolean validateAccountsPayableData(AccountingDocument accountingDocument)
           
protected  boolean validateAccountsPayableItem(AccountsPayableItem apItem)
           
 boolean validateAddItemCapitalAssetBusinessRules(ItemCapitalAsset asset)
           
 boolean validateAllFieldRequirementsByChart(AccountingDocument accountingDocument)
          Validates all the field requirements by chart.
protected  boolean validateAllFieldRequirementsByChart(String systemState, List<CapitalAssetSystem> capitalAssetSystems, List<PurchasingCapitalAssetItem> capitalAssetItems, String chartCode, String documentType, String systemType)
          Validates all the field requirements by chart.
 boolean validateAutomaticPurchaseOrderRule(AccountingDocument accountingDocument)
           
protected  boolean validateCapitalAssetLocationAddressFields(CapitalAssetLocation location, boolean ignoreRoom, StringBuffer errorKey)
          Not documented
protected  boolean validateCapitalAssetLocationAddressFieldsForIndividualSystemType(List<PurchasingCapitalAssetItem> capitalAssetItems)
          Not Documented
protected  boolean validateCapitalAssetLocationAddressFieldsOneOrMultipleSystemType(List<CapitalAssetSystem> capitalAssetSystems)
          Not documented
protected  boolean validateCapitalAssetTransactionTypeVersusRecurrence(CapitalAssetBuilderAssetTransactionType capitalAssetTransactionType, String recurringPaymentTypeCode, String itemIdentifier)
          Capital Asset validation: If the item has a transaction type, check that if the document specifies that recurring payments are to be made, that the transaction type is one that is appropriate for this situation, and that if the document does not specify that recurring payments are to be made, that the transaction type is one that is appropriate for that situation.
protected  boolean validateFieldRequirementByChartForIndividualSystemType(String systemState, List<PurchasingCapitalAssetItem> capitalAssetItems, String chartCode, String parameterName, String parameterValueString)
          Validates the field requirement by chart for individual system type.
protected  boolean validateFieldRequirementByChartForOneOrMultipleSystemType(String systemType, String systemState, List<CapitalAssetSystem> capitalAssetSystems, List<PurchasingCapitalAssetItem> capitalAssetItems, String chartCode, String parameterName, String parameterValueString)
          Validates field requirement by chart for one or multiple system types.
protected  boolean validateFieldRequirementByChartHelper(Object bean, Object[] mappedNames, StringBuffer errorKey, Integer itemNumber)
          Validates the field requirement by chart recursively and give error messages when it returns false.
 boolean validateFinancialProcessingData(AccountingDocument accountingDocument, CapitalAssetInformation capitalAssetInformation)
          validate the capitalAssetManagementAsset data associated with the given accounting document
protected  boolean validateIndividualCapitalAssetSystemFromPurchasing(String systemState, List<PurchasingCapitalAssetItem> capitalAssetItems, String chartCode, String documentType)
          Validates the capital asset field requirements based on system parameter and chart for individual system type.
protected  boolean validateIndividualSystemPurchasingTransactionTypesAllowingAssetNumbers(List<PurchasingCapitalAssetItem> capitalAssetItems)
          Validates for the individual system type that for each of the items, the capitalAssetTransactionTypeCode matches the system parameter PURCHASING_ASSET_TRANSACTION_TYPES_ALLOWING_ASSET_NUMBERS, the method will return true but if it doesn't match the system parameter, then loop through each of the itemCapitalAssets.
 boolean validateItemCapitalAssetWithErrors(String recurringPaymentTypeCode, ExternalPurApItem item, boolean apoCheck)
          Wrapper to do Capital Asset validations, generating errors instead of warnings.
protected  boolean validateLevelCapitalAssetIndication(BigDecimal unitPrice, ObjectCode objectCode, String itemIdentifier)
           
protected  boolean validateMultipleSystemsCapitalAssetSystemFromPurchasing(String systemState, List<CapitalAssetSystem> capitalAssetSystems, List<PurchasingCapitalAssetItem> capitalAssetItems, String chartCode, String documentType)
          Validates the capital asset field requirements based on system parameter and chart for multiple system type.
protected  boolean validateNewCapitalAssetFields(CapitalAssetInformation capitalAssetInformation)
          To validate new asset information
protected  boolean validateNonQuantityDrivenAllowedIndicatorAndTradeIn(List<PurchasingCapitalAssetItem> capitalAssetItems)
          TODO: rename this method removing trade in reference? Validates that if the non quantity drive allowed indicator on the capital asset transaction type is false and the item is of non quantity type
protected  boolean validateObjectCodeVersusTransactionType(ObjectCode objectCode, CapitalAssetBuilderAssetTransactionType capitalAssetTransactionType, String itemIdentifier, boolean quantityBasedItem)
          Capital Asset validation: If the item has a transaction type, check that the transaction type is acceptable for the object code sub-types of all the object codes on the associated accounting lines.
protected  boolean validateOneSystemCapitalAssetSystemFromPurchasing(String systemState, List<CapitalAssetSystem> capitalAssetSystems, List<PurchasingCapitalAssetItem> capitalAssetItems, String chartCode, String documentType)
          Validates the capital asset field requirements based on system parameter and chart for one system type.
protected  boolean validatePurapItemCapitalAsset(PurApItem item, AssetTransactionType capitalAssetTransactionType)
          This method validated purapItem giving a transtype
 boolean validatePurchasingData(AccountingDocument accountingDocument)
           
protected  boolean validatePurchasingItemCapitalAsset(String recurringPaymentTypeCode, PurchasingItem item)
          Makes sure that the given item's data relevant to its later possible classification as a Capital Asset is internally consistent, by marshaling and calling the methods marked as Capital Asset validations.
 boolean validatePurchasingObjectSubType(AccountingDocument accountingDocument)
          Validates for PURCHASING_OBJECT_SUB_TYPES parameter.
protected  boolean validatePurchasingTransactionTypesAllowingAssetNumbers(CapitalAssetSystem capitalAssetSystem, String capitalAssetTransactionType, String prefix)
          Generic validation that if the capitalAssetTransactionTypeCode does not match the system parameter PURCHASING_ASSET_TRANSACTION_TYPES_ALLOWING_ASSET_NUMBERS and at least one of the itemCapitalAssets contain a non-null capitalAssetNumber then return false.
protected  boolean validateQuantityOnLocationsEqualsQuantityOnItem(List<PurchasingCapitalAssetItem> capitalAssetItems, String systemType, String systemState)
          Validates that the total quantity on all locations equals to the quantity on the line item.
protected  boolean validateTotalNumberOfAssetTagLines(CapitalAssetInformation capitalAssetInformation)
          Validate asset quantity the user entered matching the number of asset tag lines.
 boolean validateUpdateCAMSView(AccountingDocument accountingDocument)
           
protected  boolean validateUpdateCapitalAssetField(CapitalAssetInformation capitalAssetInformation, AccountingDocument accountingDocument)
          To validate if the asset is active
 boolean warningObjectLevelCapital(AccountingDocument accountingDocument)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapitalAssetBuilderModuleServiceImpl

public CapitalAssetBuilderModuleServiceImpl()
Method Detail

getAllAssetTransactionTypes

public List<CapitalAssetBuilderAssetTransactionType> getAllAssetTransactionTypes()
Specified by:
getAllAssetTransactionTypes in interface CapitalAssetBuilderModuleService
See Also:
CapitalAssetBuilderModuleService.getAllAssetTransactionTypes()

validatePurchasingData

public boolean validatePurchasingData(AccountingDocument accountingDocument)
Specified by:
validatePurchasingData in interface CapitalAssetBuilderModuleService
See Also:
org.kuali.kfs.integration.cab.CapitalAssetBuilderModuleService#validatePurchasingAccountsPayableData(org.kuali.kfs.sys.document.AccountingDocument)

validateAccountsPayableData

public boolean validateAccountsPayableData(AccountingDocument accountingDocument)
Specified by:
validateAccountsPayableData in interface CapitalAssetBuilderModuleService

doesAccountingLineFailAutomaticPurchaseOrderRules

public boolean doesAccountingLineFailAutomaticPurchaseOrderRules(AccountingLine accountingLine)
Perform the item level capital asset validation to determine if the given document is not allowed to become an Automatic Purchase Order (APO). The APO is not allowed if any accounting strings on the document are using an object level indicated as capital via a parameter setting.

Specified by:
doesAccountingLineFailAutomaticPurchaseOrderRules in interface CapitalAssetBuilderModuleService

doesDocumentFailAutomaticPurchaseOrderRules

public boolean doesDocumentFailAutomaticPurchaseOrderRules(AccountingDocument accountingDocument)
Perform the document level capital asset validation to determine if the given document is not allowed to become an Automatic Purchase Order (APO). The APO is not allowed if any capital asset items exist on the document.

Specified by:
doesDocumentFailAutomaticPurchaseOrderRules in interface CapitalAssetBuilderModuleService

validateAutomaticPurchaseOrderRule

public boolean validateAutomaticPurchaseOrderRule(AccountingDocument accountingDocument)

doesItemNeedCapitalAsset

public boolean doesItemNeedCapitalAsset(String itemTypeCode,
                                        List accountingLines)
Specified by:
doesItemNeedCapitalAsset in interface CapitalAssetBuilderModuleService
See Also:
CapitalAssetBuilderModuleService.doesItemNeedCapitalAsset(java.lang.String, java.util.List)

validateUpdateCAMSView

public boolean validateUpdateCAMSView(AccountingDocument accountingDocument)
Specified by:
validateUpdateCAMSView in interface CapitalAssetBuilderModuleService
See Also:
CapitalAssetBuilderModuleService.validateUpdateCAMSView(org.kuali.kfs.sys.document.AccountingDocument)

validateAddItemCapitalAssetBusinessRules

public boolean validateAddItemCapitalAssetBusinessRules(ItemCapitalAsset asset)
Specified by:
validateAddItemCapitalAssetBusinessRules in interface CapitalAssetBuilderModuleService
See Also:
CapitalAssetBuilderModuleService.validateAddItemCapitalAssetBusinessRules(org.kuali.kfs.integration.purap.ItemCapitalAsset)

warningObjectLevelCapital

public boolean warningObjectLevelCapital(AccountingDocument accountingDocument)
Specified by:
warningObjectLevelCapital in interface CapitalAssetBuilderModuleService
See Also:
CapitalAssetBuilderModuleService.warningObjectLevelCapital(org.kuali.kfs.sys.document.AccountingDocument)

validateIndividualCapitalAssetSystemFromPurchasing

protected boolean validateIndividualCapitalAssetSystemFromPurchasing(String systemState,
                                                                     List<PurchasingCapitalAssetItem> capitalAssetItems,
                                                                     String chartCode,
                                                                     String documentType)
Validates the capital asset field requirements based on system parameter and chart for individual system type. This also calls validations for quantity on locations equal quantity on line items, validates that the transaction type allows asset number and validates the non quantity driven allowed indicator.

Parameters:
systemState -
capitalAssetItems -
chartCode -
documentType -
Returns:

validateOneSystemCapitalAssetSystemFromPurchasing

protected boolean validateOneSystemCapitalAssetSystemFromPurchasing(String systemState,
                                                                    List<CapitalAssetSystem> capitalAssetSystems,
                                                                    List<PurchasingCapitalAssetItem> capitalAssetItems,
                                                                    String chartCode,
                                                                    String documentType)
Validates the capital asset field requirements based on system parameter and chart for one system type. This also calls validations that the transaction type allows asset number and validates the non quantity driven allowed indicator.

Parameters:
systemState -
capitalAssetSystems -
capitalAssetItems -
chartCode -
documentType -
Returns:

validateMultipleSystemsCapitalAssetSystemFromPurchasing

protected boolean validateMultipleSystemsCapitalAssetSystemFromPurchasing(String systemState,
                                                                          List<CapitalAssetSystem> capitalAssetSystems,
                                                                          List<PurchasingCapitalAssetItem> capitalAssetItems,
                                                                          String chartCode,
                                                                          String documentType)
Validates the capital asset field requirements based on system parameter and chart for multiple system type. This also calls validations that the transaction type allows asset number and validates the non quantity driven allowed indicator.

Parameters:
systemState -
capitalAssetSystems -
capitalAssetItems -
chartCode -
documentType -
Returns:

validateAllFieldRequirementsByChart

protected boolean validateAllFieldRequirementsByChart(String systemState,
                                                      List<CapitalAssetSystem> capitalAssetSystems,
                                                      List<PurchasingCapitalAssetItem> capitalAssetItems,
                                                      String chartCode,
                                                      String documentType,
                                                      String systemType)
Validates all the field requirements by chart. It obtains a List of parameters where the parameter names are like "CHARTS_REQUIRING%" then loop through these parameters. If the system type is individual then invoke the validateFieldRequirementByChartForIndividualSystemType for further validation, otherwise invoke the validateFieldRequirementByChartForOneOrMultipleSystemType for further validation.

Parameters:
systemState -
capitalAssetSystems -
capitalAssetItems -
chartCode -
documentType -
systemType -
Returns:

validateAllFieldRequirementsByChart

public boolean validateAllFieldRequirementsByChart(AccountingDocument accountingDocument)
Validates all the field requirements by chart. It obtains a List of parameters where the parameter names are like "CHARTS_REQUIRING%" then loop through these parameters. If any of the parameter's values is null, then return false

Specified by:
validateAllFieldRequirementsByChart in interface CapitalAssetBuilderModuleService
Parameters:
accountingDocument -
Returns:

validatePurchasingObjectSubType

public boolean validatePurchasingObjectSubType(AccountingDocument accountingDocument)
Validates for PURCHASING_OBJECT_SUB_TYPES parameter. If at least one object code of any accounting line entered is of this type, then return false.

Specified by:
validatePurchasingObjectSubType in interface CapitalAssetBuilderModuleService
Parameters:
accountingDocument -
Returns:

validateFieldRequirementByChartForOneOrMultipleSystemType

protected boolean validateFieldRequirementByChartForOneOrMultipleSystemType(String systemType,
                                                                            String systemState,
                                                                            List<CapitalAssetSystem> capitalAssetSystems,
                                                                            List<PurchasingCapitalAssetItem> capitalAssetItems,
                                                                            String chartCode,
                                                                            String parameterName,
                                                                            String parameterValueString)
Validates field requirement by chart for one or multiple system types.

Parameters:
systemType -
systemState -
capitalAssetSystems -
capitalAssetItems -
chartCode -
parameterName -
parameterValueString -
Returns:

validateFieldRequirementByChartForIndividualSystemType

protected boolean validateFieldRequirementByChartForIndividualSystemType(String systemState,
                                                                         List<PurchasingCapitalAssetItem> capitalAssetItems,
                                                                         String chartCode,
                                                                         String parameterName,
                                                                         String parameterValueString)
Validates the field requirement by chart for individual system type.

Parameters:
systemState -
capitalAssetItems -
chartCode -
parameterName -
parameterValueString -
Returns:

mappedNameSplitter

protected List<String> mappedNameSplitter(String mappedName)
Utility method to split a long String using the "." as the delimiter then add each of the array element into a List of String and return the List of String.

Parameters:
mappedName - The String to be splitted.
Returns:
The List of String after being splitted, with the "." as delimiter.

validateFieldRequirementByChartHelper

protected boolean validateFieldRequirementByChartHelper(Object bean,
                                                        Object[] mappedNames,
                                                        StringBuffer errorKey,
                                                        Integer itemNumber)
Validates the field requirement by chart recursively and give error messages when it returns false.

Parameters:
bean - The object to be used to obtain the property value
mappedNames - The array of Strings which when combined together, they form the field property
errorKey - The error key to be used for adding error messages to the error map.
itemNumber - The Integer that represents the item number that we're currently iterating.
Returns:
true if it passes the validation.

getValueFromAvailabilityMatrix

protected String getValueFromAvailabilityMatrix(String fieldName,
                                                String systemType,
                                                String systemState)

validateQuantityOnLocationsEqualsQuantityOnItem

protected boolean validateQuantityOnLocationsEqualsQuantityOnItem(List<PurchasingCapitalAssetItem> capitalAssetItems,
                                                                  String systemType,
                                                                  String systemState)
Validates that the total quantity on all locations equals to the quantity on the line item. This is only used for IND system type.

Parameters:
capitalAssetItems -
Returns:
true if the total quantity on all locations equals to the quantity on the line item.

validateIndividualSystemPurchasingTransactionTypesAllowingAssetNumbers

protected boolean validateIndividualSystemPurchasingTransactionTypesAllowingAssetNumbers(List<PurchasingCapitalAssetItem> capitalAssetItems)
Validates for the individual system type that for each of the items, the capitalAssetTransactionTypeCode matches the system parameter PURCHASING_ASSET_TRANSACTION_TYPES_ALLOWING_ASSET_NUMBERS, the method will return true but if it doesn't match the system parameter, then loop through each of the itemCapitalAssets. If there is any non-null capitalAssetNumber then return false.

Parameters:
capitalAssetItems - the List of PurchasingCapitalAssetItems on the document to be validated
Returns:
false if the capital asset transaction type does not match the system parameter that allows asset numbers but the itemCapitalAsset contains at least one asset numbers.

validatePurchasingTransactionTypesAllowingAssetNumbers

protected boolean validatePurchasingTransactionTypesAllowingAssetNumbers(CapitalAssetSystem capitalAssetSystem,
                                                                         String capitalAssetTransactionType,
                                                                         String prefix)
Generic validation that if the capitalAssetTransactionTypeCode does not match the system parameter PURCHASING_ASSET_TRANSACTION_TYPES_ALLOWING_ASSET_NUMBERS and at least one of the itemCapitalAssets contain a non-null capitalAssetNumber then return false. This method is used by one system and multiple system types as well as being used as a helper method for validateIndividualSystemPurchasingTransactionTypesAllowingAssetNumbers method.

Parameters:
capitalAssetSystem - the capitalAssetSystem containing a List of itemCapitalAssets to be validated.
capitalAssetTransactionType - the capitalAssetTransactionTypeCode containing asset numbers to be validated.
Returns:
false if the capital asset transaction type does not match the system parameter that allows asset numbers but the itemCapitalAsset contains at least one asset numbers.

validateNonQuantityDrivenAllowedIndicatorAndTradeIn

protected boolean validateNonQuantityDrivenAllowedIndicatorAndTradeIn(List<PurchasingCapitalAssetItem> capitalAssetItems)
TODO: rename this method removing trade in reference? Validates that if the non quantity drive allowed indicator on the capital asset transaction type is false and the item is of non quantity type

Parameters:
capitalAssetItems - The List of PurchasingCapitalAssetItem to be validated.
Returns:
false if the indicator is false and there is at least one non quantity items on the list.

validateItemCapitalAssetWithErrors

public boolean validateItemCapitalAssetWithErrors(String recurringPaymentTypeCode,
                                                  ExternalPurApItem item,
                                                  boolean apoCheck)
Wrapper to do Capital Asset validations, generating errors instead of warnings. Makes sure that the given item's data relevant to its later possible classification as a Capital Asset is internally consistent, by marshaling and calling the methods marked as Capital Asset validations. This implementation assumes that all object codes are valid (real) object codes.

Specified by:
validateItemCapitalAssetWithErrors in interface CapitalAssetBuilderModuleService
Parameters:
recurringPaymentType - The item's document's RecurringPaymentType
item - A PurchasingItemBase object
apoCheck - True if this check is for APO purposes
Returns:
True if the item passes all Capital Asset validations

validatePurchasingItemCapitalAsset

protected boolean validatePurchasingItemCapitalAsset(String recurringPaymentTypeCode,
                                                     PurchasingItem item)
Makes sure that the given item's data relevant to its later possible classification as a Capital Asset is internally consistent, by marshaling and calling the methods marked as Capital Asset validations. This implementation assumes that all object codes are valid (real) object codes.

Parameters:
recurringPaymentType - The item's document's RecurringPaymentType
item - A PurchasingItemBase object
warn - A boolean which should be set to true if warnings are to be set on the calling document for most of the validations, rather than errors.
Returns:
True if the item passes all Capital Asset validations

validatePurapItemCapitalAsset

protected boolean validatePurapItemCapitalAsset(PurApItem item,
                                                AssetTransactionType capitalAssetTransactionType)
This method validated purapItem giving a transtype

Parameters:
recurringPaymentType -
item -
warn -
Returns:

validateAccountingLinesNotCapitalAndExpense

protected boolean validateAccountingLinesNotCapitalAndExpense(HashSet<String> capitalOrExpenseSet,
                                                              String itemIdentifier,
                                                              ObjectCode objectCode)
Capital Asset validation: An item cannot have among its associated accounting lines both object codes that indicate it is a Capital Asset, and object codes that indicate that the item is not a Capital Asset. Whether an object code indicates that the item is a Capital Asset is determined by whether its level is among a specific set of levels that are deemed acceptable for such items.

Parameters:
capitalOrExpenseSet - A HashSet containing the distinct values of either "Capital" or "Expense" that have been added to it.
warn - A boolean which should be set to true if warnings are to be set on the calling document
itemIdentifier - A String identifying the item for error display
objectCode - An ObjectCode, for error display
Returns:
True if the given HashSet contains at most one of either "Capital" or "Expense"

validateLevelCapitalAssetIndication

protected boolean validateLevelCapitalAssetIndication(BigDecimal unitPrice,
                                                      ObjectCode objectCode,
                                                      String itemIdentifier)

validateObjectCodeVersusTransactionType

protected boolean validateObjectCodeVersusTransactionType(ObjectCode objectCode,
                                                          CapitalAssetBuilderAssetTransactionType capitalAssetTransactionType,
                                                          String itemIdentifier,
                                                          boolean quantityBasedItem)
Capital Asset validation: If the item has a transaction type, check that the transaction type is acceptable for the object code sub-types of all the object codes on the associated accounting lines.

Parameters:
objectCode -
capitalAssetTransactionType -
warn - A boolean which should be set to true if warnings are to be set on the calling document
itemIdentifier -
Returns:

validateCapitalAssetTransactionTypeVersusRecurrence

protected boolean validateCapitalAssetTransactionTypeVersusRecurrence(CapitalAssetBuilderAssetTransactionType capitalAssetTransactionType,
                                                                      String recurringPaymentTypeCode,
                                                                      String itemIdentifier)
Capital Asset validation: If the item has a transaction type, check that if the document specifies that recurring payments are to be made, that the transaction type is one that is appropriate for this situation, and that if the document does not specify that recurring payments are to be made, that the transaction type is one that is appropriate for that situation.

Parameters:
capitalAssetTransactionType -
recurringPaymentType -
warn - A boolean which should be set to true if warnings are to be set on the calling document
itemIdentifier -
Returns:

objectCodeCapitalOrExpense

protected String objectCodeCapitalOrExpense(ObjectCode oc)
Utility wrapping isCapitalAssetObjectCode for the use of processItemCapitalAssetValidation.

Parameters:
oc - An ObjectCode
Returns:
A String indicating that the given object code is either Capital or Expense

isCapitalAssetObjectCode

protected boolean isCapitalAssetObjectCode(ObjectCode oc)
Predicate to determine whether the given object code is of a specified object sub type required for purap cams.

Parameters:
oc - An ObjectCode
Returns:
True if the ObjectSubType is the one designated for capital assets.

validateCapitalAssetLocationAddressFieldsOneOrMultipleSystemType

protected boolean validateCapitalAssetLocationAddressFieldsOneOrMultipleSystemType(List<CapitalAssetSystem> capitalAssetSystems)
Not documented

Parameters:
capitalAssetSystems -
Returns:

validateCapitalAssetLocationAddressFieldsForIndividualSystemType

protected boolean validateCapitalAssetLocationAddressFieldsForIndividualSystemType(List<PurchasingCapitalAssetItem> capitalAssetItems)
Not Documented

Parameters:
capitalAssetItems -
Returns:

validateCapitalAssetLocationAddressFields

protected boolean validateCapitalAssetLocationAddressFields(CapitalAssetLocation location,
                                                            boolean ignoreRoom,
                                                            StringBuffer errorKey)
Not documented

Parameters:
location -
ignoreRoom - Is used to identify if room number should be validated. If true then room is ignored in this validation.
errorKey -
Returns:

validateAccountsPayableItem

protected boolean validateAccountsPayableItem(AccountsPayableItem apItem)

validateFinancialProcessingData

public boolean validateFinancialProcessingData(AccountingDocument accountingDocument,
                                               CapitalAssetInformation capitalAssetInformation)
Description copied from interface: CapitalAssetBuilderModuleService
validate the capitalAssetManagementAsset data associated with the given accounting document

Specified by:
validateFinancialProcessingData in interface CapitalAssetBuilderModuleService
Parameters:
accountingDocument - and capitalAssetInformation
Returns:
True if the FinancialProcessingData is valid.
See Also:
CapitalAssetBuilderModuleService.validateFinancialProcessingData(org.kuali.kfs.sys.document.AccountingDocument, org.kuali.kfs.fp.businessobject.CapitalAssetInformation)

getCapitalAssetObjectSubTypeLinesFlag

protected CapitalAssetBuilderModuleServiceImpl.AccountCapitalObjectCode getCapitalAssetObjectSubTypeLinesFlag(AccountingDocument accountingDocument)
Get the Capital Asset Object Code from the accounting lines.

Parameters:
accountingDocument -
Returns:
getCapitalAssetObjectSubTypeLinesFlag = AccountCapitalObjectCode.NON_CAPITAL ==> no assetObjectSubType code AccountCapitalObjectCode.FROM_CAPITAL ==> assetObjectSubType code on source lines AccountCapitalObjectCode.FROM_CAPITAL ==> assetObjectSubType code on target lines AccountCapitalObjectCode.BOTH_CAPITAL ==> assetObjectSubType code on both source and target lines

hasCapitalAssetObjectSubType

public boolean hasCapitalAssetObjectSubType(AccountingDocument accountingDocument)
Description copied from interface: CapitalAssetBuilderModuleService
determine whether there is any object code of the given source accounting lines with a capital asset object sub type

Specified by:
hasCapitalAssetObjectSubType in interface CapitalAssetBuilderModuleService
Returns:
true if there is at least one object code of the given source accounting lines with a capital asset object sub type; otherwise, false
See Also:
CapitalAssetBuilderModuleService.hasCapitalAssetObjectSubType(org.kuali.kfs.sys.document.AccountingDocument)

isNewAssetBlank

protected boolean isNewAssetBlank(CapitalAssetInformation capitalAssetInformation)
To check if data exists on create new asset

Parameters:
capitalAssetInformation -
Returns:
boolean false if the new asset is not blank

isUpdateAssetBlank

protected boolean isUpdateAssetBlank(CapitalAssetInformation capitalAssetInformation)
To check if data exists on update asset

Parameters:
capitalAssetInformation -
Returns:
boolean false if the update asset is not blank

validateUpdateCapitalAssetField

protected boolean validateUpdateCapitalAssetField(CapitalAssetInformation capitalAssetInformation,
                                                  AccountingDocument accountingDocument)
To validate if the asset is active

Parameters:
capitalAssetManagementAsset - the asset to be validated
Returns:
boolean false if the asset is not active

checkNewCapitalAssetFieldsExist

protected boolean checkNewCapitalAssetFieldsExist(CapitalAssetInformation capitalAssetInformation,
                                                  AccountingDocument accountingDocument)
Check if all required fields exist on new asset

Parameters:
capitalAssetInformation - the fields of add asset to be checked
Returns:
boolean false if a required field is missing

validateNewCapitalAssetFields

protected boolean validateNewCapitalAssetFields(CapitalAssetInformation capitalAssetInformation)
To validate new asset information

Parameters:
capitalAssetInformation - the information of add asset to be validated
Returns:
boolean false if data is incorrect

isAssetTypeExisting

public boolean isAssetTypeExisting(String assetTypeCode)
Check assetTypeCode existence.

Specified by:
isAssetTypeExisting in interface CapitalAssetBuilderModuleService
Parameters:
assetTypeCode -
Returns:

getAssetType

protected AssetType getAssetType(String assetTypeCode)
Retrieve the Asset type from the provided assetType Code

Parameters:
assetTypeCode -
Returns:
AssetType

validateTotalNumberOfAssetTagLines

protected boolean validateTotalNumberOfAssetTagLines(CapitalAssetInformation capitalAssetInformation)
Validate asset quantity the user entered matching the number of asset tag lines.

Parameters:
capitalAssetInformation -
Returns:

isTagNumberDuplicate

protected boolean isTagNumberDuplicate(List<CapitalAssetInformationDetail> capitalAssetInformationDetails,
                                       CapitalAssetInformationDetail dtl)
To check if the tag number is duplicate or in use

Parameters:
capitalAssetInformation, - capitalAssetInformationDetail
Returns:
boolean false if data is duplicate or in use

notifyRouteStatusChange

public void notifyRouteStatusChange(org.kuali.rice.kns.bo.DocumentHeader documentHeader)
Description copied from interface: CapitalAssetBuilderModuleService
External modules can notify CAB if a document changed its route status. CAB Uses this notification to release records or to update other modules about the changes

Specified by:
notifyRouteStatusChange in interface CapitalAssetBuilderModuleService
Parameters:
documentHeader - DocumentHeader
See Also:
org.kuali.kfs.integration.cab.CapitalAssetBuilderModuleService#notifyRouteStatusChange(java.lang.String, java.lang.String)

updateGlLinesStatusAsProcessed

protected void updateGlLinesStatusAsProcessed(String documentNumber)
update cab non-PO lines status code for item/account/glEntry to 'P' as fully processed when possible

Parameters:
documentNumber -

isFpDocumentFullyProcessed

protected boolean isFpDocumentFullyProcessed(GeneralLedgerEntry generalLedgerEntry)
Check all generalLedgerEntries from the same FP document are fully processed.

Parameters:
generalLedgerEntry -
Returns:

updatePOLinesStatusAsProcessed

protected void updatePOLinesStatusAsProcessed(String documentNumber)
update CAB PO lines status code for item/account/glEntry to 'P' as fully processed when possible

Parameters:
documentNumber -

isAccountsPayableItemLineFullyProcessed

protected boolean isAccountsPayableItemLineFullyProcessed(PurchasingAccountsPayableDocument purapDocument,
                                                          String lockingInformation)
If lockingInformation is not empty, check all item lines from the same PurAp item are fully processed. If lockingInformation is empty, we check all items from the same PREQ/CM document processed as fully processed.

Parameters:
itemAsset -
Returns:

isGlEntryFullyProcessed

protected boolean isGlEntryFullyProcessed(GeneralLedgerEntry glEntry)
Check if Gl Entry related accounts are fully processed

Parameters:
glEntry -
Returns:

isDocumentFullyProcessed

protected boolean isDocumentFullyProcessed(PurchasingAccountsPayableDocument purapDocument)
Check if PurApDocument related items are fully processed.

Parameters:
purapDocument -
Returns:

buildNoteTextForPurApDoc

protected String buildNoteTextForPurApDoc(String documentType,
                                          List<Long> assetNumbers)
Build the appropriate note text being set to the purchase order document.

Parameters:
documentType -
assetNumbers -
Returns:

getAssetNumbersFromAssetGlobal

protected List<Long> getAssetNumbersFromAssetGlobal(String documentNumber)
Acquire asset numbers from CAMS asset payment document.

Parameters:
documentNumber -
assetNumbers -

getAssetNumbersFromAssetPayment

protected List<Long> getAssetNumbersFromAssetPayment(String documentNumber)
Acquire asset numbers from CAMS asset global document.

Parameters:
documentNumber -
assetNumbers -

getPurchaseOrderIdentifier

protected Integer getPurchaseOrderIdentifier(String camsDocumentNumber)
Query PurchasingAccountsPayableItemAsset and return the purchaseOrderIdentifier if the given documentNumber is initiated from the PurAp line.

Parameters:
documentNumber -
Returns:

getCurrentPurchaseOrderDocumentNumber

public String getCurrentPurchaseOrderDocumentNumber(String camsDocumentNumber)
Description copied from interface: CapitalAssetBuilderModuleService
Get current Purchase Order Document number for given CAMS Document Number

Specified by:
getCurrentPurchaseOrderDocumentNumber in interface CapitalAssetBuilderModuleService
Returns:
See Also:
CapitalAssetBuilderModuleService.getCurrentPurchaseOrderDocumentNumber(java.lang.String)

activateCabGlLines

protected void activateCabGlLines(String documentNumber)
Activates CAB GL Lines

Parameters:
documentNumber - String

activateCabPOLines

protected void activateCabPOLines(String documentNumber)
Activates PO Lines

Parameters:
documentNumber - String

getDocumentTypeName

protected String getDocumentTypeName(AccountingDocument accountingDocument)
gets the document type based on the instance of a class

Parameters:
accountingDocument -
Returns:

getParameterService

public org.kuali.rice.kns.service.ParameterService getParameterService()

getBusinessObjectService

public org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()

getDataDictionaryService

public org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()

getAssetService

public AssetService getAssetService()

getKualiModuleService

public org.kuali.rice.kns.service.KualiModuleService getKualiModuleService()

getCapitalAssetManagementModuleService

public CapitalAssetManagementModuleService getCapitalAssetManagementModuleService()

getPurApInfoService

protected PurApInfoService getPurApInfoService()


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