Acq: several interface improvements
[working/Evergreen.git] / Open-ILS / src / templates / acq / po / view.tt2
1 [% WRAPPER 'base.tt2' %]
2 [% ctx.page_title = l("Purchase Order") %]
3 <div dojoType="dijit.layout.ContentPane" style="height:100%">
4     <div id='oils-scroll-to-top'></div>
5     <div>
6         <div id='oils-acq-picklist-header'>
7             <big>
8                 [% l('Purchase Order ([_1])', '<span id="acq-po-view-state"></span>') %] 
9             </big>
10             <span id='acq-po-activated-on' class='hidden'></span>
11             <table class="oils-generic-table acq-po-info">
12                 <tr>
13                     <th>[% l('ID') %]</th><td><a id="acq-po-view-id"/></td>
14                     <th>[% l('Prepayment Required?') %]</th>
15                     <td><span id="acq-po-view-prepay"></span></td>
16                 </tr>
17                 <tr>
18                     <th>[% l('Name') %]</th>
19                     <td><a id="acq-po-view-name" href="javascript:void(0);"
20                         onclick="updatePoName()"></a></td>
21                     <th>[% l('Activatable?') %]</th>
22                     <td>
23                         <span id="acq-po-activate-checking"></span>
24                         <span class="hidden" id="acq-po-activate-link"><span dojoType="dijit.form.Button" onClick="activatePo()" jsId="activatePoButton">[% l('Activate Order') %]</span></span>
25                     </td>
26                 </tr>
27                 <tr>
28                     <th>[% l('Provider') %]</th>
29                     <td><span id="acq-po-view-provider"></span></td>
30                     <th>[% l('Notes') %]</th>
31                     <td>
32                         <a href="javascript:void(0);"
33                             id="acq-po-view-notes"></a>
34                     </td>
35                 </tr>
36                 <tr>
37                     <th>[% l('Total Lineitems') %]</th>
38                     <td><span id="acq-po-view-total-li"></span></td>
39                     <th>[% l('EDI Messages') %]</th>
40                     <td>
41                         <a href="javascript:void(0);"
42                             id="acq-po-view-edi-messages"></a>
43                     </td>
44                 </tr>
45                 <tr>
46                     <th>[% l('Total Estimated') %]</th>
47                     <td>[% l('$[_1]', '<span id="acq-po-view-total-estimated"></span>') %]</td>
48                     <th>[% l('History') %]</th>
49                     <td>
50                         <a class="hidden" href="javascript:void(0);"
51                             id="acq-po-view-history">[% l('View') %]</a>
52                     </td>
53                 </tr>
54                 <tr>
55                     <th>[% l('Total Encumbered') %]</th>
56                     <td>[% l('$[_1]', '<span id="acq-po-view-total-enc"></span>') %]</td>
57                     <th id="acq-po-invoice-label" class="hidden">[% l('Invoicing') %]</th>
58                     <td id="acq-po-invoice-stuff" class="hidden">
59                         <button dojoType="dijit.form.Button"
60                             id="acq-po-view-invoice-link">
61                             [% l('View Invoices ([_1])',
62                             '<span id="acq-po-view-invoice-count"></span>') %]
63                         </button> &nbsp;
64                         <button dojoType="dijit.form.Button"
65                             id="acq-po-create-invoice-link">
66                             [% l('Create Invoice') %]
67                         </button> &nbsp;
68                         <button dojoType="dijit.form.DropDownButton">
69                             <span>[% l('Link Invoice') %]</span>
70                             <div dojoType="dijit.TooltipDialog"
71                                 id="acq-po-link-invoice">
72                                 <script type="dojo/connect" event="onOpen">
73                                     if (!invoiceLinkDialogManager) {
74                                         invoiceLinkDialogManager =
75                                             new InvoiceLinkDialogManager(
76                                                 "po", PO
77                                             );
78                                     }
79                                 </script>
80                                 [% INCLUDE "acq/common/inv_dialog.tt2"
81                                     which = "po" %]
82                             </div>
83                         </button>
84                     </td>
85                 </tr>
86                 <tr>
87                     <th>[% l('Total Spent') %]</th>
88                     <td>[% l('$[_1]', '<span id="acq-po-view-total-spent"></span>') %]</td>
89                     <th id="acq-po-cancel-label"></th>
90                     <td>
91                         <span id="acq-po-view-cancel-reason"></span>
92                         <span id="acq-po-choose-cancel-reason" class="hidden">
93                             <span dojoType="dijit.form.DropDownButton">
94                                 <span>[% l('Cancel order') %]</span>
95                                 <span dojoType="dijit.TooltipDialog">
96                                     <label for="acq-po-cancel-reason">
97                                         [% l('Reason:') %]
98                                     </label>
99                                     <span id="acq-po-cancel-reason"></span>
100                                     <button jsId="acqPoCancelReasonSubmit"
101                                         dojoType="dijit.form.Button"
102                                         type="submit">[% l('Cancel order') %]</button>
103                                 </span>
104                             </span>
105                         </span>
106                     </td>
107                 </tr>
108                 <tr>
109                     <th></th>
110                     <td>
111                         <div class='hidden' id='acq-po-return-to-search'>
112                             <button dojoType='dijit.form.Button' id='acq-po-return-to-search-button'>[% l('&#x2196; Return to Search') %]</button>
113                         </div>
114                         <div class='hidden' id='acq-po-return-to-invoice'>
115                             <button dojoType='dijit.form.Button' id='acq-po-return-to-invoice-button'>[% l('&#x2196; Return to Invoice') %]</button>
116                         </div>
117                     </td>
118                     <th class="hidden" id="acq-po-zero-activate-label">[% l('Allow activation with <br/> zero-copy lineitems') %]</th>
119                     <td class="hidden" id="acq-po-zero-activate"><input type='checkbox' id='acq-po-activate-zero-copies' onclick='checkCouldActivatePo()'/></td>
120                 </tr>
121                 <tr>
122                     <td colspan='3'>
123                         <a class="hidden" id="acq-po-split" href="javascript:void(0);"
124                             onclick="if (confirm(localeStrings.CONFIRM_SPLIT_PO)) splitPo();">
125                             [% l('Split Order by Lineitems') %]
126                         </a>
127                     </td>
128                 </tr>
129             </table>
130         </div>
131     </div>
132     <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/acq/common/base64.js"></script>
133     <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/acq/po/view_po.js'></script>
134     <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/acq/po/item_table.js"></script>
135     <script type="text/javascript">
136         var poId = "[% ctx.page_args.1 %]";
137         var liFocus = "[% ctx.page_args.0 %]";
138         if (liFocus && !poId) {
139             poId = liFocus;
140             liFocus = null;
141         }
142     </script>
143     [% INCLUDE 'acq/common/li_table.tt2' %]
144     [% INCLUDE "acq/common/notes.tt2" which = "Po" %]
145     <div class='hidden' id='acq-po-no-lineitems'>
146         <button type='dijit.form.Button' onclick='location.href = oilsBasePath + "/acq/picklist/brief_record?po=" + poId'>
147             [% l('Add Brief Record') %]
148         </button>
149     </div>
150     [% INCLUDE "acq/po/item_table.tt2" %]
151 </div>
152 [% END %]