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 / +118 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2010 BibLibre
5
# Copyright 2014 ByWater Solutions
6
#
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it under the
10
# terms of the GNU General Public License as published by the Free Software
11
# Foundation; either version 2 of the License, or (at your option) any later
12
# version.
13
#
14
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License along
19
# with Koha; if not, write to the Free Software Foundation, Inc.,
20
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22
=head1 moremember.pl
23
24
 script to do a borrower enquiry/bring up borrower details etc
25
 Displays all the details about a borrower
26
 written 20/12/99 by chris@katipo.co.nz
27
 last modified 21/1/2000 by chris@katipo.co.nz
28
 modified 31/1/2001 by chris@katipo.co.nz
29
   to not allow items on request to be renewed
30
31
 needs html removed and to use the C4::Output more, but its tricky
32
33
=cut
34
35
use Modern::Perl;
36
37
use CGI;
38
39
use C4::Auth;
40
use C4::Output;
41
use C4::Members;
42
use C4::Koha qw( getitemtypeinfo );
43
use C4::Circulation qw( GetIssuingCharges );
44
45
my $input          = CGI->new;
46
my $borrowernumber = $input->param('borrowernumber');
47
48
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
49
    {
50
        template_name   => "members/moremember-print.tt",
51
        query           => $input,
52
        type            => "intranet",
53
        authnotrequired => 0,
54
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
55
        debug           => 1,
56
    }
57
);
58
59
my $data = GetMember( 'borrowernumber' => $borrowernumber );
60
61
my ( $total, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
62
foreach my $accountline (@$accts) {
63
    $accountline->{amount} = sprintf '%.2f', $accountline->{amount};
64
    $accountline->{amountoutstanding} = sprintf '%.2f',
65
      $accountline->{amountoutstanding};
66
67
    if (   $accountline->{accounttype} ne 'F'
68
        && $accountline->{accounttype} ne 'FU' )
69
    {
70
        $accountline->{printtitle} = 1;
71
    }
72
}
73
74
my $roadtype =
75
  C4::Koha::GetAuthorisedValueByCode( 'ROADTYPE', $data->{streettype} );
76
77
our $totalprice = 0;
78
$template->param(
79
    %$data,
80
81
    borrowernumber => $borrowernumber,
82
    address => $data->{'streetnumber'} . " $roadtype " . $data->{'address'},
83
84
    accounts => $accts,
85
    totaldue => sprintf( "%.2f", $total ),
86
87
    issues     => build_issue_data( GetPendingIssues($borrowernumber) ),
88
    totalprice => $totalprice,
89
);
90
91
output_html_with_http_headers $input, $cookie, $template->output;
92
93
sub build_issue_data {
94
    my $issues = shift;
95
96
    my $return;
97
98
    my $today = DateTime->now( time_zone => C4::Context->tz );
99
    $today->truncate( to => 'day' );
100
101
    foreach my $issue ( @{$issues} ) {
102
103
        my %row = %{$issue};
104
        $totalprice += $issue->{replacementprice};
105
106
        #find the charge for an item
107
        my ( $charge, $itemtype ) =
108
          GetIssuingCharges( $issue->{itemnumber}, $borrowernumber );
109
110
        my $itemtypeinfo = getitemtypeinfo($itemtype);
111
        $row{'itemtype_description'} = $itemtypeinfo->{description};
112
113
        $row{'charge'} = sprintf( "%.2f", $charge );
114
115
        push( @{$return}, \%row );
116
    }
117
    return $return;
118
}

Return to bug 12971