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, -1] },
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();
84 <body id="acq_invoices" class="acq">
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">Shipment date</th>
110 <th class="title-string">Billing date</th>
111 <th>Received biblios</th>
112 <th>Received items</th>
118 [% FOREACH invoice IN invoices %]
119 <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 %]">
120 <td>[% invoice.is_linked_to_subscriptions %]</td>
121 <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]" /></td>
122 <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
123 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
125 [% IF invoice.shipmentdate %]
126 <span title="[% invoice.shipmentdate %]">[% invoice.shipmentdate | $KohaDates %]</span>
128 <span title="0000-00-00"></span>
132 [% IF invoice.billingdate %]
133 <span title="[% invoice.billingdate %]">[% invoice.billingdate | $KohaDates %]</span>
135 <span title="0000-00-00"></span>
138 <td>[% invoice.receivedbiblios %]</td>
139 <td>[% invoice.receiveditems %]</td>
141 [% IF invoice.closedate %]
142 Closed on [% invoice.closedate | $KohaDates %]
149 <div class="dropdown dropup">
150 <a class="btn btn-mini dropdown-toggle" id="invoiceactions[% invoice.invoiceid %]" role="button" data-toggle="dropdown" href="#">
151 Actions <b class="caret"></b>
153 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="invoiceactions[% invoice.invoiceid %]">
154 <li><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]"><i class="fa fa-search"></i> Details</a></li>
155 [% IF invoice.closedate %]
156 <li><a href="invoice.pl?op=reopen&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="fa fa-refresh"></i> Reopen</a></li>
158 <li><a href="invoice.pl?op=close&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="fa fa-times-circle"></i> Close</a></li>
160 [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
161 <li><a href="invoice.pl?op=delete&invoiceid=[% invoice.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% booksellerid %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]"><i class="fa fa-remove"></i> Delete</a></li>
170 <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
171 <div id="merge_invoices">
172 <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
173 <fieldset class="rows">
175 <li><h2>Merge invoices</h2></li>
176 <li><table id="merge_table">
177 <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
181 <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
182 <li><label for="merge_shipmentdate">Shipment date:</label>
183 <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" readonly="readonly" class="datepicker" /></li>
185 <li><label for="merge_billingdate">Billing date:</label>
186 <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" readonly="readonly" class="datepicker" /></li>
188 <li><label for="merge_shipmentcost">Shipment cost:</label>
189 <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
190 <li><label for="merge_shipment_budgetid">Fund:</label>
191 <select id="merge_shipment_budgetid" name="shipment_budget_id">
192 <option value="">No fund</option>
193 [% FOREACH budget IN budgets_loop %]
194 <option value="[% budget.budget_id %]">[% budget.budget_name %]
199 <li><span class="label">Status:</span> <span id="merge_status"></span></li>
200 <li><input type="submit" value="Merge" /></li>
202 <input type="hidden" name="op" value="mod" />
203 <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
208 <p>Sorry, but there is no results for your search.</p>
211 [% IF ( invoicenumber ) %]
212 <li>Invoice no.: [% invoicenumber %]</li>
214 [% IF booksellerid %]
215 <li>Vendor: [% suppliername %]</li>
217 [% IF shipmentdatefrom %]
219 [% IF shipmentdateto %]
220 From [% shipmentdatefrom | $KohaDates %]
221 To [% shipmentdateto | $KohaDates %]
223 All since [% shipmentdatefrom | $KohaDates %]
227 [% IF shipmentdateto %]
229 All until [% shipmentdateto | $KohaDates %]
233 [% IF billingdatefrom %]
235 [% IF billingdateto %]
236 From [% billingdatefrom | $KohaDates %]
237 To [% billingdateto | $KohaDates %]
239 All since [% billingdatefrom | $KohaDates %]
243 [% IF billingdateto %]
245 All until [% billingdateto | $KohaDates %]
249 [% IF ( isbneanissn ) %]
250 <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
253 <li>Title: [% title %]</li>
256 <li>Author: [% author %]</li>
258 [% IF ( publisher ) %]
259 <li>Publisher: [% publisher %]</li>
261 [% IF ( publicationyear ) %]
262 <li>Publication year: [% publicationyear %]</li>
265 <li>Library: [% branchname %]</li>
269 [% END %]<!-- invoices -->
271 <p>Use the search form on the left to find invoices.</p>
272 [% END %]<!-- do_search -->
276 <form action="" method="get">
277 <fieldset class="brief">
278 <h3>Search filters</h3>
281 <label for="invoicenumber">Invoice no:</label>
282 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
285 <label for="supplier">Vendor:</label>
286 <select id="supplier" name="supplierid">
287 <option value="">All</option>
288 [% FOREACH supplier IN suppliers_loop %]
289 [% IF ( supplier.selected ) %]
290 <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
292 <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
298 <fieldset class="brief">
299 <legend>Shipment date</legend>
302 <label for="shipmentdatefrom">From:</label>
303 <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom | $KohaDates %]" class="datepicker" />
306 <label for="shipmentdateto">To:</label>
307 <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto | $KohaDates %]" class="datepicker" />
313 <fieldset class="brief">
314 <legend>Billing date</legend>
317 <label for="billingdatefrom">From:</label>
318 <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom | $KohaDates %]" class="datepicker" />
321 <label for="billingdateto">To:</label>
322 <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto | $KohaDates %]" class="datepicker" />
328 <label for="isbneanissn">ISBN / EAN / ISSN:</label>
329 <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
332 <label for="title">Title:</label>
333 <input type="text" id="title" name="title" value="[% title %]" />
336 <label for="author">Author:</label>
337 <input type="text" id="author" name="author" value="[% author %]" />
340 <label for="publisher">Publisher:</label>
341 <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
344 <label for="publicationyear">Publication year:</label>
345 <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
348 <label for="branch">Library:</label>
349 <select id="branch" name="branch">
350 <option value="">All</option>
351 [% FOREACH branch IN branches_loop %]
352 [% IF ( branch.selected ) %]
353 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
355 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
361 <fieldset class="action">
362 <input type="submit" value="Search" />
365 <input type="hidden" name="op" id="op" value="do_search" />
367 [% INCLUDE 'acquisitions-menu.inc' %]
370 [% INCLUDE 'intranet-bottom.inc' %]