1 /*
2 * Copyright 2006 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.ole.sys.service;
17
18 import org.kuali.ole.fp.businessobject.OffsetAccount;
19 import org.kuali.ole.gl.businessobject.FlexibleAccountUpdateable;
20
21 /**
22 *
23 * This interface defines methods that a FlexibleOffsetAccount Service must provide.
24 *
25 */
26 public interface FlexibleOffsetAccountService {
27
28 /**
29 * Retrieves the OffsetAccount by its composite primary key (all passed in as parameters) if the SYSTEM parameter
30 * FLEXIBLE_OFFSET_ENABLED_FLAG is true.
31 *
32 * @param chartOfAccountsCode The chart code of the account to be retrieved.
33 * @param accountNumber The account number of the account to be retrieved.
34 * @param financialOffsetObjectCode Offset object code used to retrieve the OffsetAccount.
35 * @return An OffsetAccount object instance. Returns null if there is none with the given key, or if the SYSTEM parameter
36 * FLEXIBLE_OFFSET_ENABLED_FLAG is false.
37 */
38 public OffsetAccount getByPrimaryIdIfEnabled(String chartOfAccountsCode, String accountNumber, String financialOffsetObjectCode);
39
40 /**
41 * Retrieves whether the SYSTEM parameter FLEXIBLE_OFFSET_ENABLED_FLAG is true.
42 *
43 * @return Whether the SYSTEM parameter FLEXIBLE_OFFSET_ENABLED_FLAG is true.
44 */
45 public boolean getEnabled();
46
47 /**
48 * This method will apply the flexible offset account if necessary. It will only change the chart, account, sub account and sub
49 * object on the transaction. If the flexible offset isn't enabled or valid for this transaction, it will be unchanged.
50 *
51 * It throws an InvalidFlexibleOffsetException if the flexible offset account associated with the transaction
52 * is invalid, closed or expired or if the object code is invalid for the flexible offset.
53 *
54 * @param transaction The OriginEntryFull object to be updated.
55 * @return True if transaction was changed, false if not.
56 */
57 public boolean updateOffset(FlexibleAccountUpdateable transaction);
58 }