1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.validation.impl;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.kuali.ole.fp.document.BudgetAdjustmentDocument;
22 import org.kuali.ole.sys.OLEConstants;
23 import org.kuali.ole.sys.businessobject.AccountingLine;
24 import org.kuali.rice.core.api.config.property.ConfigurationService;
25 import org.kuali.rice.kew.api.WorkflowDocument;
26 import org.kuali.rice.kns.rules.PromptBeforeValidationBase;
27 import org.kuali.rice.krad.document.Document;
28 import org.kuali.rice.krad.util.ObjectUtils;
29
30
31
32
33 public class BudgetAdjustmentDocumentPreRules extends PromptBeforeValidationBase {
34 protected ConfigurationService kualiConfiguration;
35
36
37
38
39
40
41
42
43
44 @Override
45 public boolean doPrompts(Document document) {
46 boolean preRulesOK = true;
47
48
49
50
51 return preRulesOK;
52 }
53
54
55
56
57 protected List deepCopyAccountingLinesList(List originals) {
58 if (originals == null) {
59 return null;
60 }
61 List copiedLines = new ArrayList();
62 for (int i = 0; i < originals.size(); i++) {
63 copiedLines.add(ObjectUtils.deepCopy((AccountingLine) originals.get(i)));
64 }
65 return copiedLines;
66 }
67
68
69
70
71
72
73 protected boolean canGenerateLaborBenefitsByRouteStatus(BudgetAdjustmentDocument budgetAdjustmentDocument) {
74 final WorkflowDocument workflowDocument = budgetAdjustmentDocument.getDocumentHeader().getWorkflowDocument();
75 if (workflowDocument.isInitiated() || workflowDocument.isSaved())
76 {
77 return true;
78 }
79 if (workflowDocument.isEnroute() && workflowDocument.getCurrentRouteNodeInstances().contains(OLEConstants.RouteLevelNames.ACCOUNT))
80 {
81 return true;
82 }
83 return false;
84 }
85 }
86