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 <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>
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 | html %]</h1>
32 <p>Vendor: <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% suppliername | html %]</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 | html %]" 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 | $Price on_editing => 1 %]" /></li>
52 <label for="shipment_budget_id">Shipping fund: </label>
53 <select id="shipment_budget_id" name="shipment_budget_id">
54 <option value="">No fund</option>
55 [% FOREACH budget IN budgets %]
56 [% IF ( budget.selected ) %]
57 <option value="[% budget.b_id | html %]" selected="selected">[% budget.b_txt | html %] [% IF ( !budget.b_active ) %](inactive)[% END %]</option>
58 [% ELSIF ( budget.b_active ) %]
59 <option value="[% budget.b_id | html %]">[% budget.b_txt | html %]</option>
61 <option value="[% budget.b_id | html %]" class="b_inactive">[% budget.b_txt | html %] (inactive)</option>
65 <label for="showallfunds" style="float:none;width:auto;"> Show inactive:</label>
66 <input type="checkbox" id="showallfunds" />
70 [% IF ( invoiceclosedate ) %]
71 <li><span class="label">Status:</span>
72 Closed on [% invoiceclosedate | $KohaDates %].</li>
74 <li><label for="reopen">Reopen: </label> <input type="checkbox" name="reopen" id="reopen" /></li>
76 <li><span class="label">Status:</span>
79 <li><label for="close">Close: </label> <input type="checkbox" name="close" id="close" />
83 <input type="hidden" name="op" value="mod" />
84 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
85 <fieldset class="action">
86 <input type="submit" value="Save" />
87 [% UNLESS orders_loop.size %]
88 <a href="invoice.pl?op=delete&invoiceid=[% invoiceid | uri %]" id="delete">Delete</a>
98 <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated">
99 <fieldset class="rows">
100 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
101 [% IF (adjustments && adjustments.count > 0) %]
102 <table id="invoice_adj_table">
109 <th>Encumber while invoice open</th>
113 [% FOREACH adjustment IN adjustments %]
114 [% total_adj = total_adj + adjustment.adjustment %]
116 <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id | html %]" />[% adjustment.adjustment_id | html %]</td>
117 <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment | $Price on_editing => 1 %]" /></td>
119 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
121 <select id="reason_[% adjustment.adjustment_id | html %]" name="reason">
122 <option value="">No reason</option>
123 [% FOREACH reason IN reasons %]
124 [% IF ( adjustment.reason == reason.authorised_value ) %]
125 <option selected="selected" value="[% reason.authorised_value | html %]">
127 <option value="[% reason.authorised_value | html %]">
129 [% reason.lib | html %]
134 <p title="Define values in authorised value category ADJ_REASON to enable">None</p>
135 <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id | html %]" value="" />
138 <td><input type="text" name="note" id="note_new" value="[% adjustment.note | html %]"/></td>
140 <select id="budget_id_[% adjustment.adjustment_id | html %]" name="budget_id">
141 <option value="">No fund</option>
142 [% FOREACH budget IN budgets_loop %]
143 [% IF ( budget.budget_id == adjustment.budget_id ) %]
144 <option selected="selected" value="[% budget.budget_id | html %]">
146 <option value="[% budget.budget_id | html %]">
148 [% budget.budget_name | html %]
153 [% IF adjustment.encumber_open %]
155 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment_id | html %]" checked/>
159 <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment_id | html %]" />
163 <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>
171 <a href="#" id="show_invoice_adjustment" class="toggle_invoice_adjustment"><i class="fa fa-plus"></i> Add an adjustment</a>
174 <fieldset id="add_invoice_adjustment" style="display:none">
175 <h4>Add an adjustment</h4>
176 <input type="hidden" name="adjustment_id" value="new" />
179 <label for="adjustment_new">Amount: </label>
180 <input type="text" name="adjustment" id="adjustment_new" />
182 [% reasons = AuthorisedValues.Get("ADJ_REASON") %]
185 <label for="reason_[% adjustment.adjustment_id | html %]">Reason: </label>
186 <select id="reason_[% adjustment.adjustment_id | html %]" name="reason">
187 <option value="">No reason</option>
188 [% FOREACH reason IN reasons %]
189 <option value="[% reason.authorised_value | html %]">
190 [% reason.lib | html %]
197 <span class="label">Reason: </span>
199 <div class="hint">Define values in authorised value category ADJ_REASON to enable</div>
203 <label for="note_new">Note: </label>
204 <input type="text" name="note" id="note_new" value=""/>
207 <label for="budget_id_new">Fund: </label>
208 <select id="budget_id_new" name="budget_id">
209 <option selected="selected" value="">No fund</option>
210 [% FOREACH budget IN budgets_loop %]
211 <option value="[% budget.budget_id | html %]">
212 [% budget.budget_name | html %]
218 <label for="encumber_new">Encumber while invoice open? </label>
219 <input type="checkbox" name="encumber_open" id="encumber_new" value="new" />
220 <input type="hidden" name="delete" value="">
223 <span class="label"> </span>
224 <a href="#" id="cancel_invoice_adjustment" class="toggle_invoice_adjustment" style="display:none"><i class="fa fa-remove"></i> Cancel</a>
228 <fieldset class="action">
229 <input type="hidden" name="op" value="mod_adj" />
230 <input type="submit" value="Update adjustments" />
235 <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">Go to receipt page</a>
236 [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid | uri %]">Manage invoice files</a>[% END %]
238 <h2>Invoice details</h2>
240 [% IF orders_loop.size %]
241 <label for="show_all_details">
242 <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
248 <th class="anti-the">Summary</th>
250 <th class="tax_excluded">Actual cost tax exc.</th>
251 <th class="tax_included">Actual cost tax inc.</th>
252 <th class="replacementprice">Replacement price</th>
254 <th class="tax_excluded">Total tax exc. ([% currency.symbol | html %])</th>
255 <th class="tax_included">Total tax inc. ([% currency.symbol | html %])</th>
262 [% FOREACH order IN orders_loop %]
265 [% IF order.biblionumber %]
266 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
267 [% IF ( order.author ) %]
268 <br /><em>by</em> [% order.author | html %]
271 <em>Deleted bibliographic record, can't find title</em>
273 [% IF ( order.isbn ) %] – [% order.isbn | html %][% END %]
274 [% IF ( order.publishercode ) %]
275 <br/>[% order.publishercode | html %]
276 [% IF order.publicationyear %], [% order.publicationyear | html %]
277 [% ELSIF ( order.copyrightdate ) %][% order.copyrightdate | html %][% END %]
280 <td><p>[% order.branchcode | html %]</p></td>
281 <td class="number tax_excluded">[% order.unitprice_tax_excluded | $Price %]</td>
282 <td class="number tax_included">[% order.unitprice_tax_included | $Price %]</td>
283 <td class="number replacementprice">[% order.replacementprice | $Price %]</td>
284 <td class="number">[% order.quantity | html %]</td>
285 <td class="number tax_excluded">[% order.total_tax_excluded | $Price %]</td>
286 <td class="number tax_included">[% order.total_tax_included | $Price %]</td>
287 <td class="number">[% order.tax_rate * 100 | html %]</td>
288 <td class="number">[% order.tax_value | $Price %]</td>
289 <td>[% order.budget_name | html %]</td>
294 [% FOR tf IN foot_loop %]
296 <th colspan="2">Total (GST [% tf.tax_rate * 100 | html %] %)</th>
297 <th class="tax_excluded"></th>
298 <th class="tax_included"></th>
299 <th class="replacementprice"/>
300 <th>[% tf.quantity | html %]</th>
301 <th class="tax_excluded">[% tf.total_tax_excluded | $Price %]</th>
302 <th class="tax_included">[% tf.total_tax_included | $Price %]</th>
304 <th>[% tf.tax_value | $Price %]</th>
309 <th colspan="2">Total ([% currency.symbol | html %])</th>
310 <th class="tax_excluded"></th>
311 <th class="tax_included"></th>
312 <th class="replacementprice"/>
313 <th>[% total_quantity | html %]</th>
314 <th class="tax_excluded">[% total_tax_excluded | $Price %]</th>
315 <th class="tax_included">[% total_tax_included | $Price %]</th>
317 <th>[% total_tax_value | $Price %]</th>
321 <th colspan="2">Total + Adjustments + Shipment cost ([% currency.symbol | html %])</th>
322 <th class="tax_excluded"></th>
323 <th class="tax_included"></th>
324 <th class="replacementprice"/>
325 <th>[% total_quantity | html %]</th>
326 <th class="tax_excluded">[% total_tax_excluded_shipment + total_adj | $Price %]</th>
327 <th class="tax_included">[% total_tax_included_shipment | $Price %]</th>
329 <th>[% total_tax_value | $Price %]</th>
335 <div class="dialog message"><p>No orders yet</p>
336 [% IF adjustments && adjustments.count > 0 || shipmentcost && shipmentcost > 0 %]
337 <p>Adjustments plus shipping:[% total_adj + shipmentcost | $Price %]</p>
341 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
343 <h2>Files attached to invoice</h2>
344 <table id="invoice_files_table">
354 [% FOREACH f IN files %]
356 <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>
357 <td>[% f.file_type | html %]</td>
358 <td>[% f.file_description | html %]</td>
359 <td class="title-string">
360 <span title="[% f.date_uploaded | html %]">[% f.date_uploaded | $KohaDates %]</span>
369 </div> <!-- /.col-sm-10.col-sm-push-2 -->
372 <div class="col-sm-2 col-sm-pull-10">
373 [% INCLUDE 'acquisitions-menu.inc' %]
376 </div> <!-- /.row -->
378 [% MACRO jsinclude BLOCK %]
379 [% Asset.js("js/acquisitions-menu.js") | $raw %]
380 [% INCLUDE 'calendar.inc' %]
381 [% INCLUDE 'datatables.inc' %]
383 function updateColumnsVisibility(visible) {
385 $("table .tax_excluded, .tax_included").show();
387 [% IF ( invoiceincgst ) %]
388 $("table .tax_excluded").hide();
390 $("table .tax_included").hide();
395 $(document).ready(function() {
396 $("#delete").click(function(){
397 return confirmDelete(_("Are you sure you want to delete this invoice?"));
399 $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
405 { "sType": "anti-the", "aTargets": [ "anti-the" ] }
408 [% IF ( (Koha.Preference('AcqEnableFiles')) && files ) %]
409 $("#invoice_files_table").dataTable($.extend(true, {}, dataTablesDefaults, {
411 { "aTargets": [ "title-string" ], "sType": "title-string" }
419 $("#show_all_details").click(function(){
420 updateColumnsVisibility( $(this).is(":checked") );
423 $("#show_all_details").prop('checked', false);
424 updateColumnsVisibility(false);
425 $(".toggle_invoice_adjustment").on("click", function(e){
427 $("#show_invoice_adjustment, #cancel_invoice_adjustment, #add_invoice_adjustment").toggle();
429 $("a.delete_adjustment").click(function(){
430 return ( confirm( _("Are you sure you want to delete this file ?") ) );
433 //keep a copy of all budgets before removing the inactives
434 var budgetId = $("#shipment_budget_id");
435 var disabledBudgetsCopy = budgetId.html();
436 $('.b_inactive').remove();
438 $('#showallfunds').click(function() {
439 if ($(this).is(":checked")) {
440 budgetId.html(disabledBudgetsCopy); //Puts back all the funds
443 $('.b_inactive').remove();
450 [% INCLUDE 'intranet-bottom.inc' %]