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