7 [% USE AuthorisedValues %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha › Acquisitions › Invoice</title>
11 [% Asset.css("css/datatables.css") | $raw %]
12 [% INCLUDE 'doc-head-close.inc' %]
15 <body id="acq_invoice" class="acq">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'acquisitions-search.inc' %]
19 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a> › <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid | html %]">[% invoicenumber | html %]</a></div>
21 <div class="main container-fluid">
23 <div class="col-sm-10 col-sm-push-2">
27 <div class="dialog message">
28 <p>Invoice has been modified</p>
31 <h1>Invoice: [% invoicenumber | html %]</h1>
33 <p>Vendor: <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% suppliername | html %]</a></p>
34 <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
35 <fieldset class="rows">
38 <label for="shipmentdate" class="required">Invoice number:</label>
39 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber | html %]" class="required" required="required"/>
40 <span class="required">Required</span>
43 <li><label for="shipmentdate">Shipment date:</label>
44 <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="datepicker" /></li>
46 <li><label for="billingdate">Billing date:</label>
47 <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" class="datepicker" /></li>
49 <li><label for="shipmentcost">Shipping cost:</label>
50 <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost | html %]" /></li>
51 <li><label for="shipment_budget_id">Shipping fund:</label>
52 <select id="shipment_budget_id" name="shipment_budget_id">
53 <option value="">No fund</option>
54 [% FOREACH budget IN budgets_loop %]
55 [% IF ( budget.selected ) %]
56 <option selected="selected" value="[% budget.budget_id | html %]">
58 <option value="[% budget.budget_id | html %]">
60 [% budget.budget_name | html %]
65 [% IF ( invoiceclosedate ) %]
66 <li><span class="label">Status:</span>
67 Closed on [% invoiceclosedate | $KohaDates %].</li>
69 <li><label for="reopen">Reopen: </label> <input type="checkbox" name="reopen" id="reopen" /></li>
71 <li><span class="label">Status:</span>
74 <li><label for="close">Close: </label> <input type="checkbox" name="close" id="close" />
78 <input type="hidden" name="op" value="mod" />
79 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
80 <fieldset class="action">
81 <input type="submit" value="Save" />
82 [% UNLESS orders_loop.size %]
83 <a href="invoice.pl?op=delete&invoiceid=[% invoiceid | uri %]" id="delete">Delete</a>
93 <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
94 <fieldset class="rows">
95 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
96 [% IF (adjustments && adjustments.count > 0) %]
97 <table id="invoice_adj_table">
104 <th>Encumber while invoice open</th>
108 [% FOREACH adjustment IN adjustments %]
109 [% total_adj = total_adj + adjustment.adjustment %]
111 <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id | html %]" />[% adjustment.adjustment_id | html %]</td>
112 <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment | $Price on_editing => 1 %]" /></td>
114 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
116 <select id="reason_[% adjustment.adjustment_id | html %]" name="reason">
117 <option value="">No reason</option>
118 [% FOREACH reason IN reasons %]
119 [% IF ( adjustment.reason == reason.authorised_value ) %]
120 <option selected="selected" value="[% reason.authorised_value | html %]">
122 <option value="[% reason.authorised_value | html %]">
124 [% reason.lib | html %]
129 <p title="Define values in authorised value category ADJ_REASON to enable">None</p>
130 <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id | html %]" value="" />
133 <td><input type="text" name="note" id="note_new" value="[% adjustment.note | html %]"/></td>
135 <select id="budget_id_[% adjustment.adjustment_id | html %]" name="budget_id">
136 <option value="">No fund</option>
137 [% FOREACH budget IN budgets_loop %]
138 [% IF ( budget.budget_id == adjustment.budget_id ) %]
139 <option selected="selected" value="[% budget.budget_id | html %]">
141 <option value="[% budget.budget_id | html %]">
143 [% budget.budget_name | html %]
148 [% IF adjustment.encumber_open %]
150 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment_id | html %]" checked/>
154 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment_id | html %]" />
158 <a class="btn btn-default btn-xs delete_adjustment" href="/cgi-bin/koha/acqui/invoice.pl?op=del_adj&adjustment_id=[% adjustment.adjustment_id | html %]&invoiceid=[% invoiceid | html %]"><i class="fa fa-trash"></i> Delete</a>
166 <a href="#" id="show_invoice_adjustment" class="toggle_invoice_adjustment"><i class="fa fa-plus"></i> Add an adjustment</a>
169 <fieldset id="add_invoice_adjustment" style="display:none">
170 <h4>Add an adjustment</h4>
171 <input type="hidden" name="adjustment_id" value="new" />
174 <label for="adjustment_new">Amount: </label>
175 <input type="text" name="adjustment" id="adjustment_new" />
177 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
180 <label for="reason_[% adjustment.adjustment_id | html %]">Reason: </label>
181 <select id="reason_[% adjustment.adjustment_id | html %]" name="reason">
182 <option value="">No reason</option>
183 [% FOREACH reason IN reasons %]
184 <option value="[% reason.authorised_value | html %]">
185 [% reason.lib | html %]
192 <span class="label">Reason: </span>
194 <div class="hint">Define values in authorised value category ADJ_REASON to enable</div>
198 <label for="note_new">Note: </label>
199 <input type="text" name="note" id="note_new" value=""/>
202 <label for="budget_id_new">Fund: </label>
203 <select id="budget_id_new" name="budget_id">
204 <option selected="selected" value="">No fund</option>
205 [% FOREACH budget IN budgets_loop %]
206 <option value="[% budget.budget_id | html %]">
207 [% budget.budget_name | html %]
213 <label for="encumber_new">Encumber while invoice open? </label>
214 <input type="checkbox" name="encumber_open" id="encumber_new" value="new" />
215 <input type="hidden" name="delete" value="">
218 <span class="label"> </span>
219 <a href="#" id="cancel_invoice_adjustment" class="toggle_invoice_adjustment" style="display:none"><i class="fa fa-remove"></i> Cancel</a>
223 <fieldset class="action">
224 <input type="hidden" name="op" value="mod_adj" />
225 <input type="submit" value="Update adjustments" />
230 <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">Go to receipt page</a>
231 [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid | uri %]">Manage invoice files</a>[% END %]
233 <h2>Invoice details</h2>
235 [% IF orders_loop.size %]
236 <label for="show_all_details">
237 <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
243 <th class="anti-the">Summary</th>
245 <th class="tax_excluded">Actual cost tax exc.</th>
246 <th class="tax_included">Actual cost tax inc.</th>
247 <th class="replacementprice">Replacement price</th>
249 <th class="tax_excluded">Total tax exc. ([% currency.symbol | html %])</th>
250 <th class="tax_included">Total tax inc. ([% currency.symbol | html %])</th>
257 [% FOREACH order IN orders_loop %]
260 [% IF order.biblionumber %]
261 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
262 [% IF ( order.author ) %]
263 <br /><em>by</em> [% order.author | html %]
266 <em>Deleted bibliographic record, can't find title</em>
268 [% IF ( order.isbn ) %] – [% order.isbn | html %][% END %]
269 [% IF ( order.publishercode ) %]
270 <br/>[% order.publishercode | html %]
271 [% IF order.publicationyear %], [% order.publicationyear | html %]
272 [% ELSIF ( order.copyrightdate ) %][% order.copyrightdate | html %][% END %]
275 <td><p>[% order.branchcode | html %]</p></td>
276 <td class="number tax_excluded">[% order.unitprice_tax_excluded | $Price %]</td>
277 <td class="number tax_included">[% order.unitprice_tax_included | $Price %]</td>
278 <td class="number replacementprice">[% order.replacementprice | $Price %]</td>
279 <td class="number">[% order.quantity | html %]</td>
280 <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td>
281 <td class="number tax_included">[% order.total_tax_included | $Price %]</td>
282 <td class="number">[% order.tax_rate * 100 | html %]</td>
283 <td class="number">[% order.tax_value | $Price %]</td>
284 <td>[% order.budget_name | html %]</td>
289 [% FOR tf IN foot_loop %]
291 <th colspan="2">Total (GST [% tf.tax_rate * 100 | html %] %)</th>
292 <th class="tax_excluded"></th>
293 <th class="tax_included"></th>
294 <th class="replacementprice"/>
295 <th>[% tf.quantity | html %]</th>
296 <th class="tax_excluded">[% tf.total_tax_excluded | $Price %]</th>
297 <th class="tax_included">[% tf.total_tax_included | $Price %]</th>
299 <th>[% tf.tax_value | $Price %]</th>
304 <th colspan="2">Total ([% currency.symbol | html %])</th>
305 <th class="tax_excluded"></th>
306 <th class="tax_included"></th>
307 <th class="replacementprice"/>
308 <th>[% total_quantity | html %]</th>
309 <th class="tax_excluded">[% total_tax_excluded | $Price %]</th>
310 <th class="tax_included">[% total_tax_included | $Price %]</th>
312 <th>[% total_tax_value | $Price %]</th>
316 <th colspan="2">Total + Adjustments + Shipment cost ([% currency.symbol | html %])</th>
317 <th class="tax_excluded"></th>
318 <th class="tax_included"></th>
319 <th class="replacementprice"/>
320 <th>[% total_quantity | html %]</th>
321 <th class="tax_excluded">[% total_tax_excluded_shipment + total_adj | $Price %]</th>
322 <th class="tax_included">[% total_tax_included_shipment | $Price %]</th>
324 <th>[% total_tax_value | $Price %]</th>
330 <div class="dialog message"><p>No orders yet</p>
331 [% IF adjustments && adjustments.count > 0 || shipmentcost && shipmentcost > 0 %]
332 <p>Adjustments plus shipping:[% total_adj + shipmentcost | $Price %]</p>
336 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
338 <h2>Files attached to invoice</h2>
339 <table id="invoice_files_table">
349 [% FOREACH f IN files %]
351 <td><a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid | uri %]&op=download&view=1&file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a></td>
352 <td>[% f.file_type | html %]</td>
353 <td>[% f.file_description | html %]</td>
354 <td class="title-string">
355 <span title="[% f.date_uploaded | html %]">[% f.date_uploaded | $KohaDates %]</span>
364 </div> <!-- /.col-sm-10.col-sm-push-2 -->
367 <div class="col-sm-2 col-sm-pull-10">
368 [% INCLUDE 'acquisitions-menu.inc' %]
371 </div> <!-- /.row -->
373 [% MACRO jsinclude BLOCK %]
374 [% Asset.js("js/acquisitions-menu.js") | $raw %]
375 [% INCLUDE 'calendar.inc' %]
376 [% INCLUDE 'datatables.inc' %]
378 function updateColumnsVisibility(visible) {
380 $("table .tax_excluded, .tax_included").show();
382 [% IF ( invoiceincgst ) %]
383 $("table .tax_excluded").hide();
385 $("table .tax_included").hide();
390 $(document).ready(function() {
391 $("#delete").click(function(){
392 return confirmDelete(_("Are you sure you want to delete this invoice?"));
394 $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
400 { "sType": "anti-the", "aTargets": [ "anti-the" ] }
403 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
404 $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, {
406 { "aTargets": [ "title-string" ], "sType": "title-string" }
414 $("#show_all_details").click(function(){
415 updateColumnsVisibility( $(this).is(":checked") );
418 $("#show_all_details").prop('checked', false);
419 updateColumnsVisibility(false);
420 $(".toggle_invoice_adjustment").on("click", function(e){
422 $("#show_invoice_adjustment, #cancel_invoice_adjustment, #add_invoice_adjustment").toggle();
424 $("a.delete_adjustment").click(function(){
425 return ( confirm( _("Are you sure you want to delete this file ?") ) );
431 [% INCLUDE 'intranet-bottom.inc' %]