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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc (-1 / +1 lines)
Lines 77-83 function export_barcodes() { Link Here
77
}
77
}
78
var slip_re = /slip/;
78
var slip_re = /slip/;
79
function printx_window(print_type) {
79
function printx_window(print_type) {
80
    var handler = print_type.match(slip_re) ? "printslip" : "moremember";
80
    var handler = print_type.match(slip_re) ? "printslip" : "summary-print";
81
    window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow");
81
    window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow");
82
    return false;
82
    return false;
83
}
83
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt (-107 / +89 lines)
Lines 1-121 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% USE KohaDates %]
3
[% USE KohaDates %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
5
    <title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
7
    <link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
7
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/print.css" />
8
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/print.css" />
8
[% INCLUDE 'slip-print.inc' #printThenClose %]
9
    [% INCLUDE 'slip-print.inc' #printThenClose %]
9
<body id="pat_moremember-print" class="pat" onload="printThenClose();">
10
11
</head>
10
</head>
12
<body>
11
<body id="pat_moremember-print" class="pat" onload="printThenClose();">
12
    <div id="main">
13
        <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3>
13
14
14
<div id="main">
15
        <ul>
16
            <li>[% address %]<br />[% address2 %]</li>
17
            <li>[% city %], [% zipcode %]</li>
18
            <li>[% IF ( phone ) %][% phone %][% ELSE %](no phone number on file)[% END %]</li>
19
            <li>[% IF ( email ) %][% email %][% ELSE %](no primary email on file)[% END %]</li>
20
            [% IF ( emailpro ) %]
21
                <li>[% emailpro %]</li>
22
            [% END %]
23
            <li>Registration date: [% dateenrolled | $KohaDates %]</li>
24
            <li>Expiration date: [% dateexpiry | $KohaDates %]</li>
25
            <li>Library: [% Branches.GetName( branchcode ) %]</li>
26
            <li>Category: [% description %]</li>
27
        </ul>
15
28
16
<h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber %]">Account summary: [% firstname %] [% surname %] ([% cardnumber %])</a></h3>
29
        [% IF ( issues ) %]
30
            <table>
31
                <caption>Items checked out</caption>
32
                <tr>
33
                    <th>Title</th>
34
                    <th>Author</th>
35
                    <th>Call no</th>
36
                    <th>Item type</th>
37
                    <th>Date due</th>
38
                    <th>Barcode</th>
39
                    <th>Charge</th>
40
                    <th>Price</th>
41
                    <th>Status</th>
42
                </tr>
17
43
18
<ul><li>[% address %]<br />[% address2 %]</li><li>[% city %], [% zipcode %]</li>
44
                [% FOREACH issueloo IN issues %]
19
<li>[% IF ( phone ) %][% phone %][% ELSE %](no phone number on file)[% END %]</li>
45
                    [% IF ( issueloo.red ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
20
<li>[% IF ( email ) %][% email %][% ELSE %](no primary email on file)[% END %]</li>
46
                        <td>
21
[% IF ( emailpro ) %]<li>[% emailpro %]</li>[% END %]
47
                            [% issueloo.title |html %]
22
<li>Registration date: [% dateenrolled %]</li>
48
                            <a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issueloo.itemnumber %]&amp;biblionumber=[% issueloo.biblionumber %]&amp;bi=[% issueloo.biblioitemnumber %]"></a>
23
<li>Expiration date: [% dateexpiry %]</li>
49
                        </td>
24
<li>Library: [% branchname %]</li>
50
                        <td>[% issueloo.author %]</td>
25
<li>Category: [% description %]</li>
51
                        <td>[% issueloo.itemcallnumber %]</td>
26
</ul>
52
                        <td>[% issueloo.itemtype_description %]</td>
53
                        <td>[% issueloo.date_due %]</td>
54
                        <td>[% issueloo.barcode %]</td>
55
                        <td>[% issueloo.charge %]</td>
56
                        <td>[% issueloo.replacementprice %]</td>
57
                        <td>[% IF ( issueloo.red ) %]Overdue![% ELSE %]&nbsp;[% END %]</td>
58
                    </tr>
59
                [% END %]
27
60
28
[% IF ( issueloop ) %]
61
            <tr>
29
<table>
62
                <td colspan="6" style="text-align: right; font-weight:bold;">Totals:</td>
30
    <caption>Items checked out</caption>
63
                <td>[% totaldue %]</td>
31
	<tr>
64
                <td>[% totalprice %]</td>
32
		<th>Title</th>
65
                <td colspan="3">&nbsp;</td>
33
		<th>Author</th>
66
            </tr>
34
                <th>Call no</th>
67
        </table>
35
        <th>Item type</th>
68
    [% END %]
36
        <th>Date due</th>
37
        <th>Barcode</th>
38
		<th>Charge</th>
39
		<th>Price</th>
40
		<th>Status</th>
41
	</tr>
42
69
43
	[% FOREACH issueloo IN issueloop %]
70
    [% IF ( accounts && ( totaldue != '0.00' ) ) %]
44
	[% IF ( issueloo.red ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
71
        <table>
45
		<td>
72
            <caption>Account fines and payments</caption>
46
		[% issueloo.title |html %]
73
            <tr>
47
		<a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issueloo.itemnumber %]&amp;biblionumber=[% issueloo.biblionumber %]&amp;bi=[% issueloo.biblioitemnumber %]">
74
                <th>Description of charges</th>
48
		</a>
75
                <th>Date</th>
49
		</td>
76
                <th>Amount</th>
50
		<td>[% issueloo.author %]</td>
77
                <th>Outstanding</th>
51
                <td>[% issueloo.itemcallnumber %]</td>
78
            </tr>
52
		<td>[% issueloo.itemtype_description %]</td>
53
		<td>[% issueloo.date_due %]</td>
54
                <td>[% issueloo.barcode %]</td>
55
		<td>[% issueloo.charge %]</td>
56
		<td>[% issueloo.replacementprice %]</td>
57
		<td>[% IF ( issueloo.red ) %]Overdue![% ELSE %]&nbsp;[% END %]</td>
58
	</tr>
59
	[% END %]
60
	<tr>
61
            <td colspan="6" style="text-align: right; font-weight:bold;">Totals:</td>
62
            <td>[% totaldue %]</td>
63
            <td>[% totalprice %]</td>
64
            <td colspan="3">&nbsp;</td>
65
        </tr>
66
	</table>
67
	[% END %]
68
	
69
[% IF ( reserveloop ) %]
70
<table>
71
	<caption>Items on Reserve</caption>
72
	<tr>
73
		<th>Title</th>
74
		<th>Author</th>
75
		<th>Format</th>
76
		<th>Requested</th>
77
	</tr>
78
79
79
[% FOREACH reserveloo IN reserveloop %]
80
            [% FOREACH account IN accounts %]
80
	<tr>
81
                [% NEXT IF account.amountoutstanding == '0.00' %]
81
		<td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% reserveloo.biblionumber %]">[% reserveloo.btitle %]</a></td>
82
                <tr>
82
		<td>[% reserveloo.author %]</td>
83
                    <td>
83
		<td>[% reserveloo.description %]</td>
84
                        [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% END %]
84
		<td>[% reserveloo.reservedate2 %]</td>
85
                        [% account.description %]&nbsp;[% IF ( account.printtitle ) %] [% account.title |html %][% END %]
85
	</tr>
86
                        [% IF ( account.itemnumber ) %]</a>[% END %]
86
	[% END %]
87
                    </td>
87
</table>
88
                    <td>[% account.date | $KohaDates %]</td>
88
[% END %]
89
                    <td>[% account.amount %]</td>
90
                    <td>[% account.amountoutstanding %]</td>
91
                </tr>
92
            [% END %]
89
93
90
[% IF ( accounts && ( totaldue != '0.00' ) ) %]
94
            <tfoot>
91
<table>
95
                <tr>
92
    <caption>Account fines and payments</caption>
96
                    <td colspan="3">Total due</td>
93
    <tr>
97
                    <td colspan="2">[% totaldue %]</td>
94
        <th>Description of charges</th>
98
                </tr>
95
        <th>Date</th>
99
            </tfoot>
96
        <th>Amount</th>
100
        </table>
97
        <th>Outstanding</th>
98
    </tr>
99
    [% FOREACH account IN accounts %]
100
    [% NEXT IF account.amountoutstanding == '0.00' %]
101
    <tr>
102
        <td>
103
            [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% END %]
104
            [% account.description %]&nbsp;[% IF ( account.printtitle ) %] [% account.title |html %][% END %]
105
            [% IF ( account.itemnumber ) %]</a>[% END %]
106
        </td>
107
        <td>[% account.date | $KohaDates %]</td>
108
        <td>[% account.amount %]</td>
109
        <td>[% account.amountoutstanding %]</td>
110
    </tr>
111
    [% END %]
101
    [% END %]
112
    <tfoot>
113
        <tr>
114
            <td colspan="3">Total due</td>
115
            <td colspan="2">[% totaldue %]</td>
116
        </tr>
117
    </tfoot>
118
</table>
119
[% END %]
120
102
121
[% INCLUDE 'intranet-bottom.inc' %]
103
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/members/summary-print.pl (-1 / +101 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 3 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use CGI;
21
22
use C4::Auth;
23
use C4::Output;
24
use C4::Members;
25
use C4::Koha qw( getitemtypeinfo );
26
use C4::Circulation qw( GetIssuingCharges );
27
28
my $input          = CGI->new;
29
my $borrowernumber = $input->param('borrowernumber');
30
31
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32
    {
33
        template_name   => "members/moremember-print.tt",
34
        query           => $input,
35
        type            => "intranet",
36
        authnotrequired => 0,
37
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
38
        debug           => 1,
39
    }
40
);
41
42
my $data = GetMember( 'borrowernumber' => $borrowernumber );
43
44
my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
45
foreach my $accountline (@$accts) {
46
    $accountline->{amount} = sprintf '%.2f', $accountline->{amount};
47
    $accountline->{amountoutstanding} = sprintf '%.2f',
48
      $accountline->{amountoutstanding};
49
50
    if (   $accountline->{accounttype} ne 'F'
51
        && $accountline->{accounttype} ne 'FU' )
52
    {
53
        $accountline->{printtitle} = 1;
54
    }
55
}
56
57
my $roadtype =
58
  C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
59
60
our $totalprice = 0;
61
$template->param(
62
    %$data,
63
64
    borrowernumber => $borrowernumber,
65
    address => $data->{'streetnumber'} . " $roadtype " . $data->{'address'},
66
67
    accounts => $accts,
68
    totaldue => sprintf( "%.2f", $total ),
69
70
    issues     => build_issue_data( GetPendingIssues($borrowernumber) ),
71
    totalprice => $totalprice,
72
);
73
74
output_html_with_http_headers $input, $cookie, $template->output;
75
76
sub build_issue_data {
77
    my $issues = shift;
78
79
    my $return;
80
81
    my $today = DateTime->now( time_zone => C4::Context->tz );
82
    $today->truncate( to => 'day' );
83
84
    foreach my $issue ( @{$issues} ) {
85
86
        my %row = %{$issue};
87
        $totalprice += $issue->{replacementprice};
88
89
        #find the charge for an item
90
        my ( $charge, $itemtype ) =
91
          GetIssuingCharges( $issue->{itemnumber}, $borrowernumber );
92
93
        my $itemtypeinfo = getitemtypeinfo($itemtype);
94
        $row{'itemtype_description'} = $itemtypeinfo->{description};
95
96
        $row{'charge'} = sprintf( "%.2f", $charge );
97
98
        push( @{$return}, \%row );
99
    }
100
    return $return;
101
}

Return to bug 12971