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">
40 <label for="shipmentdate">Invoice number:</label>
41 [% invoicenumber | html %]
43 <label for="shipmentdate" class="required">Invoice number:</label>
44 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber | html %]" class="required" required="required"/>
45 <span class="required">Required</span>
50 <label for="shipmentdate">Shipment date:</label>
52 [% shipmentdate | $KohaDates %]
54 <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" class="datepicker" />
59 <label for="billingdate">Billing date:</label>
61 [% billingdate | $KohaDates %]
63 <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" class="datepicker" />
68 <label for="shipmentcost">Shipping cost:</label>
70 [% shipmentcost | $Price %]
72 <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost | $Price on_editing => 1 %]" />
76 <label for="shipment_budget_id">Shipping fund: </label>
78 [% budget.budget_name | html %]
80 <select id="shipment_budget_id" name="shipment_budget_id">
81 <option value="">No fund</option>
82 [% FOREACH budget IN budgets %]
83 [% IF ( budget.selected ) %]
84 <option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
85 [% ELSIF ( budget.b_active ) %]
86 <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
88 <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
92 <label for="showallfunds" style="float:none;width:auto;"> Show inactive:</label>
93 <input type="checkbox" id="showallfunds" />
97 [% IF ( invoiceclosedate ) %]
98 <li><span class="label">Status:</span>
99 Closed on [% invoiceclosedate | $KohaDates %]</li>
102 <label for="reopen">Reopen: </label>
103 [% IF CAN_user_acquisition_reopen_closed_invoices AND NOT readonly %]
104 <input type="checkbox" name="reopen" id="reopen" />
106 <input type="checkbox" name="reopen" id="reopen" readonly="disabled" />
110 <li><span class="label">Status:</span>
113 <li><label for="close">Close: </label> <input type="checkbox" name="close" id="close" />
117 [% UNLESS readonly %]
118 <input type="hidden" name="op" value="mod" />
119 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
120 <fieldset class="action">
121 <input type="submit" value="Save" />
122 [% UNLESS orders_loop.size %]
123 <a href="invoice.pl?op=delete&invoiceid=[% invoiceid | uri %]" id="delete">Delete</a>
134 <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
135 <fieldset class="rows">
136 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
137 [% IF (adjustments && adjustments.count > 0) %]
138 <table id="invoice_adj_table">
145 <th>Encumber while invoice open</th>
146 [% UNLESS readonly %]<th> </th>[% END %]
149 [% FOREACH adjustment IN adjustments %]
150 [% total_adj = total_adj + adjustment.adjustment %]
152 <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id | html %]" />[% adjustment.adjustment_id | html %]</td>
155 [% adjustment.adjustment | $Price %]
157 <input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment | $Price on_editing => 1 %]" />
162 [% AuthorisedValues.GetByCode('ADJ_REASON', adjustment.reason) | html %]
164 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
166 <select id="reason_[% adjustment.adjustment_id | html %]" name="reason">
167 <option value="">No reason</option>
168 [% FOREACH reason IN reasons %]
169 [% IF ( adjustment.reason == reason.authorised_value ) %]
170 <option selected="selected" value="[% reason.authorised_value | html %]">
172 <option value="[% reason.authorised_value | html %]">
174 [% reason.lib | html %]
179 <p title="Define values in authorised value category ADJ_REASON to enable">None</p>
180 <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id | html %]" value="" />
186 [% adjustment.note | html %]
188 <input type="text" name="note" id="note_new" value="[% adjustment.note | html %]"/>
193 [% adjustement.fund.budget_name | html %]
195 <select id="budget_id_[% adjustment.adjustment_id | html %]" name="budget_id">
196 <option value="">No fund</option>
197 [% FOREACH budget IN budgets %]
198 [% IF ( budget.b_id == adjustment.budget_id ) %]
199 <option selected="selected" value="[% budget.b_id | html %]">
201 <option value="[% budget.b_id | html %]">
203 [% budget.b_txt | html %]
209 [% IF adjustment.encumber_open %]
212 <input type="checkbox" checked="checked" readonly="readonly" />
214 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment_id | html %]" checked/>
220 <input type="checkbox" disabled="disabled" />
222 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment_id | html %]" />
226 [% UNLESS readonly %]
228 <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>
236 [% UNLESS readonly %]
238 <a href="#" id="show_invoice_adjustment" class="toggle_invoice_adjustment"><i class="fa fa-plus"></i> Add an adjustment</a>
241 <fieldset id="add_invoice_adjustment" style="display:none">
242 <h4>Add an adjustment</h4>
243 <input type="hidden" name="adjustment_id" value="new" />
246 <label for="adjustment_new">Amount: </label>
247 <input type="text" name="adjustment" id="adjustment_new" />
249 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
252 <label for="reason_[% adjustment.adjustment_id | html %]">Reason: </label>
253 <select id="reason_[% adjustment.adjustment_id | html %]" name="reason">
254 <option value="">No reason</option>
255 [% FOREACH reason IN reasons %]
256 <option value="[% reason.authorised_value | html %]">
257 [% reason.lib | html %]
264 <span class="label">Reason: </span>
266 <div class="hint">Define values in authorised value category ADJ_REASON to enable</div>
270 <label for="note_new">Note: </label>
271 <input type="text" name="note" id="note_new" value=""/>
274 <label for="budget_id_new">Fund: </label>
275 <select id="budget_id_new" name="budget_id">
276 <option selected="selected" value="">No fund</option>
277 [% FOREACH budget IN budgets %]
278 <option value="[% budget.b_id | html %]">
279 [% budget.b_txt | html %]
285 <label for="encumber_new">Encumber while invoice open? </label>
286 <input type="checkbox" name="encumber_open" id="encumber_new" value="new" />
287 <input type="hidden" name="delete" value="">
290 <span class="label"> </span>
291 <a href="#" id="cancel_invoice_adjustment" class="toggle_invoice_adjustment" style="display:none"><i class="fa fa-remove"></i> Cancel</a>
295 <fieldset class="action">
296 <input type="hidden" name="op" value="mod_adj" />
297 <input type="submit" value="Update adjustments" />
303 <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">Go to receipt page</a>
304 [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid | uri %]">Manage invoice files</a>[% END %]
306 <h2>Invoice details</h2>
308 [% IF orders_loop.size %]
309 <label for="show_all_details">
310 <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
316 <th class="anti-the">Summary</th>
318 <th class="tax_excluded">Actual cost tax exc.</th>
319 <th class="tax_included">Actual cost tax inc.</th>
320 <th class="replacementprice">Replacement price</th>
322 <th class="tax_excluded">Total tax exc. ([% currency.symbol | html %])</th>
323 <th class="tax_included">Total tax inc. ([% currency.symbol | html %])</th>
330 [% FOREACH order IN orders_loop %]
333 [% IF order.biblionumber %]
334 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
335 [% IF ( order.author ) %]
336 <br /><em>by</em> [% order.author | html %]
339 <em>Deleted bibliographic record, can't find title</em>
341 [% IF ( order.isbn ) %] – [% order.isbn | html %][% END %]
342 [% IF ( order.publishercode ) %]
343 <br/>[% order.publishercode | html %]
344 [% IF order.publicationyear %], [% order.publicationyear | html %]
345 [% ELSIF ( order.copyrightdate ) %][% order.copyrightdate | html %][% END %]
348 <td><p>[% order.branchcode | html %]</p></td>
349 <td class="number tax_excluded">[% order.unitprice_tax_excluded | $Price %]</td>
350 <td class="number tax_included">[% order.unitprice_tax_included | $Price %]</td>
351 <td class="number replacementprice">[% order.replacementprice | $Price %] [% IF ( order.uncertainprice ) %] (Uncertain) [% END %]</td>
352 <td class="number">[% order.quantity | html %]</td>
353 <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td>
354 <td class="number tax_included">[% order.total_tax_included | $Price %]</td>
355 <td class="number">[% order.tax_rate * 100 | html %]</td>
356 <td class="number">[% order.tax_value | $Price %]</td>
357 <td>[% order.budget_name | html %]</td>
362 [% FOR tf IN foot_loop %]
364 <th colspan="2">Total (GST [% tf.tax_rate * 100 | html %] %)</th>
365 <th class="tax_excluded"></th>
366 <th class="tax_included"></th>
367 <th class="replacementprice"/>
368 <th>[% tf.quantity | html %]</th>
369 <th class="tax_excluded">[% tf.total_tax_excluded | $Price %]</th>
370 <th class="tax_included">[% tf.total_tax_included | $Price %]</th>
372 <th>[% tf.tax_value | $Price %]</th>
377 <th colspan="2">Total ([% currency.symbol | html %])</th>
378 <th class="tax_excluded"></th>
379 <th class="tax_included"></th>
380 <th class="replacementprice"/>
381 <th>[% total_quantity | html %]</th>
382 <th class="tax_excluded">[% total_tax_excluded | $Price %]</th>
383 <th class="tax_included">[% total_tax_included | $Price %]</th>
385 <th>[% total_tax_value | $Price %]</th>
389 <th colspan="2">Total + adjustments + shipment cost ([% currency.symbol | html %])</th>
390 <th class="tax_excluded"></th>
391 <th class="tax_included"></th>
392 <th class="replacementprice"/>
393 <th>[% total_quantity | html %]</th>
394 <th class="tax_excluded">[% total_tax_excluded_shipment + total_adj | $Price %]</th>
395 <th class="tax_included">[% total_tax_included_shipment + total_adj | $Price %]</th>
397 <th>[% total_tax_value | $Price %]</th>
403 <div class="dialog message"><p>No orders yet</p>
404 [% IF adjustments && adjustments.count > 0 || shipmentcost && shipmentcost > 0 %]
405 <p>Adjustments plus shipping: [% total_adj + shipmentcost | $Price %]</p>
409 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
411 <h2>Files attached to invoice</h2>
412 <table id="invoice_files_table">
422 [% FOREACH f IN files %]
424 <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>
425 <td>[% f.file_type | html %]</td>
426 <td>[% f.file_description | html %]</td>
427 <td class="title-string">
428 <span title="[% f.date_uploaded | html %]">[% f.date_uploaded | $KohaDates %]</span>
437 </div> <!-- /.col-sm-10.col-sm-push-2 -->
440 <div class="col-sm-2 col-sm-pull-10">
441 [% INCLUDE 'acquisitions-menu.inc' %]
444 </div> <!-- /.row -->
446 [% MACRO jsinclude BLOCK %]
447 [% Asset.js("js/acquisitions-menu.js") | $raw %]
448 [% INCLUDE 'calendar.inc' %]
449 [% INCLUDE 'datatables.inc' %]
451 function updateColumnsVisibility(visible) {
453 $("table .tax_excluded, .tax_included").show();
455 [% IF ( invoiceincgst ) %]
456 $("table .tax_excluded").hide();
458 $("table .tax_included").hide();
463 $(document).ready(function() {
464 $("#delete").click(function(){
465 return confirmDelete(_("Are you sure you want to delete this invoice?"));
467 $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
473 { "sType": "anti-the", "aTargets": [ "anti-the" ] }
476 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
477 $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, {
479 { "aTargets": [ "title-string" ], "sType": "title-string" }
487 $("#show_all_details").click(function(){
488 updateColumnsVisibility( $(this).is(":checked") );
491 $("#show_all_details").prop('checked', false);
492 updateColumnsVisibility(false);
493 $(".toggle_invoice_adjustment").on("click", function(e){
495 $("#show_invoice_adjustment, #cancel_invoice_adjustment, #add_invoice_adjustment").toggle();
497 $("a.delete_adjustment").click(function(){
498 return ( confirm( _("Are you sure you want to delete this file ?") ) );
501 //keep a copy of all budgets before removing the inactives
502 var budgetId = $("#shipment_budget_id");
503 var disabledBudgetsCopy = budgetId.html();
504 $('.b_inactive').remove();
506 $('#showallfunds').click(function() {
507 if ($(this).is(":checked")) {
508 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
511 $('.b_inactive').remove();
518 [% INCLUDE 'intranet-bottom.inc' %]