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