Bug 12258 Adds Datatables to the Fines->Account page of patrons (members/boraccount.pl). Also adds a button "Filter paid transactions" to hide fines with no outstanding value (0.00).

Test steps :

* Create a few manual invoices with fines.
* Pay a fine.
* Go back to the account tab.
* Try the "Filter paid transactions" button. It should filter everything with 0.00 in the Outstanding column.
* Try the "Show all transactions" button.
* Play around with the buttons

Followed test steps. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Maxime Pelletier 2013-11-07 16:03:23 -05:00 committed by Tomas Cohen Arazi
parent 9b28d8fa5b
commit 214473b0e0

View file

@ -1,6 +1,32 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" />
<script type="text/javascript" src="/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.min.js"></script>
[% INCLUDE 'datatables-strings.inc' %]
<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script>
<script type="text/javascript" id="js">$(document).ready(function() {
$(document).ready(function() {
var txtActivefilter = _('Filter paid transactions');
var txtInactivefilter = _('Show all transactions');
var table_account_fines = $("#table_account_fines").dataTable($.extend(true, {}, dataTablesDefaults, {
"sPaginationType": "four_button",
"iDisplayLength" : 25
}));
$('<button id="filter_transacs">'+txtActivefilter+'</button>').appendTo($("#table_account_fines_filter"));
$('#filter_transacs').click(function() {
if ($(this).hasClass('filtered')) {
var filteredValue = '';
$('#filter_transacs').text(txtActivefilter);
} else { //Not filtered. Let's do it!
var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408
$('#filter_transacs').text(txtInactivefilter);
}
table_account_fines.fnFilter(filteredValue, 4, true, false);
$(this).toggleClass('filtered');
});
});
}); </script>
</head>
<body id="pat_borraccount" class="pat">
[% INCLUDE 'header.inc' %]
@ -26,8 +52,8 @@
</ul>
<div class="tabs-container">
<!-- The table with the account items -->
<table>
<tr>
<table id="table_account_fines">
<thead>
<th>Date</th>
<th>Description of charges</th>
<th>Note</th>
@ -37,7 +63,7 @@
<th>&nbsp;</th>
[% END %]
<th>Print</th>
</tr>
</thead>
<!-- FIXME: Shouldn't hardcode dollar signs, since Euro or Pound might be needed -->
[% FOREACH account IN accounts %]