+[% USE Asset %]
[% USE KohaDates %]
[% USE Branches %]
-
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Acquisitions › Invoices</title>
-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
+[% Asset.css("css/datatables.css") %]
[% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'datatables.inc' %]
-[% INCLUDE 'calendar.inc' %]
-<script type="text/javascript">
-//<![CDATA[
-$(document).ready(function() {
- var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
- bPaginate: false,
- aoColumnDefs: [
- { "bSortable": false, "aTargets": [1, -1] },
- { "bVisible": false, "aTargets": [0] },
- { "sType": "title-string", "aTargets" : [ "title-string" ] }
- ]
- }));
-
- $("#show_only_subscription").prop("checked", false);
-
- $("#show_only_subscription").click(function(){
- if ( $(this).prop("checked") ) {
- resultst.fnFilter( "1", 0, true );
- } else {
- resultst.fnFilter( '', 0 );
- }
- });
- $('#merge').click(function (ev) {
- var booksellerid;
- var mismatch;
- var invoices = [ ];
- if ($('.select-invoice:checked').size() < 2) {
- alert(_("You must select at least two invoices to merge."));
- return false;
- }
- $('.select-invoice:checked').each(function () {
- var row = $(this).parents('tr');
- booksellerid = booksellerid || $(row).attr('data-booksellerid');
- if (booksellerid !== $(row).attr('data-booksellerid')) {
- mismatch = true;
- }
- invoices.push({ 'invoiceid': $(row).attr('data-invoiceid'),
- 'invoicenumber': $(row).find('td:nth-child(2) a').text(),
- 'shipmentdate': $(row).attr('data-shipmentdate'),
- 'billingdate': $(row).attr('data-billingdate'),
- 'shipmentcost': $(row).attr('data-shipmentcost'),
- 'shipment_budgetid': $(row).attr('data-shipment_budgetid'),
- 'closedate': $(row).attr('data-closedate'), });
- $('#merge_invoice_form').append('<input type="hidden" name="merge" value="' + $(row).attr('data-invoiceid') + '" />');
- });
- if (mismatch) {
- alert(_("All invoices for merging must be from the same vendor"));
- } else {
- $('#merge_table tbody').empty();
- $.each(invoices, function (idx, invoice) {
- var row = $('<tr data-invoiceid="' + invoice.invoiceid + '"><td>' + invoice.invoicenumber + '</td><td>' + invoice.shipmentdate + '</td><td>' + invoice.billingdate + '</td><td>' + invoice.shipmentcost + '</td></tr>');
- $(row).appendTo('#merge_table tbody');
- $(row).click(function () {
- $('#merge_table tbody tr').removeClass('active');
- $(this).addClass('active');
- $('#merge_invoicenumber').text(invoice.invoicenumber);
- $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid'], function (idx, prop) {
- $('#merge_' + prop).val(invoice[prop]);
- });
- if (invoice.closedate) {
- $('#merge_status').text(_("Closed on %s").format(invoice.closedate));
- } else {
- $('#merge_status').text(_("Open"));
- }
- });
- });
- $('#merge_table tbody tr:first').click();
- $('#merge_invoices').show();
- }
- });
-});
-//]]>
-</script>
</head>
<body id="acq_invoices" class="acq">
<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>
-<div id="doc3" class="yui-t2">
+<div class="main container-fluid">
+ <div class="row">
+ <div class="col-sm-10 col-sm-push-2">
+ <main>
-<div id="bd">
- <div id="yui-main">
- <div class="yui-b">
<h1>Invoices</h1>
[% IF ( do_search ) %]
[% IF invoices %]
<td>
<div class="dropdown dropup">
- <a class="btn btn-mini dropdown-toggle" id="invoiceactions[% invoice.invoiceid %]" role="button" data-toggle="dropdown" href="#">
+ <a class="btn btn-default btn-xs dropdown-toggle" id="invoiceactions[% invoice.invoiceid %]" role="button" data-toggle="dropdown" href="#">
Actions <b class="caret"></b>
</a>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="invoiceactions[% invoice.invoiceid %]">
<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>
[% END %]
[% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
- <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-trash"></i> Delete</a></li>
+ <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>
[% END %]
</ul>
</div>
<tbody>
</tbody>
</table></li>
- <li><label for="merge_invoicenumber">Invoice number:</label><span id="merge_invoicenumber"></span></li>
+ <li><label for="merge_invoicenumber" class="required">Invoice number:</label>
+ <input type="text" size="10" id="merge_invoicenumber" name="invoicenumber" value="" class="required" required="required" />
+ <span class="required">Required</span>
+ </li>
<li><label for="merge_shipmentdate">Shipment date:</label>
<input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li>
</form>
</div>
[% ELSE %]
- <p>Sorry, but there is no results for your search.</p>
+ <p>Sorry, but there are no results for your search.</p>
<p>Search was:
<ul>
[% IF ( invoicenumber ) %]
- <li>Invoice no.: [% invoicenumber %]</li>
+ <li>Invoice no.: [% invoicenumber |html %]</li>
[% END %]
[% IF booksellerid %]
<li>Vendor: [% suppliername %]</li>
[% END %]
[% END %]
[% IF ( isbneanissn ) %]
- <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
+ <li>ISBN/EAN/ISSN: [% isbneanissn |html %]</li>
[% END %]
[% IF ( title ) %]
- <li>Title: [% title %]</li>
+ <li>Title: [% title |html %]</li>
[% END %]
[% IF ( author ) %]
- <li>Author: [% author %]</li>
+ <li>Author: [% author |html %]</li>
[% END %]
[% IF ( publisher ) %]
- <li>Publisher: [% publisher %]</li>
+ <li>Publisher: [% publisher |html %]</li>
[% END %]
[% IF ( publicationyear ) %]
- <li>Publication year: [% publicationyear %]</li>
+ <li>Publication year: [% publicationyear |html %]</li>
[% END %]
[% IF ( branch ) %]
<li>Library: [% Branches.GetName( branch ) %]</li>
[% ELSE %]
<p>Use the search form on the left to find invoices.</p>
[% END %]<!-- do_search -->
- </div>
- </div>
- <div class="yui-b">
+ </main>
+</div> <!-- /.col-sm-10.col-sm-push-2 -->
+
+<div class="col-sm-2 col-sm-pull-10">
+<aside>
<form action="" method="get">
- <fieldset class="brief">
+ <fieldset class="sidebar brief">
<h3>Search filters</h3>
<ol>
<li>
<label for="invoicenumber">Invoice no:</label>
- <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" class="focus" />
+ <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber |html %]" class="focus" />
</li>
<li>
<label for="supplier">Vendor:</label>
</li>
<li>
<label for="isbneanissn">ISBN / EAN / ISSN:</label>
- <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
+ <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn |html %]" />
</li>
<li>
<label for="title">Title:</label>
- <input type="text" id="title" name="title" value="[% title %]" />
+ <input type="text" id="title" name="title" value="[% title |html %]" />
</li>
<li>
<label for="author">Author:</label>
- <input type="text" id="author" name="author" value="[% author %]" />
+ <input type="text" id="author" name="author" value="[% author |html %]" />
</li>
<li>
<label for="publisher">Publisher:</label>
- <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
+ <input type="text" id="publisher" name="publisher" value="[% publisher |html %]" />
</li>
<li>
<label for="publicationyear">Publication year:</label>
- <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
+ <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear |html %]" />
</li>
<li>
<label for="branch">Library:</label>
<input type="hidden" name="op" id="op" value="do_search" />
</form>
[% INCLUDE 'acquisitions-menu.inc' %]
- </div>
-</div>
+ </aside>
+</div> <!-- /.col-sm-2.col-sm-pull-10 -->
+</div> <!-- /.row -->
+
+[% MACRO jsinclude BLOCK %]
+ [% Asset.js("js/acquisitions-menu.js") %]
+ [% INCLUDE 'datatables.inc' %]
+ [% INCLUDE 'calendar.inc' %]
+ <script>
+ $(document).ready(function() {
+ $(".delete_invoice").click(function(){
+ return confirmDelete(_("Are you sure you want to delete this invoice?"));
+ });
+ var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ bPaginate: false,
+ aoColumnDefs: [
+ { "bSortable": false, "aTargets": [1, -1] },
+ { "bVisible": false, "aTargets": [0] },
+ { "sType": "title-string", "aTargets" : [ "title-string" ] }
+ ]
+ }));
+
+ $("#show_only_subscription").prop("checked", false);
+
+ $("#show_only_subscription").click(function(){
+ if ( $(this).prop("checked") ) {
+ resultst.fnFilter( "1", 0, true );
+ } else {
+ resultst.fnFilter( '', 0 );
+ }
+ });
+
+ $('#merge').click(function (ev) {
+ var booksellerid;
+ var mismatch;
+ var invoices = [ ];
+ if ($('.select-invoice:checked').size() < 2) {
+ alert(_("You must select at least two invoices to merge."));
+ return false;
+ }
+ $('.select-invoice:checked').each(function () {
+ var row = $(this).parents('tr');
+ booksellerid = booksellerid || $(row).attr('data-booksellerid');
+ if (booksellerid !== $(row).attr('data-booksellerid')) {
+ mismatch = true;
+ }
+ invoices.push({ 'invoiceid': $(row).attr('data-invoiceid'),
+ 'invoicenumber': $(row).find('td:nth-child(2) a').text(),
+ 'shipmentdate': $(row).attr('data-shipmentdate'),
+ 'billingdate': $(row).attr('data-billingdate'),
+ 'shipmentcost': $(row).attr('data-shipmentcost'),
+ 'shipment_budgetid': $(row).attr('data-shipment_budgetid'),
+ 'closedate': $(row).attr('data-closedate'), });
+ $('#merge_invoice_form').append('<input type="hidden" name="merge" value="' + $(row).attr('data-invoiceid') + '" />');
+ });
+ if (mismatch) {
+ alert(_("All invoices for merging must be from the same vendor"));
+ } else {
+ $('#merge_table tbody').empty();
+ $.each(invoices, function (idx, invoice) {
+ var row = $('<tr data-invoiceid="' + invoice.invoiceid + '"><td>' + invoice.invoicenumber + '</td><td>' + invoice.shipmentdate + '</td><td>' + invoice.billingdate + '</td><td>' + invoice.shipmentcost + '</td></tr>');
+ $(row).appendTo('#merge_table tbody');
+ $(row).click(function () {
+ $('#merge_table tbody tr').removeClass('active');
+ $(this).addClass('active');
+ $.each(['invoiceid', 'shipmentdate', 'billingdate', 'shipmentcost', 'shipment_budgetid', 'invoicenumber'], function (idx, prop) {
+ $('#merge_' + prop).val(invoice[prop]);
+ });
+ if (invoice.closedate) {
+ $('#merge_status').text(_("Closed on %s").format(invoice.closedate));
+ } else {
+ $('#merge_status').text(_("Open"));
+ }
+ });
+ });
+ $('#merge_table tbody tr:first').click();
+ $('#merge_invoices').show();
+ }
+ });
+ });
+ </script>
+[% END %]
+
[% INCLUDE 'intranet-bottom.inc' %]