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 $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
15 null,null,{ "sType": "title-string" },null,null,null,null
18 { "bSortable": false, "aTargets": [0, 7] }
22 $('#merge').click(function (ev) {
26 if ($('.select-invoice:checked').size() < 2) {
27 alert(_("You must select at least two invoices to merge."));
30 $('.select-invoice:checked').each(function () {
31 var row = $(this).parents('tr');
32 booksellerid = booksellerid || $(row).attr('data-booksellerid');
33 if (booksellerid !== $(row).attr('data-booksellerid')) {
36 invoices.push({ 'invoiceid': $(row).attr('data-invoiceid'),
37 'invoicenumber': $(row).find('td:nth-child(2) a').text(),
38 'shipmentdate': $(row).attr('data-shipmentdate'),
39 'billingdate': $(row).attr('data-billingdate'),
40 'shipmentcost': $(row).attr('data-shipmentcost'),
41 'shipment_budgetid': $(row).attr('data-shipment_budgetid'),
42 'closedate': $(row).attr('data-closedate'), });
43 $('#merge_invoice_form').append('<input type="hidden" name="merge" value="' + $(row).attr('data-invoiceid') + '" />');
46 alert(_("All invoices for merging must be from the same vendor"));
48 $('#merge_table tbody').empty();
49 $.each(invoices, function (idx, invoice) {
50 var row = $('<tr data-invoiceid="' + invoice.invoiceid + '"><td>' + invoice.invoicenumber + '</td><td>' + invoice.shipmentdate + '</td><td>' + invoice.billingdate + '</td><td>' + invoice.shipmentcost + '</td></tr>');
51 $(row).appendTo('#merge_table tbody');
52 $(row).click(function () {
53 $('#merge_table tbody tr').removeClass('active');
54 $(this).addClass('active');
55 $('#merge_invoicenumber').text(invoice.invoicenumber);
56 $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid'], function (idx, prop) {
57 $('#merge_' + prop).val(invoice[prop]);
59 if (invoice.closedate) {
60 $('#merge_status').text(_("Closed on " + invoice.closedate + ""));
62 $('#merge_status').text(_("Open"));
66 $('#merge_table tbody tr:first').click();
67 $('#merge_invoices').show();
76 [% INCLUDE 'header.inc' %]
77 [% INCLUDE 'acquisitions-search.inc' %]
79 <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>
81 <div id="doc3" class="yui-t2">
87 [% IF ( do_search ) %]
96 <th>Received biblios</th>
97 <th>Received items</th>
103 [% FOREACH invoice IN invoices %]
104 <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 %]">
105 <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]"></input></td>
106 <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
107 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
109 [% IF invoice.billingdate %]
110 <span title="[% invoice.billingdate %]">[% invoice.billingdate | $KohaDates %]</span>
112 <span title="0000-00-00"></span>
115 <td>[% invoice.receivedbiblios %]</td>
116 <td>[% invoice.receiveditems %]</td>
118 [% IF invoice.closedate %]
119 Closed on [% invoice.closedate | $KohaDates %]
125 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">Details</a> /
126 [% IF invoice.closedate %]
127 <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>
129 <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>
131 [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
132 / <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>
139 <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
140 <div id="merge_invoices">
141 <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
142 <fieldset class="rows">
144 <li><h2>Merge invoices</h2></li>
145 <li><table id="merge_table">
146 <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
150 <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
151 <li><label for="merge_shipmentdate">Shipment date:</label>
152 <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" readonly="readonly" class="datepicker" /></li>
154 <li><label for="merge_billingdate">Billing date:</label>
155 <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" readonly="readonly" class="datepicker" /></li>
157 <li><label for="merge_shipmentcost">Shipment cost:</label>
158 <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
159 <li><label for="merge_shipment_budgetid">Fund:</label>
160 <select id="merge_shipment_budgetid" name="shipment_budget_id">
161 <option value="">No fund</option>
162 [% FOREACH budget IN budgets_loop %]
163 <option value="[% budget.budget_id %]">
164 [% budget.budget_name %]
169 <li><span class="label">Status:</span> <span id="merge_status"></span></li>
170 <li><input type="submit" value="Merge" /></li>
172 <input type="hidden" name="op" value="mod" />
173 <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
178 <p>Sorry, but there is no results for your search.</p>
181 [% IF ( invoicenumber ) %]
182 <li>Invoice no.: [% invoicenumber %]</li>
184 [% IF booksellerid %]
185 <li>Vendor: [% suppliername %]</li>
187 [% IF ( billingdatefrom ) %]
189 [% IF ( billingdateto ) %]
190 From [% billingdatefrom %]
191 To [% billingdateto %]
193 All since [% billingdatefrom %]
197 [% IF ( billingdateto ) %]
199 All until [% billingdateto %]
203 [% IF ( isbneanissn ) %]
204 <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
207 <li>Title: [% title %]</li>
210 <li>Author: [% author %]</li>
212 [% IF ( publisher ) %]
213 <li>Publisher: [% publisher %]</li>
215 [% IF ( publicationyear ) %]
216 <li>Publication year: [% publicationyear %]</li>
219 <li>Library: [% branchname %]</li>
223 [% END %]<!-- invoices -->
225 <p>Use the search form on the left to find invoices.</p>
226 [% END %]<!-- do_search -->
230 <form action="" method="get">
231 <fieldset class="brief">
232 <h3>Search filters</h3>
235 <label for="invoicenumber">Invoice no:</label>
236 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
239 <label for="supplier">Vendor:</label>
240 <select id="supplier" name="supplierid">
241 <option value="">All</option>
242 [% FOREACH supplier IN suppliers_loop %]
243 [% IF ( supplier.selected ) %]
244 <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
246 <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
252 <fieldset class="brief">
253 <legend>Shipment date</legend>
256 <label for="shipmentdatefrom">From:</label>
257 <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom %]" class="datepicker" />
260 <label for="shipmentdateto">To:</label>
261 <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto %]" class="datepicker" />
267 <fieldset class="brief">
268 <legend>Billing date</legend>
271 <label for="billingdatefrom">From:</label>
272 <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom %]" class="datepicker" />
275 <label for="billingdateto">To:</label>
276 <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto %]" class="datepicker" />
282 <label for="isbneanissn">ISBN / EAN / ISSN:</label>
283 <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
286 <label for="title">Title:</label>
287 <input type="text" id="title" name="title" value="[% title %]" />
290 <label for="author">Author:</label>
291 <input type="text" id="author" name="author" value="[% author %]" />
294 <label for="publisher">Publisher:</label>
295 <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
298 <label for="publicationyear">Publication year:</label>
299 <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
302 <label for="branch">Library:</label>
303 <select id="branch" name="branch">
304 <option value="">All</option>
305 [% FOREACH branch IN branches_loop %]
306 [% IF ( branch.selected ) %]
307 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
309 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
315 <fieldset class="action">
316 <input type="submit" value="Search" />
319 <input type="hidden" name="op" id="op" value="do_search" />
321 [% INCLUDE 'acquisitions-menu.inc' %]
324 [% INCLUDE 'intranet-bottom.inc' %]