Bug 19401: Add confirm message when deleting invoice
[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         $("#delete").click(function(){
27             return confirmDelete(_("Are you sure you want to delete this invoice?"));
28         });
29         $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
30             bInfo: false,
31             bPaginate: false,
32             bFilter: false,
33             sDom: "t",
34             "aoColumnDefs": [
35                 { "sType": "anti-the", "aTargets": [ "anti-the" ] }
36             ]
37         }));
38 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
39         $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, {
40             "aoColumnDefs": [
41                 { "aTargets": [ "title-string" ], "sType": "title-string" }
42             ],
43             bInfo: false,
44             bPaginate: false,
45             bFilter: false,
46             sDom: "t"
47         }));
48 [% END %]
49         $("#show_all_details").click(function(){
50             updateColumnsVisibility( $(this).is(":checked") );
51         });
52
53         $("#show_all_details").prop('checked', false);
54         updateColumnsVisibility(false);
55     });
56 //]]>
57 </script>
58 </head>
59
60 <body id="acq_invoice" class="acq">
61 [% INCLUDE 'header.inc' %]
62 [% INCLUDE 'acquisitions-search.inc' %]
63
64 <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>
65
66 <div id="doc3" class="yui-t2">
67
68 <div id="bd">
69   <div id="yui-main">
70     <div class="yui-b">
71       [% IF ( modified ) %]
72         <div class="dialog message">
73           <p>Invoice has been modified</p>
74         </div>
75       [% END %]
76       <h1>Invoice: [% invoicenumber %]</h1>
77
78       <p>Vendor: <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% suppliername %]</a></p>
79         <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
80         <fieldset class="rows">
81             <ol>
82             <li>
83                 <label for="shipmentdate">Invoice number:</label>
84                 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="required" required="required"/>
85                 <span class="required">Required</span>
86             </li>
87
88             <li><label for="shipmentdate">Shipment date:</label>
89                     <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="datepicker" /></li>
90
91             <li><label for="billingdate">Billing date:</label>
92                     <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" class="datepicker" /></li>
93
94             <li><label for="shipmentcost">Shipping cost:</label>
95                     <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost %]" /></li>
96             <li><label for="shipment_budget_id">Shipping fund:</label>
97                     <select id="shipment_budget_id" name="shipment_budget_id">
98                         <option value="">No fund</option>
99                       [% FOREACH budget IN budgets_loop %]
100                         [% IF ( budget.selected ) %]
101                           <option selected="selected" value="[% budget.budget_id %]">
102                         [% ELSE %]
103                           <option value="[% budget.budget_id %]">
104                         [% END %]
105                           [% budget.budget_name %]
106                         </option>
107                       [% END %]
108                     </select></li>
109
110             [% IF ( invoiceclosedate ) %]
111             <li><span class="label">Status:</span>
112                 Closed on [% invoiceclosedate | $KohaDates %].</li>
113
114             <li><label for="reopen">Reopen: </label> <input type="checkbox" name="reopen" id="reopen" /></li>
115             [% ELSE %]
116             <li><span class="label">Status:</span>
117                 Open.</li>
118
119             <li><label for="close">Close: </label> <input type="checkbox" name="close" id="close" />
120                 </li>
121             [% END %]
122             </ol>
123           <input type="hidden" name="op" value="mod" />
124           <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
125         </fieldset>
126         <fieldset class="action">
127             <input type="submit" value="Save" />
128             [% UNLESS orders_loop.size %]
129             <a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a>
130             [% END %]
131         </fieldset>
132       </form>
133       <p>
134           <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a>
135           [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %]
136       </p>
137       <h2>Invoice details</h2>
138       [% IF orders_loop.size %]
139           <label for="show_all_details">
140             <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
141             Show all details
142           </label>
143           <table id="orderst">
144             <thead>
145               <tr>
146                 <th class="anti-the">Summary</th>
147                 <th>Library</th>
148                 <th class="tax_excluded">Actual cost tax exc.</th>
149                 <th class="tax_included">Actual cost tax inc.</th>
150                 <th>Qty.</th>
151                 <th class="tax_excluded">Total tax exc. ([% currency.symbol %])</th>
152                 <th class="tax_included">Total tax inc. ([% currency.symbol %])</th>
153                 <th>GST %</th>
154                 <th>GST</th>
155                 <th>Fund</th>
156               </tr>
157             </thead>
158             <tbody>
159               [% FOREACH order IN orders_loop %]
160                 <tr>
161                   <td>
162                     [% IF order.biblionumber %]
163                       <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a>
164                       [% IF ( order.author ) %]
165                         <br /><em>by</em> [% order.author %]
166                       [% END %]
167                     [% ELSE %]
168                       <em>Deleted bibliographic record, can't find title</em>
169                     [% END %]
170                     [% IF ( order.isbn ) %] &ndash; [% order.isbn %][% END %]
171                     [% IF ( order.publishercode ) %]
172                       <br/>[% order.publishercode %]
173                         [% IF order.publicationyear %], [% order.publicationyear %]
174                         [% ELSIF ( order.copyrightdate ) %][% order.copyrightdate %][% 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' %]