3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Acquisitions › Invoices</title>
5 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'datatables.inc' %]
8 [% INCLUDE 'calendar.inc' %]
9 <script type="text/javascript">
11 $(document).ready(function() {
12 var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
17 null,null,null,{ "sType": "title-string" },null,null,null,null
20 { "bSortable": false, "aTargets": [1, 8] },
21 { "bVisible": false, "aTargets": [0] }
25 $("#show_only_subscription").attr("checked", false);
27 $("#show_only_subscription").click(function(){
28 if ( $(this).attr("checked") ) {
29 resultst.fnFilter( "1", 0, true );
31 resultst.fnFilter( '', 0 );
35 $('#merge').click(function (ev) {
39 if ($('.select-invoice:checked').size() < 2) {
40 alert(_("You must select at least two invoices to merge."));
43 $('.select-invoice:checked').each(function () {
44 var row = $(this).parents('tr');
45 booksellerid = booksellerid || $(row).attr('data-booksellerid');
46 if (booksellerid !== $(row).attr('data-booksellerid')) {
49 invoices.push({ 'invoiceid': $(row).attr('data-invoiceid'),
50 'invoicenumber': $(row).find('td:nth-child(2) a').text(),
51 'shipmentdate': $(row).attr('data-shipmentdate'),
52 'billingdate': $(row).attr('data-billingdate'),
53 'shipmentcost': $(row).attr('data-shipmentcost'),
54 'shipment_budgetid': $(row).attr('data-shipment_budgetid'),
55 'closedate': $(row).attr('data-closedate'), });
56 $('#merge_invoice_form').append('<input type="hidden" name="merge" value="' + $(row).attr('data-invoiceid') + '" />');
59 alert(_("All invoices for merging must be from the same vendor"));
61 $('#merge_table tbody').empty();
62 $.each(invoices, function (idx, invoice) {
63 var row = $('<tr data-invoiceid="' + invoice.invoiceid + '"><td>' + invoice.invoicenumber + '</td><td>' + invoice.shipmentdate + '</td><td>' + invoice.billingdate + '</td><td>' + invoice.shipmentcost + '</td></tr>');
64 $(row).appendTo('#merge_table tbody');
65 $(row).click(function () {
66 $('#merge_table tbody tr').removeClass('active');
67 $(this).addClass('active');
68 $('#merge_invoicenumber').text(invoice.invoicenumber);
69 $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid'], function (idx, prop) {
70 $('#merge_' + prop).val(invoice[prop]);
72 if (invoice.closedate) {
73 $('#merge_status').text(_("Closed on %s").format(invoice.closedate));
75 $('#merge_status').text(_("Open"));
79 $('#merge_table tbody tr:first').click();
80 $('#merge_invoices').show();
89 [% INCLUDE 'header.inc' %]
90 [% INCLUDE 'acquisitions-search.inc' %]
92 <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>
94 <div id="doc3" class="yui-t2">
100 [% IF ( do_search ) %]
102 <label for="show_only_subscription">
103 <input type="checkbox" style="vertical-align: middle;" id="show_only_subscription" />
104 Show only subscriptions
106 <table id="resultst">
113 <th>Billing date</th>
114 <th>Received biblios</th>
115 <th>Received items</th>
121 [% FOREACH invoice IN invoices %]
122 <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 %]">
123 <td>[% invoice.is_linked_to_subscriptions %]</td>
124 <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]"></input></td>
125 <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
126 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
128 [% IF invoice.billingdate %]
129 <span title="[% invoice.billingdate %]">[% invoice.billingdate | $KohaDates %]</span>
131 <span title="0000-00-00"></span>
134 <td>[% invoice.receivedbiblios %]</td>
135 <td>[% invoice.receiveditems %]</td>
137 [% IF invoice.closedate %]
138 Closed on [% invoice.closedate | $KohaDates %]
144 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">Details</a> /
145 [% IF invoice.closedate %]
146 <a href="invoice.pl?op=reopen&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Reopen</a>
148 <a href="invoice.pl?op=close&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Close</a>
150 [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
151 / <a href="invoice.pl?op=delete&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Delete</a>
158 <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
159 <div id="merge_invoices">
160 <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
161 <fieldset class="rows">
163 <li><h2>Merge invoices</h2></li>
164 <li><table id="merge_table">
165 <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
169 <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
170 <li><label for="merge_shipmentdate">Shipment date:</label>
171 <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" readonly="readonly" class="datepicker" /></li>
173 <li><label for="merge_billingdate">Billing date:</label>
174 <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" readonly="readonly" class="datepicker" /></li>
176 <li><label for="merge_shipmentcost">Shipment cost:</label>
177 <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
178 <li><label for="merge_shipment_budgetid">Fund:</label>
179 <select id="merge_shipment_budgetid" name="shipment_budget_id">
180 <option value="">No fund</option>
181 [% FOREACH budget IN budgets_loop %]
182 <option value="[% budget.budget_id %]">
183 [% budget.budget_name %]
188 <li><span class="label">Status:</span> <span id="merge_status"></span></li>
189 <li><input type="submit" value="Merge" /></li>
191 <input type="hidden" name="op" value="mod" />
192 <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
197 <p>Sorry, but there is no results for your search.</p>
200 [% IF ( invoicenumber ) %]
201 <li>Invoice no.: [% invoicenumber %]</li>
203 [% IF booksellerid %]
204 <li>Vendor: [% suppliername %]</li>
206 [% IF ( billingdatefrom ) %]
208 [% IF ( billingdateto ) %]
209 From [% billingdatefrom %]
210 To [% billingdateto %]
212 All since [% billingdatefrom %]
216 [% IF ( billingdateto ) %]
218 All until [% billingdateto %]
222 [% IF ( isbneanissn ) %]
223 <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
226 <li>Title: [% title %]</li>
229 <li>Author: [% author %]</li>
231 [% IF ( publisher ) %]
232 <li>Publisher: [% publisher %]</li>
234 [% IF ( publicationyear ) %]
235 <li>Publication year: [% publicationyear %]</li>
238 <li>Library: [% branchname %]</li>
242 [% END %]<!-- invoices -->
244 <p>Use the search form on the left to find invoices.</p>
245 [% END %]<!-- do_search -->
249 <form action="" method="get">
250 <fieldset class="brief">
251 <h3>Search filters</h3>
254 <label for="invoicenumber">Invoice no:</label>
255 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
258 <label for="supplier">Vendor:</label>
259 <select id="supplier" name="supplierid">
260 <option value="">All</option>
261 [% FOREACH supplier IN suppliers_loop %]
262 [% IF ( supplier.selected ) %]
263 <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
265 <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
271 <fieldset class="brief">
272 <legend>Shipment date</legend>
275 <label for="shipmentdatefrom">From:</label>
276 <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom %]" class="datepicker" />
279 <label for="shipmentdateto">To:</label>
280 <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto %]" class="datepicker" />
286 <fieldset class="brief">
287 <legend>Billing date</legend>
290 <label for="billingdatefrom">From:</label>
291 <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom %]" class="datepicker" />
294 <label for="billingdateto">To:</label>
295 <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto %]" class="datepicker" />
301 <label for="isbneanissn">ISBN / EAN / ISSN:</label>
302 <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
305 <label for="title">Title:</label>
306 <input type="text" id="title" name="title" value="[% title %]" />
309 <label for="author">Author:</label>
310 <input type="text" id="author" name="author" value="[% author %]" />
313 <label for="publisher">Publisher:</label>
314 <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
317 <label for="publicationyear">Publication year:</label>
318 <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
321 <label for="branch">Library:</label>
322 <select id="branch" name="branch">
323 <option value="">All</option>
324 [% FOREACH branch IN branches_loop %]
325 [% IF ( branch.selected ) %]
326 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
328 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
334 <fieldset class="action">
335 <input type="submit" value="Search" />
338 <input type="hidden" name="op" id="op" value="do_search" />
340 [% INCLUDE 'acquisitions-menu.inc' %]
343 [% INCLUDE 'intranet-bottom.inc' %]