6 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Acquisitions › Invoice</title>
10 [% Asset.css("css/datatables.css") %]
11 [% INCLUDE 'doc-head-close.inc' %]
14 <body id="acq_invoice" class="acq">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'acquisitions-search.inc' %]
18 <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 %]">[% invoicenumber %]</a></div>
20 <div class="main container-fluid">
22 <div class="col-sm-10 col-sm-push-2">
26 <div class="dialog message">
27 <p>Invoice has been modified</p>
30 <h1>Invoice: [% invoicenumber %]</h1>
32 <p>Vendor: <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% suppliername %]</a></p>
33 <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
34 <fieldset class="rows">
37 <label for="shipmentdate" class="required">Invoice number:</label>
38 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="required" required="required"/>
39 <span class="required">Required</span>
42 <li><label for="shipmentdate">Shipment date:</label>
43 <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="datepicker" /></li>
45 <li><label for="billingdate">Billing date:</label>
46 <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" class="datepicker" /></li>
48 <li><label for="shipmentcost">Shipping cost:</label>
49 <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost %]" /></li>
50 <li><label for="shipment_budget_id">Shipping fund:</label>
51 <select id="shipment_budget_id" name="shipment_budget_id">
52 <option value="">No fund</option>
53 [% FOREACH budget IN budgets_loop %]
54 [% IF ( budget.selected ) %]
55 <option selected="selected" value="[% budget.budget_id %]">
57 <option value="[% budget.budget_id %]">
59 [% budget.budget_name %]
64 [% IF ( invoiceclosedate ) %]
65 <li><span class="label">Status:</span>
66 Closed on [% invoiceclosedate | $KohaDates %].</li>
68 <li><label for="reopen">Reopen: </label> <input type="checkbox" name="reopen" id="reopen" /></li>
70 <li><span class="label">Status:</span>
73 <li><label for="close">Close: </label> <input type="checkbox" name="close" id="close" />
77 <input type="hidden" name="op" value="mod" />
78 <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
79 <fieldset class="action">
80 <input type="submit" value="Save" />
81 [% UNLESS orders_loop.size %]
82 <a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a>
92 <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
93 <fieldset class="rows">
94 <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
95 [% IF (adjustments.count > 0) %]
96 <table id="invoice_adj_table">
103 <th>Encumber while invoice open</th>
107 [% FOREACH adjustment IN adjustments %]
108 [% total_adj = total_adj + adjustment.adjustment %]
110 <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id %]" />[% adjustment.adjustment_id %]</td>
111 <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td>
113 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
115 <select id="reason_[% adjustment.adjustment_id %]" name="reason">
116 <option value="">No reason</option>
117 [% FOREACH reason IN reasons %]
118 [% IF ( adjustment.reason == reason.authorised_value ) %]
119 <option selected="selected" value="[% reason.authorised_value %]">
121 <option value="[% reason.authorised_value %]">
128 <p title="Define values in authorised value category ADJ_REASON to enable">None</p>
129 <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id %]" value="" />
132 <td><input type="text" name="note" id="note_new" value="[% adjustment.note %]"/></td>
134 <select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id">
135 <option value="">No fund</option>
136 [% FOREACH budget IN budgets_loop %]
137 [% IF ( budget.budget_id == adjustment.budget_id ) %]
138 <option selected="selected" value="[% budget.budget_id %]">
140 <option value="[% budget.budget_id %]">
142 [% budget.budget_name %]
147 [% IF adjustment.encumber_open %]
149 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" checked/>
153 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" />
157 <a class="btn btn-default btn-xs delete_adjustment" href="/cgi-bin/koha/acqui/invoice.pl?op=del_adj&adjustment_id=[% adjustment.adjustment_id %]&invoiceid=[% invoiceid %]"><i class="fa fa-trash"></i> Delete</a>
165 <a href="#" id="show_invoice_adjustment" class="toggle_invoice_adjustment"><i class="fa fa-plus"></i> Add an adjustment</a>
168 <fieldset id="add_invoice_adjustment" style="display:none">
169 <h4>Add an adjustment</h4>
170 <input type="hidden" name="adjustment_id" value="new" />
173 <label for="adjustment_new">Amount: </label>
174 <input type="text" name="adjustment" id="adjustment_new" />
176 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
179 <label for="reason_[% adjustment.adjustment_id %]">Reason: </label>
180 <select id="reason_[% adjustment.adjustment_id %]" name="reason">
181 <option value="">No reason</option>
182 [% FOREACH reason IN reasons %]
183 <option value="[% reason.authorised_value %]">
191 <span class="label">Reason: </span>
193 <div class="hint">Define values in authorised value category ADJ_REASON to enable</div>
197 <label for="note_new">Note: </label>
198 <input type="text" name="note" id="note_new" value=""/>
201 <label for="budget_id_new">Fund: </label>
202 <select id="budget_id_new" name="budget_id">
203 <option selected="selected" value="">No fund</option>
204 [% FOREACH budget IN budgets_loop %]
205 <option value="[% budget.budget_id %]">
206 [% budget.budget_name %]
212 <label for="encumber_new">Encumber while invoice open? </label>
213 <input type="checkbox" name="encumber_open" id="encumber_new" value="new" />
214 <input type="hidden" name="delete" value="">
217 <span class="label"> </span>
218 <a href="#" id="cancel_invoice_adjustment" class="toggle_invoice_adjustment" style="display:none"><i class="fa fa-remove"></i> Cancel</a>
222 <fieldset class="action">
223 <input type="hidden" name="op" value="mod_adj" />
224 <input type="submit" value="Update adjustments" />
229 <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a>
230 [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %]
232 <h2>Invoice details</h2>
234 [% IF orders_loop.size %]
235 <label for="show_all_details">
236 <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
242 <th class="anti-the">Summary</th>
244 <th class="tax_excluded">Actual cost tax exc.</th>
245 <th class="tax_included">Actual cost tax inc.</th>
247 <th class="tax_excluded">Total tax exc. ([% currency.symbol %])</th>
248 <th class="tax_included">Total tax inc. ([% currency.symbol %])</th>
255 [% FOREACH order IN orders_loop %]
258 [% IF order.biblionumber %]
259 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a>
260 [% IF ( order.author ) %]
261 <br /><em>by</em> [% order.author %]
264 <em>Deleted bibliographic record, can't find title</em>
266 [% IF ( order.isbn ) %] – [% order.isbn %][% END %]
267 [% IF ( order.publishercode ) %]
268 <br/>[% order.publishercode %]
269 [% IF order.publicationyear %], [% order.publicationyear %]
270 [% ELSIF ( order.copyrightdate ) %][% order.copyrightdate %][% END %]
273 <td><p>[% order.branchcode %]</p></td>
274 <td class="number tax_excluded">[% order.unitprice_tax_excluded | $Price %]</td>
275 <td class="number tax_included">[% order.unitprice_tax_included | $Price %]</td>
276 <td class="number">[% order.quantity %]</td>
277 <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td>
278 <td class="number tax_included">[% order.total_tax_included | $Price %]</td>
279 <td class="number">[% order.tax_rate * 100 %]</td>
280 <td class="number">[% order.tax_value | $Price %]</td>
281 <td>[% order.budget_name %]</td>
286 [% FOR tf IN foot_loop %]
288 <th colspan="2">Total (GST [% tf.tax_rate * 100 %] %)</th>
289 <th class="tax_excluded"></th>
290 <th class="tax_included"></th>
291 <th>[% tf.quantity %]</th>
292 <th class="tax_excluded">[% tf.total_tax_excluded | $Price %]</th>
293 <th class="tax_included">[% tf.total_tax_included | $Price %]</th>
295 <th>[% tf.tax_value | $Price %]</th>
300 <th colspan="2">Total ([% currency.symbol %])</th>
301 <th class="tax_excluded"></th>
302 <th class="tax_included"></th>
303 <th>[% total_quantity %]</th>
304 <th class="tax_excluded">[% total_tax_excluded | $Price %]</th>
305 <th class="tax_included">[% total_tax_included | $Price %]</th>
307 <th>[% total_tax_value | $Price %]</th>
311 <th colspan="2">Total + Adjustments + Shipment cost ([% currency.symbol %])</th>
312 <th class="tax_excluded"></th>
313 <th class="tax_included"></th>
314 <th>[% total_quantity %]</th>
315 <th class="tax_excluded">[% total_tax_excluded_shipment + total_adj | $Price %]</th>
316 <th class="tax_included">[% total_tax_included_shipment | $Price %]</th>
318 <th>[% total_tax_value | $Price %]</th>
324 <div class="dialog message"><p>No orders yet</p>
325 [% IF adjustments && adjustments.count > 0 || shipmentcost && shipmentcost > 0 %]
326 <p>Adjustments plus shipping:[% total_adj + shipmentcost | $Price %]</p>
330 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
332 <h2>Files attached to invoice</h2>
333 <table id="invoice_files_table">
343 [% FOREACH f IN files %]
345 <td><a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]&op=download&view=1&file_id=[% f.file_id %]">[% f.file_name | html %]</a></td>
346 <td>[% f.file_type | html %]</td>
347 <td>[% f.file_description | html %]</td>
348 <td class="title-string">
349 <span title="[% f.date_uploaded %]">[% f.date_uploaded | $KohaDates %]</span>
358 </div> <!-- /.col-sm-10.col-sm-push-2 -->
361 <div class="col-sm-2 col-sm-pull-10">
362 [% INCLUDE 'acquisitions-menu.inc' %]
365 </div> <!-- /.row -->
367 [% MACRO jsinclude BLOCK %]
368 [% Asset.js("js/acquisitions-menu.js") %]
369 [% INCLUDE 'calendar.inc' %]
370 [% INCLUDE 'datatables.inc' %]
372 function updateColumnsVisibility(visible) {
374 $("table .tax_excluded, .tax_included").show();
376 [% IF ( invoiceincgst ) %]
377 $("table .tax_excluded").hide();
379 $("table .tax_included").hide();
384 $(document).ready(function() {
385 $("#delete").click(function(){
386 return confirmDelete(_("Are you sure you want to delete this invoice?"));
388 $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
394 { "sType": "anti-the", "aTargets": [ "anti-the" ] }
397 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
398 $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, {
400 { "aTargets": [ "title-string" ], "sType": "title-string" }
408 $("#show_all_details").click(function(){
409 updateColumnsVisibility( $(this).is(":checked") );
412 $("#show_all_details").prop('checked', false);
413 updateColumnsVisibility(false);
414 $(".toggle_invoice_adjustment").on("click", function(e){
416 $("#show_invoice_adjustment, #cancel_invoice_adjustment, #add_invoice_adjustment").toggle();
418 $("a.delete_adjustment").click(function(){
419 return ( confirm( _("Are you sure you want to delete this file ?") ) );
425 [% INCLUDE 'intranet-bottom.inc' %]