Bug 13321: Rename variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / invoice.tt
blobc35e8d8cc5c1c74c1b415c19e102ac59416cb076
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% USE Price %]
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     }
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         });
50         $("#show_all_details").prop('checked', false);
51         updateColumnsVisibility(false);
52     });
53 //]]>
54 </script>
55 </head>
57 <body id="acq_invoice" class="acq">
58 [% INCLUDE 'header.inc' %]
59 [% INCLUDE 'acquisitions-search.inc' %]
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>
63 <div id="doc3" class="yui-t2">
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>
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>
85             <li><label for="shipmentdate">Shipment date:</label>
86                     <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="datepicker" /></li>
88             <li><label for="billingdate">Billing date:</label>
89                     <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" class="datepicker" /></li>
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>
107             [% IF ( invoiceclosedate ) %]
108             <li><span class="label">Status:</span>
109                 Closed on [% invoiceclosedate | $KohaDates %].</li>
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>
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 %]</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.publishercode ) %]
168                       <br/>[% order.publishercode %]
169                         [% IF order.publicationyear > 0 %]
170                           - [% order.publicationyear %]
171                         [% ELSIF ( order.copyrightdate > 0) %]
172                           - [% order.copyrightdate %]
173                         [% END %]
174                     [% END %]
175                   </td>
176                   <td><p>[% order.branchcode %]</p></td>
177                   <td class="number tax_excluded">[% order.unitprice_tax_excluded | $Price %]</td>
178                   <td class="number tax_included">[% order.unitprice_tax_included | $Price %]</td>
179                   <td class="number">[% order.quantity %]</td>
180                   <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td>
181                   <td class="number tax_included">[% order.total_tax_included | $Price %]</td>
182                   <td class="number">[% order.tax_rate * 100 | $Price %]</td>
183                   <td class="number">[% order.tax_value | $Price %]</td>
184                   <td>[% order.budget_name %]</td>
185                 </tr>
186               [% END %]
187             </tbody>
188             <tfoot>
189               [% FOR tf IN foot_loop %]
190                 <tr>
191                     <th colspan='3'>Total (GST [% tf.tax_rate * 100 | $Price %] %)</th>
192                     <th class="tax_excluded"/><th class="tax_included"/>
193                     <th>[% tf.quantity %]</th>
194                     <th class="tax_excluded">[% tf.total_tax_excluded | $Price %]</th>
195                     <th class="tax_included">[% tf.total_tax_included | $Price %]</th>
196                     <th>&nbsp;</th>
197                     <th>[% tf.tax_value | $Price %]</th>
198                     <th>&nbsp;</th>
199                 </tr>
200               [% END %]
201               <tr>
202                 <th colspan='2'>Total ([% currency.symbol %])</th>
203                 <th class="tax_excluded"/><th class="tax_included"/>
204                 <th>[% total_quantity %]</th>
205                 <th class="tax_excluded">[% total_tax_excluded | $Price %]</th>
206                 <th class="tax_included">[% total_tax_included | $Price %]</th>
207                 <th>&nbsp;</th>
208                 <th>[% total_tax_value | $Price %]</th>
209                 <th>&nbsp;</th>
210               </tr>
211               <tr>
212                 <th colspan="2">Total + Shipment cost ([% currency.symbol %])</th>
213                 <th class="tax_excluded"></th>
214                 <th class="tax_included"></th>
215                 <th>[% total_quantity %]</th>
216                 <th class="tax_excluded">[% total_tax_excluded_shipment | $Price %]</th>
217                 <th class="tax_included">[% total_tax_included_shipment | $Price %]</th>
218                 <th>&nbsp;</th>
219                 <th>[% total_tax_value | $Price %]</th>
220                 <th>&nbsp;</th>
221               </tr>
222             </tfoot>
223           </table>
224         [% ELSE %]
225             <div class="dialog message"><p>No orders yet</p></div>
226         [% END %]
227         [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
228             <br />
229             <h2>Files attached to invoice</h2>
230             <table id="invoice_files_table">
231                 <thead>
232                     <tr>
233                         <th>Name</th>
234                         <th>Type</th>
235                         <th>Description</th>
236                         <th>Uploaded</th>
237                     </tr>
238                 </thead>
239                 <tbody>
240                 [% FOREACH f IN files %]
241                     <tr>
242                          <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>
243                          <td>[% f.file_type | html %]</td>
244                          <td>[% f.file_description | html %]</td>
245                          <td class="title-string">
246                            <span title="[% f.date_uploaded %]">[% f.date_uploaded | $KohaDates %]</span>
247                          </td>
248                     </tr>
249                 [% END %]
250                 </tbody>
251             </table>
252         [% END %]
253     </div>
254   </div>
255   <div class="yui-b">
256     [% INCLUDE 'acquisitions-menu.inc' %]
257   </div>
258 </div>
259 [% INCLUDE 'intranet-bottom.inc' %]