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