4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Acquisitions › Invoices</title>
6 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'datatables.inc' %]
9 [% INCLUDE 'calendar.inc' %]
10 <script type="text/javascript">
12 $(document).ready(function() {
13 var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
16 { "bSortable": false, "aTargets": [1, -1] },
17 { "bVisible": false, "aTargets": [0] },
18 { "sType": "title-string", "aTargets" : [ "title-string" ] }
22 $("#show_only_subscription").prop("checked", false);
24 $("#show_only_subscription").click(function(){
25 if ( $(this).prop("checked") ) {
26 resultst.fnFilter( "1", 0, true );
28 resultst.fnFilter( '', 0 );
32 $('#merge').click(function (ev) {
36 if ($('.select-invoice:checked').size() < 2) {
37 alert(_("You must select at least two invoices to merge."));
40 $('.select-invoice:checked').each(function () {
41 var row = $(this).parents('tr');
42 booksellerid = booksellerid || $(row).attr('data-booksellerid');
43 if (booksellerid !== $(row).attr('data-booksellerid')) {
46 invoices.push({ 'invoiceid': $(row).attr('data-invoiceid'),
47 'invoicenumber': $(row).find('td:nth-child(2) a').text(),
48 'shipmentdate': $(row).attr('data-shipmentdate'),
49 'billingdate': $(row).attr('data-billingdate'),
50 'shipmentcost': $(row).attr('data-shipmentcost'),
51 'shipment_budgetid': $(row).attr('data-shipment_budgetid'),
52 'closedate': $(row).attr('data-closedate'), });
53 $('#merge_invoice_form').append('<input type="hidden" name="merge" value="' + $(row).attr('data-invoiceid') + '" />');
56 alert(_("All invoices for merging must be from the same vendor"));
58 $('#merge_table tbody').empty();
59 $.each(invoices, function (idx, invoice) {
60 var row = $('<tr data-invoiceid="' + invoice.invoiceid + '"><td>' + invoice.invoicenumber + '</td><td>' + invoice.shipmentdate + '</td><td>' + invoice.billingdate + '</td><td>' + invoice.shipmentcost + '</td></tr>');
61 $(row).appendTo('#merge_table tbody');
62 $(row).click(function () {
63 $('#merge_table tbody tr').removeClass('active');
64 $(this).addClass('active');
65 $('#merge_invoicenumber').text(invoice.invoicenumber);
66 $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid'], function (idx, prop) {
67 $('#merge_' + prop).val(invoice[prop]);
69 if (invoice.closedate) {
70 $('#merge_status').text(_("Closed on %s").format(invoice.closedate));
72 $('#merge_status').text(_("Open"));
76 $('#merge_table tbody tr:first').click();
77 $('#merge_invoices').show();
85 <body id="acq_invoices" class="acq">
86 [% INCLUDE 'header.inc' %]
87 [% INCLUDE 'acquisitions-search.inc' %]
89 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › Invoices</div>
91 <div id="doc3" class="yui-t2">
97 [% IF ( do_search ) %]
99 <label for="show_only_subscription">
100 <input type="checkbox" style="vertical-align: middle;" id="show_only_subscription" />
101 Show only subscriptions
103 <table id="resultst">
110 <th class="title-string">Shipment date</th>
111 <th class="title-string">Billing date</th>
112 <th>Received biblios</th>
113 <th>Received items</th>
119 [% FOREACH invoice IN invoices %]
120 <tr data-invoiceid="[% invoice.invoiceid %]" data-booksellerid="[% invoice.booksellerid %]" data-shipmentdate="[% invoice.shipmentdate | $KohaDates %]" data-billingdate="[% invoice.billingdate | $KohaDates %]" data-shipmentcost="[% invoice.shipmentcost %]" data-shipment_budgetid="[% invoice.shipmentcost_budgetid %]" data-closedate="[% invoice.closedate | $KohaDates %]">
121 <td>[% invoice.is_linked_to_subscriptions %]</td>
122 <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]" /></td>
123 <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
124 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
126 [% IF invoice.shipmentdate %]
127 <span title="[% invoice.shipmentdate %]">[% invoice.shipmentdate | $KohaDates %]</span>
129 <span title="0000-00-00"></span>
133 [% IF invoice.billingdate %]
134 <span title="[% invoice.billingdate %]">[% invoice.billingdate | $KohaDates %]</span>
136 <span title="0000-00-00"></span>
139 <td>[% invoice.receivedbiblios %]</td>
140 <td>[% invoice.receiveditems %]</td>
142 [% IF invoice.closedate %]
143 Closed on [% invoice.closedate | $KohaDates %]
150 <div class="dropdown dropup">
151 <a class="btn btn-default btn-xs dropdown-toggle" id="invoiceactions[% invoice.invoiceid %]" role="button" data-toggle="dropdown" href="#">
152 Actions <b class="caret"></b>
154 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="invoiceactions[% invoice.invoiceid %]">
155 <li><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]"><i class="fa fa-search"></i> Details</a></li>
156 [% IF invoice.closedate %]
157 <li><a href="invoice.pl?op=reopen&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="fa fa-refresh"></i> Reopen</a></li>
159 <li><a href="invoice.pl?op=close&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="fa fa-times-circle"></i> Close</a></li>
161 [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
162 <li><a href="invoice.pl?op=delete&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="fa fa-trash"></i> Delete</a></li>
171 <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
172 <div id="merge_invoices">
173 <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
174 <fieldset class="rows">
176 <li><h2>Merge invoices</h2></li>
177 <li><table id="merge_table">
178 <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
182 <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
183 <li><label for="merge_shipmentdate">Shipment date:</label>
184 <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li>
186 <li><label for="merge_billingdate">Billing date:</label>
187 <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" class="datepicker" /></li>
189 <li><label for="merge_shipmentcost">Shipment cost:</label>
190 <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
191 <li><label for="merge_shipment_budgetid">Fund:</label>
192 <select id="merge_shipment_budgetid" name="shipment_budget_id">
193 <option value="">No fund</option>
194 [% FOREACH budget IN budgets_loop %]
195 <option value="[% budget.budget_id %]">[% budget.budget_name %]
200 <li><span class="label">Status:</span> <span id="merge_status"></span></li>
201 <li><input type="submit" value="Merge" /></li>
203 <input type="hidden" name="op" value="mod" />
204 <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
209 <p>Sorry, but there are no results for your search.</p>
212 [% IF ( invoicenumber ) %]
213 <li>Invoice no.: [% invoicenumber %]</li>
215 [% IF booksellerid %]
216 <li>Vendor: [% suppliername %]</li>
218 [% IF shipmentdatefrom %]
220 [% IF shipmentdateto %]
221 From [% shipmentdatefrom | $KohaDates %]
222 To [% shipmentdateto | $KohaDates %]
224 All since [% shipmentdatefrom | $KohaDates %]
228 [% IF shipmentdateto %]
230 All until [% shipmentdateto | $KohaDates %]
234 [% IF billingdatefrom %]
236 [% IF billingdateto %]
237 From [% billingdatefrom | $KohaDates %]
238 To [% billingdateto | $KohaDates %]
240 All since [% billingdatefrom | $KohaDates %]
244 [% IF billingdateto %]
246 All until [% billingdateto | $KohaDates %]
250 [% IF ( isbneanissn ) %]
251 <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
254 <li>Title: [% title %]</li>
257 <li>Author: [% author %]</li>
259 [% IF ( publisher ) %]
260 <li>Publisher: [% publisher %]</li>
262 [% IF ( publicationyear ) %]
263 <li>Publication year: [% publicationyear %]</li>
266 <li>Library: [% Branches.GetName( branch ) %]</li>
270 [% END %]<!-- invoices -->
272 <p>Use the search form on the left to find invoices.</p>
273 [% END %]<!-- do_search -->
277 <form action="" method="get">
278 <fieldset class="brief">
279 <h3>Search filters</h3>
282 <label for="invoicenumber">Invoice no:</label>
283 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
286 <label for="supplier">Vendor:</label>
287 <select id="supplier" name="supplierid">
288 <option value="">All</option>
289 [% FOREACH supplier IN suppliers_loop %]
290 [% IF ( supplier.selected ) %]
291 <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
293 <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
299 <fieldset class="brief">
300 <legend>Shipment date</legend>
303 <label for="shipmentdatefrom">From:</label>
304 <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom | $KohaDates %]" class="datepicker" />
307 <label for="shipmentdateto">To:</label>
308 <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto | $KohaDates %]" class="datepicker" />
314 <fieldset class="brief">
315 <legend>Billing date</legend>
318 <label for="billingdatefrom">From:</label>
319 <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom | $KohaDates %]" class="datepicker" />
322 <label for="billingdateto">To:</label>
323 <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto | $KohaDates %]" class="datepicker" />
329 <label for="isbneanissn">ISBN / EAN / ISSN:</label>
330 <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
333 <label for="title">Title:</label>
334 <input type="text" id="title" name="title" value="[% title %]" />
337 <label for="author">Author:</label>
338 <input type="text" id="author" name="author" value="[% author %]" />
341 <label for="publisher">Publisher:</label>
342 <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
345 <label for="publicationyear">Publication year:</label>
346 <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
349 <label for="branch">Library:</label>
350 <select id="branch" name="branch">
351 <option value="">All</option>
352 [%# FIXME Should not we filter the libraries %]
353 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
357 <fieldset class="action">
358 <input type="submit" value="Search" />
361 <input type="hidden" name="op" id="op" value="do_search" />
363 [% INCLUDE 'acquisitions-menu.inc' %]
366 [% INCLUDE 'intranet-bottom.inc' %]