001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.kfs.module.cam.document.service;
017    
018    import java.util.List;
019    
020    import org.kuali.kfs.module.cam.businessobject.AssetGlobal;
021    import org.kuali.kfs.module.cam.document.gl.CamsGeneralLedgerPendingEntrySourceBase;
022    import org.kuali.rice.kns.bo.PersistableBusinessObject;
023    import org.kuali.rice.kns.util.KualiDecimal;
024    
025    
026    /**
027     * The interface defines methods for Asset Document
028     */
029    public interface AssetGlobalService {
030        /**
031         * To calculate the total payment amounts for each asset. lastEntry is used to handle decimal rounding. When calculate the
032         * entries except the last one, divide total by number of assets. When calculate the lastEntry, first sum asset total amount for
033         * assets except the last one, then subtract the sum from total.
034         * 
035         * @param assetGlobal
036         * @param lastEntry
037         * @return
038         */
039        public KualiDecimal totalPaymentByAsset(AssetGlobal assetGlobal, boolean lastEntry);
040    
041        /**
042         * This method checks if member exists in the given group.
043         * 
044         * @param groupName
045         * @param memberName
046         * @return
047         */
048        public boolean existsInGroup(String groupName, String memberName);
049    
050        /**
051         * Creates GL Postables
052         */
053        public void createGLPostables(AssetGlobal assetGlobal, CamsGeneralLedgerPendingEntrySourceBase assetGlobalGlPoster);
054    
055        /**
056         * Validates if the document type matches that of Asset Separate.
057         * 
058         * @param assetGlobal
059         * @return boolean
060         */
061        public boolean isAssetSeparate(AssetGlobal assetGlobal);
062    
063        /**
064         * Validates if the document type matches that of Asset Separate by payment
065         * 
066         * @param assetGlobal
067         * @return boolean
068         */
069        public boolean isAssetSeparateByPayment(AssetGlobal assetGlobal);
070        
071        /**
072         * Add and return the total amount for all unique assets created.
073         * 
074         * @param assetGlobal
075         * @return KualiDecimal
076         */
077        public KualiDecimal getUniqueAssetsTotalAmount(AssetGlobal assetGlobal);
078    
079        /**
080         * Returns assets for save for create new assets
081         * @param assetGlobal
082         * @return
083         */
084        public List<PersistableBusinessObject> getCreateNewAssets(AssetGlobal assetGlobal);    
085        
086        /**
087         * Returns assets for save for asset separate
088         * @param assetGlobal
089         * @return
090         */
091        public List<PersistableBusinessObject> getSeparateAssets(AssetGlobal assetGlobal);
092        
093        /**
094         * @return the parameter value for the new acquisition type code
095         */
096        public String getNewAcquisitionTypeCode();
097        /**
098         * @return the parameter value for the capital object acquisition code group
099         */
100        public String getCapitalObjectAcquisitionCodeGroup();
101        /**
102         * @return the parameter value for the not new acquisition code group 
103         */
104        public String getNonNewAcquisitionCodeGroup();
105    }