4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Acquisitions › Invoices</title>
6 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'datatables.inc' %]
9 [% INCLUDE 'calendar.inc' %]
10 <script type="text/javascript">
12 $(document).ready(function() {
13 $(".delete_invoice").click(function(){
14 return confirmDelete(_("Are you sure you want to delete this invoice?"));
17 var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
20 { "bSortable": false, "aTargets": [1, -1] },
21 { "bVisible": false, "aTargets": [0] },
22 { "sType": "title-string", "aTargets" : [ "title-string" ] }
26 $("#show_only_subscription").prop("checked", false);
28 $("#show_only_subscription").click(function(){
29 if ( $(this).prop("checked") ) {
30 resultst.fnFilter( "1", 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 %s").format(invoice.closedate));
76 $('#merge_status').text(_("Open"));
80 $('#merge_table tbody tr:first').click();
81 $('#merge_invoices').show();
89 <body id="acq_invoices" class="acq">
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 class="title-string">Shipment date</th>
115 <th class="title-string">Billing date</th>
116 <th>Received biblios</th>
117 <th>Received items</th>
123 [% FOREACH invoice IN invoices %]
124 <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 %]">
125 <td>[% invoice.is_linked_to_subscriptions %]</td>
126 <td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid %]" /></td>
127 <td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]">[% invoice.invoicenumber %]</a></td>
128 <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid %]">[% invoice.suppliername %]</a></td>
130 [% IF invoice.shipmentdate %]
131 <span title="[% invoice.shipmentdate %]">[% invoice.shipmentdate | $KohaDates %]</span>
133 <span title="0000-00-00"></span>
137 [% IF invoice.billingdate %]
138 <span title="[% invoice.billingdate %]">[% invoice.billingdate | $KohaDates %]</span>
140 <span title="0000-00-00"></span>
143 <td>[% invoice.receivedbiblios %]</td>
144 <td>[% invoice.receiveditems %]</td>
146 [% IF invoice.closedate %]
147 Closed on [% invoice.closedate | $KohaDates %]
154 <div class="dropdown dropup">
155 <a class="btn btn-default btn-xs dropdown-toggle" id="invoiceactions[% invoice.invoiceid %]" role="button" data-toggle="dropdown" href="#">
156 Actions <b class="caret"></b>
158 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="invoiceactions[% invoice.invoiceid %]">
159 <li><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid %]"><i class="fa fa-search"></i> Details</a></li>
160 [% IF invoice.closedate %]
161 <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>
163 <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>
165 [% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
166 <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 %]" class="delete_invoice"><i class="fa fa-trash"></i> Delete</a></li>
175 <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a>
176 <div id="merge_invoices">
177 <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post">
178 <fieldset class="rows">
180 <li><h2>Merge invoices</h2></li>
181 <li><table id="merge_table">
182 <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead>
186 <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
187 <li><label for="merge_shipmentdate">Shipment date:</label>
188 <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li>
190 <li><label for="merge_billingdate">Billing date:</label>
191 <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" class="datepicker" /></li>
193 <li><label for="merge_shipmentcost">Shipment cost:</label>
194 <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /></li>
195 <li><label for="merge_shipment_budgetid">Fund:</label>
196 <select id="merge_shipment_budgetid" name="shipment_budget_id">
197 <option value="">No fund</option>
198 [% FOREACH budget IN budgets_loop %]
199 <option value="[% budget.budget_id %]">[% budget.budget_name %]
204 <li><span class="label">Status:</span> <span id="merge_status"></span></li>
205 <li><input type="submit" value="Merge" /></li>
207 <input type="hidden" name="op" value="mod" />
208 <input type="hidden" id="merge_invoiceid" name="invoiceid" value="" />
213 <p>Sorry, but there are no results for your search.</p>
216 [% IF ( invoicenumber ) %]
217 <li>Invoice no.: [% invoicenumber |html %]</li>
219 [% IF booksellerid %]
220 <li>Vendor: [% suppliername %]</li>
222 [% IF shipmentdatefrom %]
224 [% IF shipmentdateto %]
225 From [% shipmentdatefrom | $KohaDates %]
226 To [% shipmentdateto | $KohaDates %]
228 All since [% shipmentdatefrom | $KohaDates %]
232 [% IF shipmentdateto %]
234 All until [% shipmentdateto | $KohaDates %]
238 [% IF billingdatefrom %]
240 [% IF billingdateto %]
241 From [% billingdatefrom | $KohaDates %]
242 To [% billingdateto | $KohaDates %]
244 All since [% billingdatefrom | $KohaDates %]
248 [% IF billingdateto %]
250 All until [% billingdateto | $KohaDates %]
254 [% IF ( isbneanissn ) %]
255 <li>ISBN/EAN/ISSN: [% isbneanissn |html %]</li>
258 <li>Title: [% title |html %]</li>
261 <li>Author: [% author |html %]</li>
263 [% IF ( publisher ) %]
264 <li>Publisher: [% publisher |html %]</li>
266 [% IF ( publicationyear ) %]
267 <li>Publication year: [% publicationyear |html %]</li>
270 <li>Library: [% Branches.GetName( branch ) %]</li>
274 [% END %]<!-- invoices -->
276 <p>Use the search form on the left to find invoices.</p>
277 [% END %]<!-- do_search -->
281 <form action="" method="get">
282 <fieldset class="brief">
283 <h3>Search filters</h3>
286 <label for="invoicenumber">Invoice no:</label>
287 <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber |html %]" class="focus" />
290 <label for="supplier">Vendor:</label>
291 <select id="supplier" name="supplierid">
292 <option value="">All</option>
293 [% FOREACH supplier IN suppliers_loop %]
294 [% IF ( supplier.selected ) %]
295 <option selected="selected" value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
297 <option value="[% supplier.booksellerid %]">[% supplier.suppliername %]</option>
303 <fieldset class="brief">
304 <legend>Shipment date</legend>
307 <label for="shipmentdatefrom">From:</label>
308 <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom | $KohaDates %]" class="datepicker" />
311 <label for="shipmentdateto">To:</label>
312 <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto | $KohaDates %]" class="datepicker" />
318 <fieldset class="brief">
319 <legend>Billing date</legend>
322 <label for="billingdatefrom">From:</label>
323 <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom | $KohaDates %]" class="datepicker" />
326 <label for="billingdateto">To:</label>
327 <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto | $KohaDates %]" class="datepicker" />
333 <label for="isbneanissn">ISBN / EAN / ISSN:</label>
334 <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn |html %]" />
337 <label for="title">Title:</label>
338 <input type="text" id="title" name="title" value="[% title |html %]" />
341 <label for="author">Author:</label>
342 <input type="text" id="author" name="author" value="[% author |html %]" />
345 <label for="publisher">Publisher:</label>
346 <input type="text" id="publisher" name="publisher" value="[% publisher |html %]" />
349 <label for="publicationyear">Publication year:</label>
350 <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear |html %]" />
353 <label for="branch">Library:</label>
354 <select id="branch" name="branch">
355 <option value="">All</option>
356 [%# FIXME Should not we filter the libraries %]
357 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
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' %]