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