1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.web.struts;
17
18 import java.util.HashSet;
19 import java.util.Map;
20 import java.util.Set;
21
22 import org.apache.commons.lang.StringUtils;
23 import org.kuali.ole.sys.businessobject.AccountingLine;
24 import org.kuali.ole.sys.businessobject.AccountingLineOverride;
25 import org.kuali.ole.sys.businessobject.AccountingLineOverride.COMPONENT;
26 import org.kuali.ole.sys.web.struts.KualiAccountingDocumentFormBase;
27
28
29
30
31
32 public class BudgetAdjustmentForm extends KualiAccountingDocumentFormBase {
33
34 protected static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(BudgetAdjustmentForm.class);
35
36
37
38
39
40
41
42 public BudgetAdjustmentForm() {
43 super();
44 }
45
46 @Override
47 protected String getDefaultDocumentTypeName() {
48 return "OLE_BA";
49 }
50
51 @Override
52 protected void repopulateOverrides(AccountingLine line, String accountingLinePropertyName, Map parameterMap) {
53 determineNeededOverrides(line);
54 if (line.getAccountExpiredOverrideNeeded()) {
55 if (LOG.isDebugEnabled()) {
56 StringUtils.join(parameterMap.keySet(), "\n");
57 }
58 if (parameterMap.containsKey(accountingLinePropertyName+".accountExpiredOverride.present")) {
59 line.setAccountExpiredOverride(parameterMap.containsKey(accountingLinePropertyName+".accountExpiredOverride"));
60 }
61 } else {
62 line.setAccountExpiredOverride(false);
63 }
64 }
65
66
67
68
69
70
71
72 public static AccountingLineOverride determineNeededOverrides(AccountingLine line) {
73 Set neededOverrideComponents = new HashSet();
74 if (AccountingLineOverride.needsExpiredAccountOverride(line.getAccount())) {
75 neededOverrideComponents.add(COMPONENT.EXPIRED_ACCOUNT);
76 }
77
78 return AccountingLineOverride.valueOf(neededOverrideComponents);
79 }
80 }