View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.kfs.module.cam.document.service;
20  
21  import java.util.Date;
22  import java.util.List;
23  
24  import org.kuali.kfs.module.cam.businessobject.AssetGlobal;
25  import org.kuali.kfs.module.cam.document.gl.CamsGeneralLedgerPendingEntrySourceBase;
26  import org.kuali.rice.core.api.util.type.KualiDecimal;
27  import org.kuali.rice.krad.bo.PersistableBusinessObject;
28  
29  
30  /**
31   * The interface defines methods for Asset Document
32   */
33  public interface AssetGlobalService {
34      /**
35       * To calculate the total payment amounts for each asset. lastEntry is used to handle decimal rounding. When calculate the
36       * entries except the last one, divide total by number of assets. When calculate the lastEntry, first sum asset total amount for
37       * assets except the last one, then subtract the sum from total.
38       * 
39       * @param assetGlobal
40       * @param lastEntry
41       * @return
42       */
43      public KualiDecimal totalPaymentByAsset(AssetGlobal assetGlobal, boolean lastEntry);
44  
45      /**
46       * This method checks if member exists in the given group.
47       * 
48       * @param groupName
49       * @param memberName
50       * @return
51       */
52      public boolean existsInGroup(String groupName, String memberName);
53  
54      /**
55       * Creates GL Postables
56       */
57      public void createGLPostables(AssetGlobal assetGlobal, CamsGeneralLedgerPendingEntrySourceBase assetGlobalGlPoster);
58  
59      /**
60       * Validates if the document type matches that of Asset Separate.
61       * 
62       * @param assetGlobal
63       * @return boolean
64       */
65      public boolean isAssetSeparate(AssetGlobal assetGlobal);
66  
67      /**
68       * Validates if the document type matches that of Asset Separate by payment
69       * 
70       * @param assetGlobal
71       * @return boolean
72       */
73      public boolean isAssetSeparateByPayment(AssetGlobal assetGlobal);
74      
75      /**
76       * Add and return the total amount for all unique assets created.
77       * 
78       * @param assetGlobal
79       * @return KualiDecimal
80       */
81      public KualiDecimal getUniqueAssetsTotalAmount(AssetGlobal assetGlobal);
82  
83      /**
84       * Returns assets for save for create new assets
85       * @param assetGlobal
86       * @return
87       */
88      public List<PersistableBusinessObject> getCreateNewAssets(AssetGlobal assetGlobal);    
89      
90      /**
91       * Returns assets for save for asset separate
92       * @param assetGlobal
93       * @return
94       */
95      public List<PersistableBusinessObject> getSeparateAssets(AssetGlobal assetGlobal);
96      
97      /**
98       * @return the parameter value for the new acquisition type code
99       */
100     public String getNewAcquisitionTypeCode();
101     /**
102      * @return the parameter value for the capital object acquisition code group
103      */
104     public String getCapitalObjectAcquisitionCodeGroup();
105     /**
106      * @return the parameter value for the not new acquisition code group 
107      */
108     public String getNonNewAcquisitionCodeGroup();
109     
110     /**
111      * Gets the FISCAL_YEAR_END_MONTH_AND_DAY system parameter
112      * TODO This should be refactored to a generic parm accessible to any module.
113      * @return FISCAL_YEAR_END_MONTH_AND_DAY value
114      */
115     public String getFiscalYearEndDayAndMonth();
116 
117 }