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, {
15 { "bSortable": false, "aTargets": [1, 8] },
16 { "bVisible": false, "aTargets": [0] },
17 { "sType": "title-string", "aTargets" : [ "title-string" ] }
21 $("#show_only_subscription").attr("checked", false);
23 $("#show_only_subscription").click(function(){
24 if ( $(this).attr("checked") ) {
25 resultst.fnFilter( "1", 0, true );
27 resultst.fnFilter( '', 0 );
31 $('#merge').click(function (ev) {
35 if ($('.select-invoice:checked').size() < 2) {
36 alert(_("You must select at least two invoices to merge."));
39 $('.select-invoice:checked').each(function () {
40 var row = $(this).parents('tr');
41 booksellerid = booksellerid || $(row).attr('data-booksellerid');
42 if (booksellerid !== $(row).attr('data-booksellerid')) {
45 invoices.push({ 'invoiceid': $(row).attr('data-invoiceid'),
46 'invoicenumber': $(row).find('td:nth-child(2) a').text(),
47 'shipmentdate': $(row).attr('data-shipmentdate'),
48 'billingdate': $(row).attr('data-billingdate'),
49 'shipmentcost': $(row).attr('data-shipmentcost'),
50 'shipment_budgetid': $(row).attr('data-shipment_budgetid'),
51 'closedate': $(row).attr('data-closedate'), });
52 $('#merge_invoice_form').append('<input type="hidden" name="merge" value="' + $(row).attr('data-invoiceid') + '" />');
55 alert(_("All invoices for merging must be from the same vendor"));
57 $('#merge_table tbody').empty();
58 $.each(invoices, function (idx, invoice) {
59 var row = $('<tr data-invoiceid="' + invoice.invoiceid + '"><td>' + invoice.invoicenumber + '</td><td>' + invoice.shipmentdate + '</td><td>' + invoice.billingdate + '</td><td>' + invoice.shipmentcost + '</td></tr>');
60 $(row).appendTo('#merge_table tbody');
61 $(row).click(function () {
62 $('#merge_table tbody tr').removeClass('active');
63 $(this).addClass('active');
64 $('#merge_invoicenumber').text(invoice.invoicenumber);
65 $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid'], function (idx, prop) {
66 $('#merge_' + prop).val(invoice[prop]);
68 if (invoice.closedate) {
69 $('#merge_status').text(_("Closed on %s").format(invoice.closedate));
71 $('#merge_status').text(_("Open"));
75 $('#merge_table tbody tr:first').click();
76 $('#merge_invoices').show();
85 [% INCLUDE 'header.inc' %]
86 [% INCLUDE 'acquisitions-search.inc' %]
88 <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>
90 <div id="doc3" class="yui-t2">
96 [% IF ( do_search ) %]
98 <label for="show_only_subscription">
99 <input type="checkbox" style="vertical-align: middle;" id="show_only_subscription" />
100 Show only subscriptions
102 <table id="resultst">
109 <th class="title-string">Billing date</th>
110 <th>Received biblios</th>
111 <th>Received items</th>
117 [% FOREACH invoice IN invoices %]
118 <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 %]">
119 <td>[% invoice.is_linked_to_subscriptions %]</td>
120 <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]" /></td>
121 <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
122 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
124 [% IF invoice.billingdate %]
125 <span title="[% invoice.billingdate %]">[% invoice.billingdate | $KohaDates %]</span>
127 <span title="0000-00-00"></span>
130 <td>[% invoice.receivedbiblios %]</td>
131 <td>[% invoice.receiveditems %]</td>
133 [% IF invoice.closedate %]
134 Closed on [% invoice.closedate | $KohaDates %]
141 <div class="dropdown dropup">
142 <a class="btn btn-mini dropdown-toggle" id="invoiceactions[% invoice.invoiceid %]" role="button" data-toggle="dropdown" href="#">
143 Actions <b class="caret"></b>
145 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="invoiceactions[% invoice.invoiceid %]">
146 <li><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]"><i class="icon-search"></i> Details</a></li>
147 [% IF invoice.closedate %]
148 <li><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 %]"><i class="icon-refresh"></i> Reopen</a></li>
150 <li><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 %]"><i class="icon-remove-sign"></i> Close</a></li>
152 [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
153 <li><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 %]"><i class="icon-remove"></i> Delete</a></li>
162 <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
163 <div id="merge_invoices">
164 <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
165 <fieldset class="rows">
167 <li><h2>Merge invoices</h2></li>
168 <li><table id="merge_table">
169 <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
173 <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
174 <li><label for="merge_shipmentdate">Shipment date:</label>
175 <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" readonly="readonly" class="datepicker" /></li>
177 <li><label for="merge_billingdate">Billing date:</label>
178 <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" readonly="readonly" class="datepicker" /></li>
180 <li><label for="merge_shipmentcost">Shipment cost:</label>
181 <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
182 <li><label for="merge_shipment_budgetid">Fund:</label>
183 <select id="merge_shipment_budgetid" name="shipment_budget_id">
184 <option value="">No fund</option>
185 [% FOREACH budget IN budgets_loop %]
186 <option value="[% budget.budget_id %]">[% budget.budget_name %]
191 <li><span class="label">Status:</span> <span id="merge_status"></span></li>
192 <li><input type="submit" value="Merge" /></li>
194 <input type="hidden" name="op" value="mod" />
195 <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
200 <p>Sorry, but there is no results for your search.</p>
203 [% IF ( invoicenumber ) %]
204 <li>Invoice no.: [% invoicenumber %]</li>
206 [% IF booksellerid %]
207 <li>Vendor: [% suppliername %]</li>
209 [% IF ( billingdatefrom ) %]
211 [% IF ( billingdateto ) %]
212 From [% billingdatefrom %]
213 To [% billingdateto %]
215 All since [% billingdatefrom %]
219 [% IF ( billingdateto ) %]
221 All until [% billingdateto %]
225 [% IF ( isbneanissn ) %]
226 <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
229 <li>Title: [% title %]</li>
232 <li>Author: [% author %]</li>
234 [% IF ( publisher ) %]
235 <li>Publisher: [% publisher %]</li>
237 [% IF ( publicationyear ) %]
238 <li>Publication year: [% publicationyear %]</li>
241 <li>Library: [% branchname %]</li>
245 [% END %]<!-- invoices -->
247 <p>Use the search form on the left to find invoices.</p>
248 [% END %]<!-- do_search -->
252 <form action="" method="get">
253 <fieldset class="brief">
254 <h3>Search filters</h3>
257 <label for="invoicenumber">Invoice no:</label>
258 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
261 <label for="supplier">Vendor:</label>
262 <select id="supplier" name="supplierid">
263 <option value="">All</option>
264 [% FOREACH supplier IN suppliers_loop %]
265 [% IF ( supplier.selected ) %]
266 <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
268 <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
274 <fieldset class="brief">
275 <legend>Shipment date</legend>
278 <label for="shipmentdatefrom">From:</label>
279 <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom %]" class="datepicker" />
282 <label for="shipmentdateto">To:</label>
283 <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto %]" class="datepicker" />
289 <fieldset class="brief">
290 <legend>Billing date</legend>
293 <label for="billingdatefrom">From:</label>
294 <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom %]" class="datepicker" />
297 <label for="billingdateto">To:</label>
298 <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto %]" class="datepicker" />
304 <label for="isbneanissn">ISBN / EAN / ISSN:</label>
305 <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
308 <label for="title">Title:</label>
309 <input type="text" id="title" name="title" value="[% title %]" />
312 <label for="author">Author:</label>
313 <input type="text" id="author" name="author" value="[% author %]" />
316 <label for="publisher">Publisher:</label>
317 <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
320 <label for="publicationyear">Publication year:</label>
321 <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
324 <label for="branch">Library:</label>
325 <select id="branch" name="branch">
326 <option value="">All</option>
327 [% FOREACH branch IN branches_loop %]
328 [% IF ( branch.selected ) %]
329 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
331 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
337 <fieldset class="action">
338 <input type="submit" value="Search" />
341 <input type="hidden" name="op" id="op" value="do_search" />
343 [% INCLUDE 'acquisitions-menu.inc' %]
346 [% INCLUDE 'intranet-bottom.inc' %]