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.sys.service;
20
21 import org.kuali.kfs.fp.businessobject.OffsetAccount;
22 import org.kuali.kfs.gl.businessobject.FlexibleAccountUpdateable;
23
24 /**
25 *
26 * This interface defines methods that a FlexibleOffsetAccount Service must provide.
27 *
28 */
29 public interface FlexibleOffsetAccountService {
30
31 /**
32 * Retrieves the OffsetAccount by its composite primary key (all passed in as parameters) if the SYSTEM parameter
33 * FLEXIBLE_OFFSET_ENABLED_FLAG is true.
34 *
35 * @param chartOfAccountsCode The chart code of the account to be retrieved.
36 * @param accountNumber The account number of the account to be retrieved.
37 * @param financialOffsetObjectCode Offset object code used to retrieve the OffsetAccount.
38 * @return An OffsetAccount object instance. Returns null if there is none with the given key, or if the SYSTEM parameter
39 * FLEXIBLE_OFFSET_ENABLED_FLAG is false.
40 */
41 public OffsetAccount getByPrimaryIdIfEnabled(String chartOfAccountsCode, String accountNumber, String financialOffsetObjectCode);
42
43 /**
44 * Retrieves whether the SYSTEM parameter FLEXIBLE_OFFSET_ENABLED_FLAG is true.
45 *
46 * @return Whether the SYSTEM parameter FLEXIBLE_OFFSET_ENABLED_FLAG is true.
47 */
48 public boolean getEnabled();
49
50 /**
51 * This method will apply the flexible offset account if necessary. It will only change the chart, account, sub account and sub
52 * object on the transaction. If the flexible offset isn't enabled or valid for this transaction, it will be unchanged.
53 *
54 * It throws an InvalidFlexibleOffsetException if the flexible offset account associated with the transaction
55 * is invalid, closed or expired or if the object code is invalid for the flexible offset.
56 *
57 * @param transaction The OriginEntryFull object to be updated.
58 * @return True if transaction was changed, false if not.
59 */
60 public boolean updateOffset(FlexibleAccountUpdateable transaction);
61 }