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