View | Details | Raw Unified | Return to bug 6934
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc (-1 / +1 lines)
Lines 10-16 Link Here
10
		<li><a href="/cgi-bin/koha/reports/catalogue_stats.pl">Catalog</a></li>
10
		<li><a href="/cgi-bin/koha/reports/catalogue_stats.pl">Catalog</a></li>
11
		<li><a href="/cgi-bin/koha/reports/issues_stats.pl">Circulation</a></li>
11
		<li><a href="/cgi-bin/koha/reports/issues_stats.pl">Circulation</a></li>
12
        <li><a href="/cgi-bin/koha/reports/serials_stats.pl">Serials</a></li>
12
        <li><a href="/cgi-bin/koha/reports/serials_stats.pl">Serials</a></li>
13
        <li><a href="/cgi-bin/koha/reports/cash_register_stats.pl">Cash Register</a></li>
13
        <li><a href="/cgi-bin/koha/reports/cash_register_stats.pl">Cash register</a></li>
14
        <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>        
14
        <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>        
15
	</ul>
15
	</ul>
16
16
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt (-21 / +31 lines)
Lines 1-17 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Cash Register Statistics &rsaquo; Results[% ELSE %]&rsaquo; Cash Register Statistics[% END %]</title>
3
<title>Koha &rsaquo; Reports [% IF ( do_it ) %]&rsaquo; Cash register statistics &rsaquo; Results[% ELSE %]&rsaquo; Cash register statistics[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
[% INCLUDE 'datatables.inc' %]
6
[% INCLUDE 'datatables.inc' %]
6
[% INCLUDE 'datatables-strings.inc' %]
7
[% INCLUDE 'datatables-strings.inc' %]
7
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
8
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
8
<script type="text/javascript" id="js">$(document).ready(function() {
9
<script type="text/javascript" id="js">
9
 $(document).ready(function() {
10
 $(document).ready(function() {
10
    $("#tbl_cash_register_stats").dataTable($.extend(true, {}, dataTablesDefaults, {
11
    $("#tbl_cash_register_stats").dataTable($.extend(true, {}, dataTablesDefaults, {
11
        "iDisplayLength": 50
12
        "iDisplayLength": 50,
13
        "sPaginationType": "full_numbers"
12
    }));
14
    }));
13
 });
15
 });
14
}); </script>
16
</script>
15
[% INCLUDE 'calendar.inc' %]
17
[% INCLUDE 'calendar.inc' %]
16
<script type="text/javascript">
18
<script type="text/javascript">
17
//<![CDATA[
19
//<![CDATA[
Lines 25-31 function isNull(f,noalert) { Link Here
25
}
27
}
26
28
27
$(document).ready(function() {
29
$(document).ready(function() {
28
29
    // http://jqueryui.com/demos/datepicker/#date-range
30
    // http://jqueryui.com/demos/datepicker/#date-range
30
    var dates = $( "#filter_date_begin, #filter_date_end" ).datepicker({
31
    var dates = $( "#filter_date_begin, #filter_date_end" ).datepicker({
31
        changeMonth: true,
32
        changeMonth: true,
Lines 56-63 $(document).ready(function() { Link Here
56
           alert(alertString);
57
           alert(alertString);
57
           return false;
58
           return false;
58
        }
59
        }
59
60
        $(this).submit();
61
    });
60
    });
62
});
61
});
63
62
Lines 73-81 $(document).ready(function() { Link Here
73
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
72
    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a>
74
    &rsaquo;
73
    &rsaquo;
75
    [% IF ( do_it ) %]
74
    [% IF ( do_it ) %]
76
        <a href="/cgi-bin/koha/reports/cash_register_stats.pl">Cash Register Statistics</a> &rsaquo; Results
75
        <a href="/cgi-bin/koha/reports/cash_register_stats.pl">Cash register statistics</a> &rsaquo; Results
77
    [% ELSE %]
76
    [% ELSE %]
78
        Cash Register Statistics
77
        Cash register statistics
79
    [% END %]
78
    [% END %]
80
</div>
79
</div>
81
80
Lines 88-94 $(document).ready(function() { Link Here
88
    <h1>Cash register statistics</h1>
87
    <h1>Cash register statistics</h1>
89
    <form method="post" action="/cgi-bin/koha/reports/cash_register_stats.pl" id="frmCashRegister">
88
    <form method="post" action="/cgi-bin/koha/reports/cash_register_stats.pl" id="frmCashRegister">
90
        <fieldset class="rows">
89
        <fieldset class="rows">
91
        <legend>Cash Register statistics [% beginDate %] to [% endDate %]</legend>
90
        <legend>Cash register statistics [% beginDate | $KohaDates %] to [% endDate | $KohaDates %]</legend>
92
        <table>
91
        <table>
93
            <thead>
92
            <thead>
94
                <tr>
93
                <tr>
Lines 99-107 $(document).ready(function() { Link Here
99
                <tr>
98
                <tr>
100
                    <td>
99
                    <td>
101
                        <label for="filter_date_begin">From</label>
100
                        <label for="filter_date_begin">From</label>
102
                        <input type="text" size="10" id="filter_date_begin" name="filter_date_begin" value="[% beginDate %]" />
101
                        <input type="text" size="10" id="filter_date_begin" name="filter_date_begin" value="[% beginDate | $KohaDates %]" />
103
                        <label for="filter_date_end">To</label>
102
                        <label for="filter_date_end">To</label>
104
                        <input type="text" size="10" id="filter_date_end" name="filter_date_end" value="[% endDate %]" />
103
                        <input type="text" size="10" id="filter_date_end" name="filter_date_end" value="[% endDate | $KohaDates %]" />
105
                    </td>
104
                    </td>
106
                </tr>
105
                </tr>
107
            </tbody>
106
            </tbody>
Lines 144-152 $(document).ready(function() { Link Here
144
                        [% END %]
143
                        [% END %]
145
144
146
                        [% IF transaction_type == "FU" %]
145
                        [% IF transaction_type == "FU" %]
147
                        <option value="FU" selected="selected">Fine - long period</option>
146
                        <option value="FU" selected="selected">Accruing fine</option>
148
                        [% ELSE %]
147
                        [% ELSE %]
149
                        <option value="FU">Fine - long period</option>
148
                        <option value="FU">Accruing fine</option>
150
                        [% END %]
149
                        [% END %]
151
150
152
                        [% IF transaction_type == "PAY" %]
151
                        [% IF transaction_type == "PAY" %]
Lines 156-162 $(document).ready(function() { Link Here
156
                        [% END %]
155
                        [% END %]
157
156
158
                        [% IF transaction_type == "A" %]
157
                        [% IF transaction_type == "A" %]
159
                        <option value="A" selected="selected">Account Management Fee</option>
158
                        <option value="A" selected="selected">Account management fee</option>
160
                        [% ELSE %]
159
                        [% ELSE %]
161
                        <option value="A">Account Management Fee</option>
160
                        <option value="A">Account Management Fee</option>
162
                        [% END %]
161
                        [% END %]
Lines 218-223 $(document).ready(function() { Link Here
218
                    <label for="outputfile">To a file:</label>
217
                    <label for="outputfile">To a file:</label>
219
                    <input type="radio" name="output" value="file" id="outputfile" />
218
                    <input type="radio" name="output" value="file" id="outputfile" />
220
                    <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
219
                    <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" />
220
                    <label class="inline" for="sep">Delimiter: </label>
221
                    <select name="sep" id="sep" size="1">
222
                        [% FOREACH value IN CGIsepChoice.values.sort() %]
223
                           [% IF ( value == CGIsepChoice.default ) %]
224
                               <option value="[% value %]" selected="selected">[% value %]</option>
225
                           [% ELSE %]
226
                              <option value="[% value %]">[% value %]</option>
227
                           [% END %]
228
                        [% END %]
229
                    </select>
230
221
                </li>
231
                </li>
222
            </ol>
232
            </ol>
223
        </fieldset>
233
        </fieldset>
Lines 233-247 $(document).ready(function() { Link Here
233
        <thead>
243
        <thead>
234
        <tr>
244
        <tr>
235
            <th>Manager name</th>
245
            <th>Manager name</th>
236
            <th>Borrower cardnumber</th>
246
            <th>Patron cardnumber</th>
237
            <th>Borrower name</th>
247
            <th>Patron name</th>
238
            <th>Branch</th>
248
            <th>Library</th>
239
            <th>Transaction date</th>
249
            <th>Transaction date</th>
240
            <th>Transaction type</th>
250
            <th>Transaction type</th>
241
            <th>Amount</th>
251
            <th>Amount</th>
242
            <th>Biblio title</th>
252
            <th>Biblio title</th>
243
            <th>Barcode</th>
253
            <th>Barcode</th>
244
            <th>Document type</th>
254
            <th>Item type</th>
245
        </tr>
255
        </tr>
246
        </thead>
256
        </thead>
247
        [% FOREACH loopresul IN loopresult %]
257
        [% FOREACH loopresul IN loopresult %]
Lines 250-256 $(document).ready(function() { Link Here
250
                <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopresul.borrowernumber %]">[% loopresul.cardnumber %]</a></td>
260
                <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopresul.borrowernumber %]">[% loopresul.cardnumber %]</a></td>
251
                <td>[% loopresul.bfirstname %] [% loopresul.bsurname %]</td>
261
                <td>[% loopresul.bfirstname %] [% loopresul.bsurname %]</td>
252
                <td>[% loopresul.branchname %]</td>
262
                <td>[% loopresul.branchname %]</td>
253
                <td>[% loopresul.date %]</td>
263
                <td>[% loopresul.date | $KohaDates %]</td>
254
                <td>
264
                <td>
255
                    [% IF loopresul.accounttype == "ACT" %]
265
                    [% IF loopresul.accounttype == "ACT" %]
256
                        <span>Active transactions</span>
266
                        <span>Active transactions</span>
Lines 261-267 $(document).ready(function() { Link Here
261
                    [% ELSIF loopresul.accounttype == "F" %]
271
                    [% ELSIF loopresul.accounttype == "F" %]
262
                        <span>Fine</span>
272
                        <span>Fine</span>
263
                    [% ELSIF loopresul.accounttype == "FU" %]
273
                    [% ELSIF loopresul.accounttype == "FU" %]
264
                        <span>Fine - long period</span>
274
                        <span>Accruing fine</span>
265
                    [% ELSIF loopresul.accounttype == "Pay" %]
275
                    [% ELSIF loopresul.accounttype == "Pay" %]
266
                        <span>Payment</span>
276
                        <span>Payment</span>
267
                    [% ELSIF loopresul.accounttype == "A" %]
277
                    [% ELSIF loopresul.accounttype == "A" %]
(-)a/reports/cash_register_stats.pl (-15 / +17 lines)
Lines 14-21 Link Here
14
# with Koha; if not, write to the Free Software Foundation, Inc.,
14
# with Koha; if not, write to the Free Software Foundation, Inc.,
15
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
16
17
use strict;
17
use Modern::Perl;
18
use warnings;
19
use C4::Auth;
18
use C4::Auth;
20
use CGI;
19
use CGI;
21
use C4::Context;
20
use C4::Context;
Lines 23-29 use C4::Reports; Link Here
23
use C4::Output;
22
use C4::Output;
24
use C4::Koha;
23
use C4::Koha;
25
use C4::Circulation;
24
use C4::Circulation;
26
use C4::Dates qw/format_date format_date_in_iso/;
25
use DateTime;
26
use Koha::DateUtils;
27
use C4::Budgets qw/GetCurrency GetCurrencies/;
27
use C4::Budgets qw/GetCurrency GetCurrencies/;
28
#use Data::Dumper;
28
#use Data::Dumper;
29
#use Smart::Comments;
29
#use Smart::Comments;
Lines 46-63 my $output = $input->param("output"); Link Here
46
my $basename         = $input->param("basename");
46
my $basename         = $input->param("basename");
47
my $transaction_type = $input->param("transaction_type") || 'ACT';
47
my $transaction_type = $input->param("transaction_type") || 'ACT';
48
my $branchcode       = $input->param("branch") || C4::Context->userenv->{'branch'};
48
my $branchcode       = $input->param("branch") || C4::Context->userenv->{'branch'};
49
our $sep = ",";
49
our $sep = $input->param("sep") // ',';
50
$sep = "\t" if ($sep eq 'tabulation');
50
51
51
$template->param(
52
$template->param(
52
    do_it => $do_it,
53
    do_it => $do_it,
53
    DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
54
    CGIsepChoice => GetDelimiterChoices,
54
);
55
);
55
56
56
#Initialize date pickers to today
57
#Initialize date pickers to today
57
my $today = C4::Dates->today('iso');
58
my $fromDate = dt_from_string;
58
my $fromDate = $today;
59
my $toDate   = dt_from_string;
59
my $toDate   = $today;
60
61
### fromdate today: $fromDate
60
### fromdate today: $fromDate
62
61
63
my $query_manualinv = "SELECT id, authorised_value FROM authorised_values WHERE category = 'MANUAL_INV'";
62
my $query_manualinv = "SELECT id, authorised_value FROM authorised_values WHERE category = 'MANUAL_INV'";
Lines 69-76 my $manualinv_types = $sth_manualinv->fetchall_arrayref({}); Link Here
69
68
70
if ($do_it) {
69
if ($do_it) {
71
70
72
    $fromDate = format_date_in_iso($input->param("filter_date_begin"));
71
    $fromDate = output_pref({ dt => eval { dt_from_string($input->param("filter_date_begin")) } || dt_from_string,
73
    $toDate   = format_date_in_iso($input->param("filter_date_end"));
72
            dateformat => 'sql', dateonly => 1 }); #for sql query
73
    $toDate   = output_pref({ dt => eval { dt_from_string($input->param("filter_date_end")) } || dt_from_string,
74
            dateformat => 'sql', dateonly => 1 }); #for sql query
74
75
75
    my $whereTType = '';
76
    my $whereTType = '';
76
77
Lines 119-125 if ($do_it) { Link Here
119
        $row->{amountoutstanding} = 0 if (!$row->{amountoutstanding});
120
        $row->{amountoutstanding} = 0 if (!$row->{amountoutstanding});
120
        #if ((abs($row->{amount}) - $row->{amountoutstanding}) > 0) {
121
        #if ((abs($row->{amount}) - $row->{amountoutstanding}) > 0) {
121
            $row->{amount} = sprintf("%.2f", abs ($row->{amount}));
122
            $row->{amount} = sprintf("%.2f", abs ($row->{amount}));
122
            $row->{date} = format_date($row->{date});
123
            $row->{date} = dt_from_string($row->{date}, 'sql');
123
            ### date : $row->{date}
124
            ### date : $row->{date}
124
125
125
            push (@loopresult, $row);
126
            push (@loopresult, $row);
Lines 178-189 if ($do_it) { Link Here
178
### fromdate final: $fromDate
179
### fromdate final: $fromDate
179
### toDate final: $toDate
180
### toDate final: $toDate
180
$template->param(
181
$template->param(
181
    beginDate        => format_date($fromDate),
182
    beginDate        => dt_from_string($fromDate),
182
    endDate          => format_date($toDate),
183
    endDate          => dt_from_string($toDate),
183
    transaction_type => $transaction_type,
184
    transaction_type => $transaction_type,
184
    branchloop       => C4::Branch::GetBranchesLoop($branchcode),
185
    branchloop       => C4::Branch::GetBranchesLoop($branchcode),
185
    manualinv_types  => $manualinv_types,
186
    manualinv_types  => $manualinv_types,
187
    CGIsepChoice => GetDelimiterChoices,
186
);
188
);
189
187
output_html_with_http_headers $input, $cookie, $template->output;
190
output_html_with_http_headers $input, $cookie, $template->output;
188
191
189
1;
192
1;
190
- 

Return to bug 6934