Main Koha release repository https://koha-community.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

306 lines
13 KiB

[% USE raw %]
[% USE Asset %]
[% USE KohaDates %]
[% USE Price %]
[% USE ItemTypes %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Cash register statistics &rsaquo; Results[% ELSE %]&rsaquo; Cash register statistics[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.css("css/datatables.css") | $raw %]
</head>
<body id="cash_register_stats" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
&rsaquo;
[% IF ( do_it ) %]
<a href="/cgi-bin/koha/reports/cash_register_stats.pl">Cash register statistics</a> &rsaquo; Results
[% ELSE %]
Cash register statistics
[% END %]
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Cash register statistics</h1>
<form method="post" action="/cgi-bin/koha/reports/cash_register_stats.pl" id="frmCashRegister">
<fieldset class="rows">
<legend>Cash register statistics [% beginDate | $KohaDates %] to [% endDate | $KohaDates %]</legend>
<ol>
<br>
<li>
<label for="from">From: </label>
<input type="text" size="10" id="from" name="from" value="[% beginDate | $KohaDates %]" class="datepickerfrom" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>
<label for="to">To: </label>
<input type="text" size="10" id="to" name="to" value="[% endDate | $KohaDates %]" class="datepickerto" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>
<label for="">Transaction type:</label>
<select name="transaction_type" id="transaction_type">
[% IF transaction_type == "ALL" %]
<option value="ALL" selected="selected">All transactions</option>
[% ELSE %]
<option value="ALL">All transactions</option>
[% END %]
[% IF transaction_type == "ACT" %]
<option value="ACT" selected="selected">All payments to the library</option>
[% ELSE %]
<option value="ACT">All payments to the library</option>
[% END %]
[% IF transaction_type == "C" %]
<option value="C" selected="selected">Credit</option>
[% ELSE %]
<option value="C">Credit</option>
[% END %]
[% IF transaction_type == "CR" %]
<option value="CR" selected="selected">Credit (item returned)</option>
[% ELSE %]
<option value="CR">Credit (item returned)</option>
[% END %]
[% IF transaction_type == "FORW" %]
<option value="FORW" selected="selected">Write off</option>
[% ELSE %]
<option value="FORW">Write off</option>
[% END %]
[% IF transaction_type == "F" %]
<option value="F" selected="selected">Fine</option>
[% ELSE %]
<option value="F">Fine</option>
[% END %]
[% IF transaction_type == "FU" %]
<option value="FU" selected="selected">Accruing fine</option>
[% ELSE %]
<option value="FU">Accruing fine</option>
[% END %]
[% IF transaction_type == "PAY" %]
<option value="PAY" selected="selected">Payment</option>
[% ELSE %]
<option value="PAY">Payment</option>
[% END %]
[% IF transaction_type == "A" %]
<option value="A" selected="selected">Account management fee</option>
[% ELSE %]
<option value="A">Account management fee</option>
[% END %]
[% IF transaction_type == "M" %]
<option value="M" selected="selected">Sundry</option>
[% ELSE %]
<option value="M">Sundry</option>
[% END %]
[% IF transaction_type == "L" %]
<option value="L" selected="selected">Lost item</option>
[% ELSE %]
<option value="L">Lost item</option>
[% END %]
[% IF transaction_type == "N" %]
<option value="N" selected="selected">New card</option>
[% ELSE %]
<option value="N">New card</option>
[% END %]
[% FOREACH manualinv IN manualinv_types %]
[% value_manualinv = manualinv.authorised_value|truncate(5, '') | html %]
[% IF transaction_type == value_manualinv %]
<option value="[% value_manualinv | html %]" selected="selected">[% manualinv.authorised_value | html %]</option>
[% ELSE %]
<option value="[% value_manualinv | html %]">[% manualinv.authorised_value | html %]</option>
[% END %]
[% END %]
</select>
</li>
<li>
<label>Transaction branch</label>
<select name="branch" id="branch">
<option value="ALL">All</option>
[% FOREACH branchloo IN branchloop %]
[% IF ( branchloo.selected ) %]
<option value="[% branchloo.branchcode | html %]" selected="selected">[% branchloo.branchname | html %]</option>
[% ELSE %]
<option value="[% branchloo.branchcode | html %]">[% branchloo.branchname | html %]</option>
[% END %]
[% END %]
</select>
</td>
</tr>
</li>
</ol>
</fieldset>
<fieldset class="rows">
<legend>Output</legend>
<ol>
<li>
<label for="outputscreen">To screen into the browser: </label>
<input type="radio" checked="checked" name="output" id="outputscreen" value="screen" />
</li>
<li>
<label for="outputfile">To a file:</label>
<input type="radio" name="output" value="file" id="outputfile" />
<label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" value="Submit" name="do_it" />
</fieldset>
</form>
[% IF ( do_it ) %]
<div>&nbsp;</div>
<table id="tbl_cash_register_stats">
<thead>
<tr>
<th>Manager name</th>
<th>Patron card number</th>
<th>Patron name</th>
<th>Transaction branch</th>
<th>Transaction date</th>
<th>Transaction type</th>
<th>Notes</th>
<th>Amount</th>
<th>Bibliographic record title</th>
<th>Barcode</th>
<th>Item type</th>
</tr>
</thead>
[% FOREACH loopresul IN loopresult %]
<tr>
<td>[% loopresul.mfirstname | html %] [% loopresul.msurname | html %]</td>
<td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopresul.borrowernumber | html %]">[% loopresul.cardnumber | html %]</a></td>
<td>[% loopresul.bfirstname | html %] [% loopresul.bsurname | html %]</td>
<td>[% loopresul.branchname | html %]</td>
<td>[% loopresul.date | $KohaDates %]</td>
<td>
[% IF loopresul.accounttype == "ACT" %]
<span>All payments to the library</span>
[% ELSIF loopresul.accounttype == "C" || loopresul.accounttype == "CR" %]
<span>Credit</span>
[% ELSIF loopresul.accounttype == "FORW" || loopresul.accounttype == "W" %]
<span>Write off</span>
[% ELSIF loopresul.accounttype == "F" %]
<span>Fine</span>
[% ELSIF loopresul.accounttype == "FU" %]
<span>Accruing fine</span>
[% ELSIF loopresul.accounttype == "Pay" %]
<span>Payment</span>
[% ELSIF loopresul.accounttype == "A" %]
<span>Account management fee</span>
[% ELSIF loopresul.accounttype == "M" %]
<span>Sundry</span>
[% ELSIF loopresul.accounttype == "L" || loopresul.accounttype == "LR" %]
<span>Lost item</span>
[% ELSIF loopresul.accounttype == "N" %]
<span>New card</span>
[% ELSE %]
[% FOREACH manualinv IN manualinv_types %]
[% value_manualinv = manualinv.authorised_value|truncate(5, '') | html %]
[% IF loopresul.accounttype == value_manualinv %]
<span>[% manualinv.authorised_value | html %]</span>
[% LAST | html %]
[% END %]
[% END %]
[% END %]
</td>
<td>[% loopresul.note | html %]</td>
<td style="text-align:right;">[% loopresul.amount | $Price | html %]</td>
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopresul.biblionumber | html %]">[% loopresul.title | html %]</a></td>
<td>[% loopresul.barcode | html %]</td>
<td>[% ItemTypes.GetDescription(loopresul.itype) | html %]</td>
</tr>
[% END %]
<tfoot>
<tr>
[% IF transaction_type == "ACT" %]
<th colspan="7" style="text-align:right;">TOTAL</th>
<th style="text-align:right;">[% total | $Price | html %]</th>
<th colspan="3">&nbsp;</th>
[% END %]
</tr>
</tfoot>
</table>
[% END %] [%# do_it %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'reports-menu.inc' %]
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript" id="js">
$(document).ready(function() {
$("#tbl_cash_register_stats").dataTable($.extend(true, {}, dataTablesDefaults, {
"iDisplayLength": 50,
"sPaginationType": "full_numbers"
}));
});
</script>
[% INCLUDE 'calendar.inc' %]
<script type="text/javascript">
actTotal = "";
$(document).ready(function() {
// http://jqueryui.com/demos/datepicker/#date-range
var dates = $( "#filter_date_begin, #filter_date_end" ).datepicker({
changeMonth: true,
numberOfMonths: 1,
onSelect: function( selectedDate ) {
var option = this.id == "filter_date_begin" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" );
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
$('#frmCashRegister').submit(function() {
var isFormValid = true;
var alertString= _("Form not submitted because of the following problem(s)")+"\n";
alertString +="-------------------------------------------------------------------\n\n";
if ( !$('#from').val() || !$('#to').val()){
isFormValid = false;
alertString += "\n- " + _("Dates cannot be empty");
}
if (!isFormValid) {
alert(alertString);
return false;
}
});
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]