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

(-)a/C4/Members.pm (-3 / +2 lines)
Lines 354-362 sub GetMemberDetails { Link Here
354
    }
354
    }
355
    my $borrower = $sth->fetchrow_hashref;
355
    my $borrower = $sth->fetchrow_hashref;
356
    return unless $borrower;
356
    return unless $borrower;
357
    my ($amount) = GetMemberAccountRecords( $borrowernumber);
357
    $borrower->{amountoutstanding} = $borrower->{account_balance};
358
    $borrower->{'amountoutstanding'} = $amount;
358
    # FIXME - find all references to $borrower->{amountoutstanding}, replace with $borrower->{account_balance}
359
    # FIXME - patronflags calls GetMemberAccountRecords... just have patronflags return $amount
360
    my $flags = patronflags( $borrower);
359
    my $flags = patronflags( $borrower);
361
    my $accessflagshash;
360
    my $accessflagshash;
362
361
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt (-28 / +51 lines)
Lines 1-5 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE Currency %]
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" />
Lines 87-121 Link Here
87
</table>
88
</table>
88
[% END %]
89
[% END %]
89
90
90
[% IF ( accounts && ( totaldue != '0.00' ) ) %]
91
[% IF account_balance %]
91
<table>
92
    [% IF account_debits %]
92
    <caption>Account fines and payments</caption>
93
        <table>
93
    <tr>
94
            <caption>Account fees</caption>
94
        <th>Description of charges</th>
95
            <tr>
95
        <th>Date</th>
96
                <th>Description</th>
96
        <th>Amount</th>
97
                <th>Date</th>
97
        <th>Outstanding</th>
98
                <th>Amount</th>
98
    </tr>
99
                <th>Outstanding</th>
99
    [% FOREACH account IN accounts %]
100
            </tr>
100
    [% NEXT IF account.amountoutstanding == '0.00' %]
101
            [% FOREACH d IN account_debits %]
101
    <tr>
102
                [% IF d.amount_outstanding > 0 %]
102
        <td>
103
                    <tr>
103
            [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% END %]
104
                        <td>[% d.description %]</td>
104
            [% account.description %]&nbsp;[% IF ( account.printtitle ) %] [% account.title |html %][% END %]
105
                        <td>[% d.created_on | $KohaDates %]</td>
105
            [% IF ( account.itemnumber ) %]</a>[% END %]
106
                        <td>[% d.amount_original | $Currency %]</td>
106
        </td>
107
                        <td>[% d.amount_outstanding | $Currency %]</td>
107
        <td>[% account.date | $KohaDates %]</td>
108
                    </tr>
108
        <td>[% account.amount %]</td>
109
                [% END %]
109
        <td>[% account.amountoutstanding %]</td>
110
            [% END %]
110
    </tr>
111
            <tfoot>
112
                <tr>
113
                    <td colspan="3">Total due</td>
114
                    <td colspan="2">[% totaldue | $Currency %]</td>
115
                </tr>
116
            </tfoot>
117
        </table>
118
    [% END %]
119
120
    [% FOREACH c IN account_credits %]
121
        [% total_remaining = total_remaining + c.amount_remaining %]
122
    [% END %]
123
    [% IF total_remaining %]
124
        <table>
125
            <caption>Account payments</caption>
126
            <tr>
127
                <th>Date</th>
128
                <th>Amount</th>
129
                <th>Balance remaining</th>
130
            </tr>
131
            [% FOREACH c IN account_credits %]
132
                [% IF c.amount_remaining > 0 %]
133
                    <tr>
134
                        <td>[% c.created_on | $KohaDates %]</td>
135
                        <td>[% c.amount_paid | $Currency %]</td>
136
                        <td>[% c.amount_remaining | $Currency %]</td>
137
                    </tr>
138
                [% END %]
139
            [% END %]
140
        </table>
111
    [% END %]
141
    [% 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 %]
142
[% END %]
120
143
121
[% INCLUDE 'intranet-bottom.inc' %]
144
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/members/account.pl (-2 / +4 lines)
Lines 47-58 my $borrowernumber = $cgi->param('borrowernumber'); Link Here
47
47
48
my $borrower = GetMember( 'borrowernumber' => $borrowernumber );
48
my $borrower = GetMember( 'borrowernumber' => $borrowernumber );
49
49
50
my @debits = Koha::Database->new()->schema->resultset('AccountDebit')->search(
50
my $schema =  Koha::Database->new()->schema();
51
52
my @debits = $schema->resultset('AccountDebit')->search(
51
    { 'me.borrowernumber' => $borrowernumber },
53
    { 'me.borrowernumber' => $borrowernumber },
52
    { prefetch            => { account_offsets => 'credit' } }
54
    { prefetch            => { account_offsets => 'credit' } }
53
);
55
);
54
56
55
my @credits = Koha::Database->new()->schema->resultset('AccountCredit')->search(
57
my @credits = $schema->resultset('AccountCredit')->search(
56
    { 'me.borrowernumber' => $borrowernumber },
58
    { 'me.borrowernumber' => $borrowernumber },
57
    { prefetch            => { account_offsets => 'debit' } }
59
    { prefetch            => { account_offsets => 'debit' } }
58
);
60
);
(-)a/members/moremember.pl (-10 / +11 lines)
Lines 232-247 $template->param( lib1 => $lib1 ) if ($lib1); Link Here
232
$template->param( lib2 => $lib2 ) if ($lib2);
232
$template->param( lib2 => $lib2 ) if ($lib2);
233
233
234
# If printing a page, send the account informations to the template
234
# If printing a page, send the account informations to the template
235
if ($print eq "page") {
235
if ( $print eq "page" ) {
236
    foreach my $accountline (@$accts) {
236
    my $schema = Koha::Database->new()->schema();
237
        $accountline->{amount} = sprintf '%.2f', $accountline->{amount};
238
        $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding};
239
237
240
        if ($accountline->{accounttype} ne 'F' && $accountline->{accounttype} ne 'FU'){
238
    my @account_debits = $schema->resultset('AccountDebit')
241
            $accountline->{printtitle} = 1;
239
      ->search( { borrowernumber => $borrowernumber } );
242
        }
240
    my @account_credits = $schema->resultset('AccountCredit')
243
    }
241
      ->search( { borrowernumber => $borrowernumber } );
244
    $template->param( accounts => $accts );
242
243
    $template->param(
244
        account_debits  => \@account_debits,
245
        account_credits => \@account_credits,
246
    );
245
}
247
}
246
248
247
# Show OPAC privacy preference is system preference is set
249
# Show OPAC privacy preference is system preference is set
248
- 

Return to bug 6427