1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.document.authorization;
17
18 import org.kuali.ole.module.purap.PurapAuthorizationConstants;
19 import org.kuali.ole.module.purap.document.ReceivingDocumentBase;
20 import org.kuali.rice.krad.document.Document;
21
22 import java.util.Set;
23
24 public class LineItemReceivingDocumentPresentationController extends PurchasingAccountsPayableDocumentPresentationController {
25
26 @Override
27 public boolean canSave(Document document) {
28 if (((ReceivingDocumentBase) document).getFinancialSystemDocumentHeader().getWorkflowDocument().isInitiated()) {
29 return false;
30 }
31 return super.canSave(document);
32 }
33
34 @Override
35 public boolean canCancel(Document document) {
36 if (((ReceivingDocumentBase) document).getFinancialSystemDocumentHeader().getWorkflowDocument().isInitiated()) {
37 return false;
38 }
39 return super.canCancel(document);
40 }
41
42 @Override
43 public boolean canClose(Document document) {
44 if (((ReceivingDocumentBase) document).getFinancialSystemDocumentHeader().getWorkflowDocument().isInitiated()) {
45 return false;
46 }
47 return super.canClose(document);
48 }
49
50 @Override
51 public Set<String> getEditModes(Document document) {
52 Set<String> editModes = super.getEditModes(document);
53
54 if (((ReceivingDocumentBase) document).getFinancialSystemDocumentHeader().getWorkflowDocument().isInitiated()) {
55 editModes.add(PurapAuthorizationConstants.LineItemReceivingEditMode.DISPLAY_INIT_TAB);
56 }
57
58 return editModes;
59 }
60 }