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, {
18 null,null,null,{ "sType": "title-string" },null,null,null,null
21 { "bSortable": false, "aTargets": [0, 7] }
25 $('#merge').click(function (ev) {
29 if ($('.select-invoice:checked').size() < 2) {
30 alert(_("You must select at least two invoices to merge."));
33 $('.select-invoice:checked').each(function () {
34 var row = $(this).parents('tr');
35 booksellerid = booksellerid || $(row).attr('data-booksellerid');
36 if (booksellerid !== $(row).attr('data-booksellerid')) {
39 invoices.push({ 'invoiceid': $(row).attr('data-invoiceid'),
40 'invoicenumber': $(row).find('td:nth-child(2) a').text(),
41 'shipmentdate': $(row).attr('data-shipmentdate'),
42 'billingdate': $(row).attr('data-billingdate'),
43 'shipmentcost': $(row).attr('data-shipmentcost'),
44 'shipment_budgetid': $(row).attr('data-shipment_budgetid'),
45 'closedate': $(row).attr('data-closedate'), });
46 $('#merge_invoice_form').append('<input type="hidden" name="merge" value="' + $(row).attr('data-invoiceid') + '" />');
49 alert(_("All invoices for merging must be from the same vendor"));
51 $('#merge_table tbody').empty();
52 $.each(invoices, function (idx, invoice) {
53 var row = $('<tr data-invoiceid="' + invoice.invoiceid + '"><td>' + invoice.invoicenumber + '</td><td>' + invoice.shipmentdate + '</td><td>' + invoice.billingdate + '</td><td>' + invoice.shipmentcost + '</td></tr>');
54 $(row).appendTo('#merge_table tbody');
55 $(row).click(function () {
56 $('#merge_table tbody tr').removeClass('active');
57 $(this).addClass('active');
58 $('#merge_invoicenumber').text(invoice.invoicenumber);
59 $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid'], function (idx, prop) {
60 $('#merge_' + prop).val(invoice[prop]);
62 if (invoice.closedate) {
63 $('#merge_status').text(_("Closed on " + invoice.closedate + ""));
65 $('#merge_status').text(_("Open"));
69 $('#merge_table tbody tr:first').click();
70 $('#merge_invoices').show();
79 [% INCLUDE 'header.inc' %]
80 [% INCLUDE 'acquisitions-search.inc' %]
82 <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>
84 <div id="doc3" class="yui-t2">
90 [% IF ( do_search ) %]
99 <th>Received biblios</th>
100 <th>Received items</th>
106 [% FOREACH invoice IN invoices %]
107 <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 %]">
108 <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]"></input></td>
109 <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
110 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
112 [% IF invoice.billingdate %]
113 <span title="[% invoice.billingdate %]">[% invoice.billingdate | $KohaDates %]</span>
115 <span title="0000-00-00"></span>
118 <td>[% invoice.receivedbiblios %]</td>
119 <td>[% invoice.receiveditems %]</td>
121 [% IF invoice.closedate %]
122 Closed on [% invoice.closedate | $KohaDates %]
128 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">Details</a> /
129 [% IF invoice.closedate %]
130 <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>
132 <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>
134 [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
135 / <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>
142 <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
143 <div id="merge_invoices">
144 <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
145 <fieldset class="rows">
147 <li><h2>Merge invoices</h2></li>
148 <li><table id="merge_table">
149 <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
153 <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
154 <li><label for="merge_shipmentdate">Shipment date:</label>
155 <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" readonly="readonly" class="datepicker" /></li>
157 <li><label for="merge_billingdate">Billing date:</label>
158 <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" readonly="readonly" class="datepicker" /></li>
160 <li><label for="merge_shipmentcost">Shipment cost:</label>
161 <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
162 <li><label for="merge_shipment_budgetid">Fund:</label>
163 <select id="merge_shipment_budgetid" name="shipment_budget_id">
164 <option value="">No fund</option>
165 [% FOREACH budget IN budgets_loop %]
166 <option value="[% budget.budget_id %]">
167 [% budget.budget_name %]
172 <li><span class="label">Status:</span> <span id="merge_status"></span></li>
173 <li><input type="submit" value="Merge" /></li>
175 <input type="hidden" name="op" value="mod" />
176 <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
181 <p>Sorry, but there is no results for your search.</p>
184 [% IF ( invoicenumber ) %]
185 <li>Invoice no.: [% invoicenumber %]</li>
187 [% IF booksellerid %]
188 <li>Vendor: [% suppliername %]</li>
190 [% IF ( billingdatefrom ) %]
192 [% IF ( billingdateto ) %]
193 From [% billingdatefrom %]
194 To [% billingdateto %]
196 All since [% billingdatefrom %]
200 [% IF ( billingdateto ) %]
202 All until [% billingdateto %]
206 [% IF ( isbneanissn ) %]
207 <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
210 <li>Title: [% title %]</li>
213 <li>Author: [% author %]</li>
215 [% IF ( publisher ) %]
216 <li>Publisher: [% publisher %]</li>
218 [% IF ( publicationyear ) %]
219 <li>Publication year: [% publicationyear %]</li>
222 <li>Library: [% branchname %]</li>
226 [% END %]<!-- invoices -->
228 <p>Use the search form on the left to find invoices.</p>
229 [% END %]<!-- do_search -->
233 <form action="" method="get">
234 <fieldset class="brief">
235 <h3>Search filters</h3>
238 <label for="invoicenumber">Invoice no:</label>
239 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
242 <label for="supplier">Vendor:</label>
243 <select id="supplier" name="supplierid">
244 <option value="">All</option>
245 [% FOREACH supplier IN suppliers_loop %]
246 [% IF ( supplier.selected ) %]
247 <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
249 <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
255 <fieldset class="brief">
256 <legend>Shipment date</legend>
259 <label for="shipmentdatefrom">From:</label>
260 <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom %]" class="datepicker" />
263 <label for="shipmentdateto">To:</label>
264 <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto %]" class="datepicker" />
270 <fieldset class="brief">
271 <legend>Billing date</legend>
274 <label for="billingdatefrom">From:</label>
275 <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom %]" class="datepicker" />
278 <label for="billingdateto">To:</label>
279 <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto %]" class="datepicker" />
285 <label for="isbneanissn">ISBN / EAN / ISSN:</label>
286 <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
289 <label for="title">Title:</label>
290 <input type="text" id="title" name="title" value="[% title %]" />
293 <label for="author">Author:</label>
294 <input type="text" id="author" name="author" value="[% author %]" />
297 <label for="publisher">Publisher:</label>
298 <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
301 <label for="publicationyear">Publication year:</label>
302 <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
305 <label for="branch">Library:</label>
306 <select id="branch" name="branch">
307 <option value="">All</option>
308 [% FOREACH branch IN branches_loop %]
309 [% IF ( branch.selected ) %]
310 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
312 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
318 <fieldset class="action">
319 <input type="submit" value="Search" />
322 <input type="hidden" name="op" id="op" value="do_search" />
324 [% INCLUDE 'acquisitions-menu.inc' %]
327 [% INCLUDE 'intranet-bottom.inc' %]