7 [% USE AuthorisedValues %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha › Acquisitions › Invoice</title>
11 [% INCLUDE 'doc-head-close.inc' %]
14 <body id="acq_invoice" class="acq">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'acquisitions-search.inc' %]
18 [% SET readonly = NOT CAN_user_acquisition_edit_invoices %]
20 <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>
22 <div class="main container-fluid">
24 <div class="col-sm-10 col-sm-push-2">
28 <div class="dialog message">
29 <p>Invoice has been modified</p>
32 <h1>Invoice: [% invoicenumber | html %]</h1>
34 <p>Vendor: <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% suppliername | html %]</a></p>
35 <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
36 <fieldset class="rows">
39 <label for="shipmentdate" class="required">Invoice number:</label>
41 [% invoicenumber | html %]
43 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber | html %]" class="required" required="required"/>
44 <span class="required">Required</span>
48 <li><label for="shipmentdate">Shipment date:</label>
49 <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="datepicker" /></li>
51 <li><label for="billingdate">Billing date:</label>
52 <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" class="datepicker" /></li>
54 <li><label for="shipmentcost">Shipping cost:</label>
55 <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost | $Price on_editing => 1 %]" /></li>
58 <label for="shipment_budget_id">Shipping fund: </label>
59 <select id="shipment_budget_id" name="shipment_budget_id">
60 <option value="">No fund</option>
61 [% FOREACH budget IN budgets %]
62 [% IF ( budget.selected ) %]
63 <option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
64 [% ELSIF ( budget.b_active ) %]
65 <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
67 <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
71 <label for="showallfunds" style="float:none;width:auto;"> Show inactive:</label>
72 <input type="checkbox" id="showallfunds" />
76 [% IF ( invoiceclosedate ) %]
77 <li><span class="label">Status:</span>
78 Closed on [% invoiceclosedate | $KohaDates %]</li>
81 <label for="reopen">Reopen: </label>
82 [% IF CAN_user_acquisition_reopen_closed_invoices %]
83 <input type="checkbox" name="reopen" id="reopen" />
85 <input type="checkbox" name="reopen" id="reopen" readonly="readonly" />
89 <li><span class="label">Status:</span>
92 <li><label for="close">Close: </label> <input type="checkbox" name="close" id="close" />
96 <input type="hidden" name="op" value="mod" />
97 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
98 <fieldset class="action">
99 <input type="submit" value="Save" />
100 [% UNLESS orders_loop.size %]
101 <a href="invoice.pl?op=delete&invoiceid=[% invoiceid | uri %]" id="delete">Delete</a>
111 <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
112 <fieldset class="rows">
113 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
114 [% IF (adjustments && adjustments.count > 0) %]
115 <table id="invoice_adj_table">
122 <th>Encumber while invoice open</th>
126 [% FOREACH adjustment IN adjustments %]
127 [% total_adj = total_adj + adjustment.adjustment %]
129 <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id | html %]" />[% adjustment.adjustment_id | html %]</td>
130 <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment | $Price on_editing => 1 %]" /></td>
132 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
134 <select id="reason_[% adjustment.adjustment_id | html %]" name="reason">
135 <option value="">No reason</option>
136 [% FOREACH reason IN reasons %]
137 [% IF ( adjustment.reason == reason.authorised_value ) %]
138 <option selected="selected" value="[% reason.authorised_value | html %]">
140 <option value="[% reason.authorised_value | html %]">
142 [% reason.lib | html %]
147 <p title="Define values in authorised value category ADJ_REASON to enable">None</p>
148 <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id | html %]" value="" />
151 <td><input type="text" name="note" id="note_new" value="[% adjustment.note | html %]"/></td>
153 <select id="budget_id_[% adjustment.adjustment_id | html %]" name="budget_id">
154 <option value="">No fund</option>
155 [% FOREACH budget IN budgets %]
156 [% IF ( budget.b_id == adjustment.budget_id ) %]
157 <option selected="selected" value="[% budget.b_id | html %]">
159 <option value="[% budget.b_id | html %]">
161 [% budget.b_txt | html %]
166 [% IF adjustment.encumber_open %]
168 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment_id | html %]" checked/>
172 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment_id | html %]" />
176 <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>
184 <a href="#" id="show_invoice_adjustment" class="toggle_invoice_adjustment"><i class="fa fa-plus"></i> Add an adjustment</a>
187 <fieldset id="add_invoice_adjustment" style="display:none">
188 <h4>Add an adjustment</h4>
189 <input type="hidden" name="adjustment_id" value="new" />
192 <label for="adjustment_new">Amount: </label>
193 <input type="text" name="adjustment" id="adjustment_new" />
195 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
198 <label for="reason_[% adjustment.adjustment_id | html %]">Reason: </label>
199 <select id="reason_[% adjustment.adjustment_id | html %]" name="reason">
200 <option value="">No reason</option>
201 [% FOREACH reason IN reasons %]
202 <option value="[% reason.authorised_value | html %]">
203 [% reason.lib | html %]
210 <span class="label">Reason: </span>
212 <div class="hint">Define values in authorised value category ADJ_REASON to enable</div>
216 <label for="note_new">Note: </label>
217 <input type="text" name="note" id="note_new" value=""/>
220 <label for="budget_id_new">Fund: </label>
221 <select id="budget_id_new" name="budget_id">
222 <option selected="selected" value="">No fund</option>
223 [% FOREACH budget IN budgets %]
224 <option value="[% budget.b_id | html %]">
225 [% budget.b_txt | html %]
231 <label for="encumber_new">Encumber while invoice open? </label>
232 <input type="checkbox" name="encumber_open" id="encumber_new" value="new" />
233 <input type="hidden" name="delete" value="">
236 <span class="label"> </span>
237 <a href="#" id="cancel_invoice_adjustment" class="toggle_invoice_adjustment" style="display:none"><i class="fa fa-remove"></i> Cancel</a>
241 <fieldset class="action">
242 <input type="hidden" name="op" value="mod_adj" />
243 <input type="submit" value="Update adjustments" />
248 <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">Go to receipt page</a>
249 [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid | uri %]">Manage invoice files</a>[% END %]
251 <h2>Invoice details</h2>
253 [% IF orders_loop.size %]
254 <label for="show_all_details">
255 <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
261 <th class="anti-the">Summary</th>
263 <th class="tax_excluded">Actual cost tax exc.</th>
264 <th class="tax_included">Actual cost tax inc.</th>
265 <th class="replacementprice">Replacement price</th>
267 <th class="tax_excluded">Total tax exc. ([% currency.symbol | html %])</th>
268 <th class="tax_included">Total tax inc. ([% currency.symbol | html %])</th>
275 [% FOREACH order IN orders_loop %]
278 [% IF order.biblionumber %]
279 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
280 [% IF ( order.author ) %]
281 <br /><em>by</em> [% order.author | html %]
284 <em>Deleted bibliographic record, can't find title</em>
286 [% IF ( order.isbn ) %] – [% order.isbn | html %][% END %]
287 [% IF ( order.publishercode ) %]
288 <br/>[% order.publishercode | html %]
289 [% IF order.publicationyear %], [% order.publicationyear | html %]
290 [% ELSIF ( order.copyrightdate ) %][% order.copyrightdate | html %][% END %]
293 <td><p>[% order.branchcode | html %]</p></td>
294 <td class="number tax_excluded">[% order.unitprice_tax_excluded | $Price %]</td>
295 <td class="number tax_included">[% order.unitprice_tax_included | $Price %]</td>
296 <td class="number replacementprice">[% order.replacementprice | $Price %] [% IF ( order.uncertainprice ) %] (Uncertain) [% END %]</td>
297 <td class="number">[% order.quantity | html %]</td>
298 <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td>
299 <td class="number tax_included">[% order.total_tax_included | $Price %]</td>
300 <td class="number">[% order.tax_rate * 100 | html %]</td>
301 <td class="number">[% order.tax_value | $Price %]</td>
302 <td>[% order.budget_name | html %]</td>
307 [% FOR tf IN foot_loop %]
309 <th colspan="2">Total (GST [% tf.tax_rate * 100 | html %] %)</th>
310 <th class="tax_excluded"></th>
311 <th class="tax_included"></th>
312 <th class="replacementprice"/>
313 <th>[% tf.quantity | html %]</th>
314 <th class="tax_excluded">[% tf.total_tax_excluded | $Price %]</th>
315 <th class="tax_included">[% tf.total_tax_included | $Price %]</th>
317 <th>[% tf.tax_value | $Price %]</th>
322 <th colspan="2">Total ([% currency.symbol | html %])</th>
323 <th class="tax_excluded"></th>
324 <th class="tax_included"></th>
325 <th class="replacementprice"/>
326 <th>[% total_quantity | html %]</th>
327 <th class="tax_excluded">[% total_tax_excluded | $Price %]</th>
328 <th class="tax_included">[% total_tax_included | $Price %]</th>
330 <th>[% total_tax_value | $Price %]</th>
334 <th colspan="2">Total + adjustments + shipment cost ([% currency.symbol | html %])</th>
335 <th class="tax_excluded"></th>
336 <th class="tax_included"></th>
337 <th class="replacementprice"/>
338 <th>[% total_quantity | html %]</th>
339 <th class="tax_excluded">[% total_tax_excluded_shipment + total_adj | $Price %]</th>
340 <th class="tax_included">[% total_tax_included_shipment + total_adj | $Price %]</th>
342 <th>[% total_tax_value | $Price %]</th>
348 <div class="dialog message"><p>No orders yet</p>
349 [% IF adjustments && adjustments.count > 0 || shipmentcost && shipmentcost > 0 %]
350 <p>Adjustments plus shipping: [% total_adj + shipmentcost | $Price %]</p>
354 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
356 <h2>Files attached to invoice</h2>
357 <table id="invoice_files_table">
367 [% FOREACH f IN files %]
369 <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>
370 <td>[% f.file_type | html %]</td>
371 <td>[% f.file_description | html %]</td>
372 <td class="title-string">
373 <span title="[% f.date_uploaded | html %]">[% f.date_uploaded | $KohaDates %]</span>
382 </div> <!-- /.col-sm-10.col-sm-push-2 -->
385 <div class="col-sm-2 col-sm-pull-10">
386 [% INCLUDE 'acquisitions-menu.inc' %]
389 </div> <!-- /.row -->
391 [% MACRO jsinclude BLOCK %]
392 [% Asset.js("js/acquisitions-menu.js") | $raw %]
393 [% INCLUDE 'calendar.inc' %]
394 [% INCLUDE 'datatables.inc' %]
396 function updateColumnsVisibility(visible) {
398 $("table .tax_excluded, .tax_included").show();
400 [% IF ( invoiceincgst ) %]
401 $("table .tax_excluded").hide();
403 $("table .tax_included").hide();
408 $(document).ready(function() {
409 $("#delete").click(function(){
410 return confirmDelete(_("Are you sure you want to delete this invoice?"));
412 $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
418 { "sType": "anti-the", "aTargets": [ "anti-the" ] }
421 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
422 $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, {
424 { "aTargets": [ "title-string" ], "sType": "title-string" }
432 $("#show_all_details").click(function(){
433 updateColumnsVisibility( $(this).is(":checked") );
436 $("#show_all_details").prop('checked', false);
437 updateColumnsVisibility(false);
438 $(".toggle_invoice_adjustment").on("click", function(e){
440 $("#show_invoice_adjustment, #cancel_invoice_adjustment, #add_invoice_adjustment").toggle();
442 $("a.delete_adjustment").click(function(){
443 return ( confirm( _("Are you sure you want to delete this file ?") ) );
446 //keep a copy of all budgets before removing the inactives
447 var budgetId = $("#shipment_budget_id");
448 var disabledBudgetsCopy = budgetId.html();
449 $('.b_inactive').remove();
451 $('#showallfunds').click(function() {
452 if ($(this).is(":checked")) {
453 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
456 $('.b_inactive').remove();
463 [% INCLUDE 'intranet-bottom.inc' %]