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