Bug 12904: Force browser to load new javascript files after upgrade
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / invoice.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% USE Price %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Acquisitions &rsaquo; Invoice</title>
7 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
8 [% INCLUDE 'doc-head-close.inc' %]
9 </head>
10
11 <body id="acq_invoice" class="acq">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'acquisitions-search.inc' %]
14
15 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a> &rsaquo; <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">[% invoicenumber %]</a></div>
16
17 <div id="doc3" class="yui-t2">
18
19 <div id="bd">
20   <div id="yui-main">
21     <div class="yui-b">
22       [% IF ( modified ) %]
23         <div class="dialog message">
24           <p>Invoice has been modified</p>
25         </div>
26       [% END %]
27       <h1>Invoice: [% invoicenumber %]</h1>
28
29       <p>Vendor: <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% suppliername %]</a></p>
30         <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
31         <fieldset class="rows">
32             <ol>
33             <li>
34                 <label for="shipmentdate">Invoice number:</label>
35                 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="required" required="required"/>
36                 <span class="required">Required</span>
37             </li>
38
39             <li><label for="shipmentdate">Shipment date:</label>
40                     <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="datepicker" /></li>
41
42             <li><label for="billingdate">Billing date:</label>
43                     <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" class="datepicker" /></li>
44
45             <li><label for="shipmentcost">Shipping cost:</label>
46                     <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost %]" /></li>
47             <li><label for="shipment_budget_id">Shipping fund:</label>
48                     <select id="shipment_budget_id" name="shipment_budget_id">
49                         <option value="">No fund</option>
50                       [% FOREACH budget IN budgets_loop %]
51                         [% IF ( budget.selected ) %]
52                           <option selected="selected" value="[% budget.budget_id %]">
53                         [% ELSE %]
54                           <option value="[% budget.budget_id %]">
55                         [% END %]
56                           [% budget.budget_name %]
57                         </option>
58                       [% END %]
59                     </select></li>
60
61             [% IF ( invoiceclosedate ) %]
62             <li><span class="label">Status:</span>
63                 Closed on [% invoiceclosedate | $KohaDates %].</li>
64
65             <li><label for="reopen">Reopen: </label> <input type="checkbox" name="reopen" id="reopen" /></li>
66             [% ELSE %]
67             <li><span class="label">Status:</span>
68                 Open.</li>
69
70             <li><label for="close">Close: </label> <input type="checkbox" name="close" id="close" />
71                 </li>
72             [% END %]
73             </ol>
74           <input type="hidden" name="op" value="mod" />
75           <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
76         </fieldset>
77         <fieldset class="action">
78             <input type="submit" value="Save" />
79             [% UNLESS orders_loop.size %]
80             <a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a>
81             [% END %]
82         </fieldset>
83       </form>
84       <p>
85           <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a>
86           [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %]
87       </p>
88       <h2>Invoice details</h2>
89       [% IF orders_loop.size %]
90           <label for="show_all_details">
91             <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
92             Show all details
93           </label>
94           <table id="orderst">
95             <thead>
96               <tr>
97                 <th class="anti-the">Summary</th>
98                 <th>Library</th>
99                 <th class="tax_excluded">Actual cost tax exc.</th>
100                 <th class="tax_included">Actual cost tax inc.</th>
101                 <th>Qty.</th>
102                 <th class="tax_excluded">Total tax exc. ([% currency.symbol %])</th>
103                 <th class="tax_included">Total tax inc. ([% currency.symbol %])</th>
104                 <th>GST %</th>
105                 <th>GST</th>
106                 <th>Fund</th>
107               </tr>
108             </thead>
109             <tbody>
110               [% FOREACH order IN orders_loop %]
111                 <tr>
112                   <td>
113                     [% IF order.biblionumber %]
114                       <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a>
115                       [% IF ( order.author ) %]
116                         <br /><em>by</em> [% order.author %]
117                       [% END %]
118                     [% ELSE %]
119                       <em>Deleted bibliographic record, can't find title</em>
120                     [% END %]
121                     [% IF ( order.isbn ) %] &ndash; [% order.isbn %][% END %]
122                     [% IF ( order.publishercode ) %]
123                       <br/>[% order.publishercode %]
124                         [% IF order.publicationyear %], [% order.publicationyear %]
125                         [% ELSIF ( order.copyrightdate ) %][% order.copyrightdate %][% END %]
126                     [% END %]
127                   </td>
128                   <td><p>[% order.branchcode %]</p></td>
129                   <td class="number tax_excluded">[% order.unitprice_tax_excluded | $Price %]</td>
130                   <td class="number tax_included">[% order.unitprice_tax_included | $Price %]</td>
131                   <td class="number">[% order.quantity %]</td>
132                   <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td>
133                   <td class="number tax_included">[% order.total_tax_included | $Price %]</td>
134                   <td class="number">[% order.tax_rate * 100 %]</td>
135                   <td class="number">[% order.tax_value | $Price %]</td>
136                   <td>[% order.budget_name %]</td>
137                 </tr>
138               [% END %]
139             </tbody>
140             <tfoot>
141               [% FOR tf IN foot_loop %]
142                 <tr>
143                     <th colspan="2">Total (GST [% tf.tax_rate * 100 %] %)</th>
144                     <th class="tax_excluded"/><th class="tax_included"/>
145                     <th>[% tf.quantity %]</th>
146                     <th class="tax_excluded">[% tf.total_tax_excluded | $Price %]</th>
147                     <th class="tax_included">[% tf.total_tax_included | $Price %]</th>
148                     <th>&nbsp;</th>
149                     <th>[% tf.tax_value | $Price %]</th>
150                     <th>&nbsp;</th>
151                 </tr>
152               [% END %]
153               <tr>
154                 <th colspan='2'>Total ([% currency.symbol %])</th>
155                 <th class="tax_excluded"/><th class="tax_included"/>
156                 <th>[% total_quantity %]</th>
157                 <th class="tax_excluded">[% total_tax_excluded | $Price %]</th>
158                 <th class="tax_included">[% total_tax_included | $Price %]</th>
159                 <th>&nbsp;</th>
160                 <th>[% total_tax_value | $Price %]</th>
161                 <th>&nbsp;</th>
162               </tr>
163               <tr>
164                 <th colspan="2">Total + Shipment cost ([% currency.symbol %])</th>
165                 <th class="tax_excluded"></th>
166                 <th class="tax_included"></th>
167                 <th>[% total_quantity %]</th>
168                 <th class="tax_excluded">[% total_tax_excluded_shipment | $Price %]</th>
169                 <th class="tax_included">[% total_tax_included_shipment | $Price %]</th>
170                 <th>&nbsp;</th>
171                 <th>[% total_tax_value | $Price %]</th>
172                 <th>&nbsp;</th>
173               </tr>
174             </tfoot>
175           </table>
176         [% ELSE %]
177             <div class="dialog message"><p>No orders yet</p></div>
178         [% END %]
179         [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
180             <br />
181             <h2>Files attached to invoice</h2>
182             <table id="invoice_files_table">
183                 <thead>
184                     <tr>
185                         <th>Name</th>
186                         <th>Type</th>
187                         <th>Description</th>
188                         <th>Uploaded</th>
189                     </tr>
190                 </thead>
191                 <tbody>
192                 [% FOREACH f IN files %]
193                     <tr>
194                          <td><a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]&amp;op=download&amp;view=1&amp;file_id=[% f.file_id %]">[% f.file_name | html %]</a></td>
195                          <td>[% f.file_type | html %]</td>
196                          <td>[% f.file_description | html %]</td>
197                          <td class="title-string">
198                            <span title="[% f.date_uploaded %]">[% f.date_uploaded | $KohaDates %]</span>
199                          </td>
200                     </tr>
201                 [% END %]
202                 </tbody>
203             </table>
204         [% END %]
205     </div>
206   </div>
207   <div class="yui-b">
208     [% INCLUDE 'acquisitions-menu.inc' %]
209   </div>
210 </div>
211
212 [% MACRO jsinclude BLOCK %]
213     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
214     [% INCLUDE 'calendar.inc' %]
215     [% INCLUDE 'datatables.inc' %]
216     <script type="text/javascript">
217         function updateColumnsVisibility(visible) {
218             if ( visible ) {
219                 $("table .tax_excluded, .tax_included").show();
220             } else {
221                 [% IF ( invoiceincgst ) %]
222                     $("table .tax_excluded").hide();
223                 [% ELSE %]
224                     $("table .tax_included").hide();
225                 [% END %]
226             }
227         }
228
229         $(document).ready(function() {
230             $("#delete").click(function(){
231                 return confirmDelete(_("Are you sure you want to delete this invoice?"));
232             });
233             $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
234                 bInfo: false,
235                 bPaginate: false,
236                 bFilter: false,
237                 sDom: "t",
238                 "aoColumnDefs": [
239                     { "sType": "anti-the", "aTargets": [ "anti-the" ] }
240                 ]
241             }));
242             [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
243                 $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, {
244                     "aoColumnDefs": [
245                         { "aTargets": [ "title-string" ], "sType": "title-string" }
246                     ],
247                     bInfo: false,
248                     bPaginate: false,
249                     bFilter: false,
250                     sDom: "t"
251                 }));
252             [% END %]
253             $("#show_all_details").click(function(){
254                 updateColumnsVisibility( $(this).is(":checked") );
255             });
256
257             $("#show_all_details").prop('checked', false);
258             updateColumnsVisibility(false);
259         });
260     </script>
261 [% END %]
262
263 [% INCLUDE 'intranet-bottom.inc' %]