1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.document.web;
17
18 import org.kuali.ole.module.purap.businessobject.PurApAccountingLineBase;
19 import org.kuali.ole.module.purap.businessobject.PurApItemBase;
20 import org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument;
21 import org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocumentBase;
22 import org.kuali.ole.sys.businessobject.AccountingLine;
23 import org.kuali.ole.sys.document.AccountingDocument;
24 import org.kuali.ole.sys.document.web.AccountingLineViewField;
25
26
27
28
29 public class PurapAccountingLineViewField extends AccountingLineViewField {
30
31
32
33
34
35
36
37 @Override
38 protected boolean isRenderingInquiry(AccountingDocument document, AccountingLine line) {
39 if (!((PurchasingAccountsPayableDocument) document).isInquiryRendered()) {
40 return false;
41 }
42 return super.isRenderingInquiry(document, line);
43 }
44
45
46
47
48
49
50
51 @Override
52 protected String getDynamicNameLabelDisplayedValue(AccountingLine accountingLine) {
53 PurApAccountingLineBase purapLine = (PurApAccountingLineBase) accountingLine;
54 PurApItemBase purapItem = purapLine.getPurapItem();
55 PurchasingAccountsPayableDocumentBase purapDocument = null;
56
57 if (purapItem != null) {
58 purapDocument = purapItem.getPurapDocument();
59 }
60 if (purapItem == null || purapDocument == null || purapDocument.isInquiryRendered()) {
61 return super.getDynamicNameLabelDisplayedValue(accountingLine);
62 } else {
63 return null;
64 }
65 }
66 }