01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.financial.service;
17:
18: import org.kuali.module.financial.bo.OffsetAccount;
19: import org.kuali.module.gl.bo.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(
39: String chartOfAccountsCode, String accountNumber,
40: String financialOffsetObjectCode);
41:
42: /**
43: * Retrieves whether the SYSTEM parameter FLEXIBLE_OFFSET_ENABLED_FLAG is true.
44: *
45: * @return Whether the SYSTEM parameter FLEXIBLE_OFFSET_ENABLED_FLAG is true.
46: */
47: public boolean getEnabled();
48:
49: /**
50: * This method will apply the flexible offset account if necessary. It will only change the chart, account, sub account and sub
51: * object on the transaction. If the flexible offset isn't enabled or valid for this transaction, it will be unchanged.
52: *
53: * It throws an InvalidFlexibleOffsetException if the flexible offset account associated with the transaction
54: * is invalid, closed or expired or if the object code is invalid for the flexible offset.
55: *
56: * @param transaction The OriginEntryFull object to be updated.
57: * @return True if transaction was changed, false if not.
58: */
59: public boolean updateOffset(FlexibleAccountUpdateable transaction);
60: }
|