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, {
18 null,null,null,{ "sType": "title-string" },null,null,null,null
21 { "bSortable": false, "aTargets": [1, 8] },
22 { "bVisible": false, "aTargets": [0] }
26 $("#show_only_subscription").attr("checked", false);
28 $("#show_only_subscription").click(function(){
29 if ( $(this).attr("checked") ) {
30 resultst.fnFilter( "[0-9]+", 0, true );
32 resultst.fnFilter( '', 0 );
36 $('#merge').click(function (ev) {
40 if ($('.select-invoice:checked').size() < 2) {
41 alert(_("You must select at least two invoices to merge."));
44 $('.select-invoice:checked').each(function () {
45 var row = $(this).parents('tr');
46 booksellerid = booksellerid || $(row).attr('data-booksellerid');
47 if (booksellerid !== $(row).attr('data-booksellerid')) {
50 invoices.push({ 'invoiceid': $(row).attr('data-invoiceid'),
51 'invoicenumber': $(row).find('td:nth-child(2) a').text(),
52 'shipmentdate': $(row).attr('data-shipmentdate'),
53 'billingdate': $(row).attr('data-billingdate'),
54 'shipmentcost': $(row).attr('data-shipmentcost'),
55 'shipment_budgetid': $(row).attr('data-shipment_budgetid'),
56 'closedate': $(row).attr('data-closedate'), });
57 $('#merge_invoice_form').append('<input type="hidden" name="merge" value="' + $(row).attr('data-invoiceid') + '" />');
60 alert(_("All invoices for merging must be from the same vendor"));
62 $('#merge_table tbody').empty();
63 $.each(invoices, function (idx, invoice) {
64 var row = $('<tr data-invoiceid="' + invoice.invoiceid + '"><td>' + invoice.invoicenumber + '</td><td>' + invoice.shipmentdate + '</td><td>' + invoice.billingdate + '</td><td>' + invoice.shipmentcost + '</td></tr>');
65 $(row).appendTo('#merge_table tbody');
66 $(row).click(function () {
67 $('#merge_table tbody tr').removeClass('active');
68 $(this).addClass('active');
69 $('#merge_invoicenumber').text(invoice.invoicenumber);
70 $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid'], function (idx, prop) {
71 $('#merge_' + prop).val(invoice[prop]);
73 if (invoice.closedate) {
74 $('#merge_status').text(_("Closed on " + invoice.closedate + ""));
76 $('#merge_status').text(_("Open"));
80 $('#merge_table tbody tr:first').click();
81 $('#merge_invoices').show();
90 [% INCLUDE 'header.inc' %]
91 [% INCLUDE 'acquisitions-search.inc' %]
93 <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>
95 <div id="doc3" class="yui-t2">
101 [% IF ( do_search ) %]
103 <label for="show_only_subscription">
104 <input type="checkbox" style="vertical-align: middle;" id="show_only_subscription" />
105 Show only subscriptions
107 <table id="resultst">
114 <th>Billing date</th>
115 <th>Received biblios</th>
116 <th>Received items</th>
122 [% FOREACH invoice IN invoices %]
123 <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 %]">
124 <td>[% invoice.subscriptionid %]</td>
125 <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]"></input></td>
126 <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
127 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
129 [% IF invoice.billingdate %]
130 <span title="[% invoice.billingdate %]">[% invoice.billingdate | $KohaDates %]</span>
132 <span title="0000-00-00"></span>
135 <td>[% invoice.receivedbiblios %]</td>
136 <td>[% invoice.receiveditems %]</td>
138 [% IF invoice.closedate %]
139 Closed on [% invoice.closedate | $KohaDates %]
145 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">Details</a> /
146 [% IF invoice.closedate %]
147 <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>
149 <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>
151 [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
152 / <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>
159 <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
160 <div id="merge_invoices">
161 <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
162 <fieldset class="rows">
164 <li><h2>Merge invoices</h2></li>
165 <li><table id="merge_table">
166 <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
170 <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
171 <li><label for="merge_shipmentdate">Shipment date:</label>
172 <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" readonly="readonly" class="datepicker" /></li>
174 <li><label for="merge_billingdate">Billing date:</label>
175 <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" readonly="readonly" class="datepicker" /></li>
177 <li><label for="merge_shipmentcost">Shipment cost:</label>
178 <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
179 <li><label for="merge_shipment_budgetid">Fund:</label>
180 <select id="merge_shipment_budgetid" name="shipment_budget_id">
181 <option value="">No fund</option>
182 [% FOREACH budget IN budgets_loop %]
183 <option value="[% budget.budget_id %]">
184 [% budget.budget_name %]
189 <li><span class="label">Status:</span> <span id="merge_status"></span></li>
190 <li><input type="submit" value="Merge" /></li>
192 <input type="hidden" name="op" value="mod" />
193 <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
198 <p>Sorry, but there is no results for your search.</p>
201 [% IF ( invoicenumber ) %]
202 <li>Invoice no.: [% invoicenumber %]</li>
204 [% IF booksellerid %]
205 <li>Vendor: [% suppliername %]</li>
207 [% IF ( billingdatefrom ) %]
209 [% IF ( billingdateto ) %]
210 From [% billingdatefrom %]
211 To [% billingdateto %]
213 All since [% billingdatefrom %]
217 [% IF ( billingdateto ) %]
219 All until [% billingdateto %]
223 [% IF ( isbneanissn ) %]
224 <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
227 <li>Title: [% title %]</li>
230 <li>Author: [% author %]</li>
232 [% IF ( publisher ) %]
233 <li>Publisher: [% publisher %]</li>
235 [% IF ( publicationyear ) %]
236 <li>Publication year: [% publicationyear %]</li>
239 <li>Library: [% branchname %]</li>
243 [% END %]<!-- invoices -->
245 <p>Use the search form on the left to find invoices.</p>
246 [% END %]<!-- do_search -->
250 <form action="" method="get">
251 <fieldset class="brief">
252 <h3>Search filters</h3>
255 <label for="invoicenumber">Invoice no:</label>
256 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
259 <label for="supplier">Vendor:</label>
260 <select id="supplier" name="supplierid">
261 <option value="">All</option>
262 [% FOREACH supplier IN suppliers_loop %]
263 [% IF ( supplier.selected ) %]
264 <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
266 <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
272 <fieldset class="brief">
273 <legend>Shipment date</legend>
276 <label for="shipmentdatefrom">From:</label>
277 <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom %]" class="datepicker" />
280 <label for="shipmentdateto">To:</label>
281 <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto %]" class="datepicker" />
287 <fieldset class="brief">
288 <legend>Billing date</legend>
291 <label for="billingdatefrom">From:</label>
292 <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom %]" class="datepicker" />
295 <label for="billingdateto">To:</label>
296 <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto %]" class="datepicker" />
302 <label for="isbneanissn">ISBN / EAN / ISSN:</label>
303 <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
306 <label for="title">Title:</label>
307 <input type="text" id="title" name="title" value="[% title %]" />
310 <label for="author">Author:</label>
311 <input type="text" id="author" name="author" value="[% author %]" />
314 <label for="publisher">Publisher:</label>
315 <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
318 <label for="publicationyear">Publication year:</label>
319 <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
322 <label for="branch">Library:</label>
323 <select id="branch" name="branch">
324 <option value="">All</option>
325 [% FOREACH branch IN branches_loop %]
326 [% IF ( branch.selected ) %]
327 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
329 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
335 <fieldset class="action">
336 <input type="submit" value="Search" />
339 <input type="hidden" name="op" id="op" value="do_search" />
341 [% INCLUDE 'acquisitions-menu.inc' %]
344 [% INCLUDE 'intranet-bottom.inc' %]