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-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Currency %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
4
<title>Summary for [% firstname %] [% surname %] ([% cardnumber %])</title>
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Lines 91-125 Link Here
91
</table>
92
</table>
92
[% END %]
93
[% END %]
93
94
94
[% IF ( accounts && ( totaldue != '0.00' ) ) %]
95
[% IF account_balance %]
95
<table>
96
    [% IF account_debits %]
96
    <caption>Account fines and payments</caption>
97
        <table>
97
    <tr>
98
            <caption>Account fees</caption>
98
        <th>Description of charges</th>
99
            <tr>
99
        <th>Date</th>
100
                <th>Description</th>
100
        <th>Amount</th>
101
                <th>Date</th>
101
        <th>Outstanding</th>
102
                <th>Amount</th>
102
    </tr>
103
                <th>Outstanding</th>
103
    [% FOREACH account IN accounts %]
104
            </tr>
104
    [% NEXT IF account.amountoutstanding == '0.00' %]
105
            [% FOREACH d IN account_debits %]
105
    <tr>
106
                [% IF d.amount_outstanding > 0 %]
106
        <td>
107
                    <tr>
107
            [% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% END %]
108
                        <td>[% d.description %]</td>
108
            [% account.description %]&nbsp;[% IF ( account.printtitle ) %] [% account.title |html %][% END %]
109
                        <td>[% d.created_on | $KohaDates %]</td>
109
            [% IF ( account.itemnumber ) %]</a>[% END %]
110
                        <td>[% d.amount_original | $Currency %]</td>
110
        </td>
111
                        <td>[% d.amount_outstanding | $Currency %]</td>
111
        <td>[% account.date | $KohaDates %]</td>
112
                    </tr>
112
        <td>[% account.amount %]</td>
113
                [% END %]
113
        <td>[% account.amountoutstanding %]</td>
114
            [% END %]
114
    </tr>
115
            <tfoot>
116
                <tr>
117
                    <td colspan="3">Total due</td>
118
                    <td colspan="2">[% totaldue | $Currency %]</td>
119
                </tr>
120
            </tfoot>
121
        </table>
122
    [% END %]
123
124
    [% FOREACH c IN account_credits %]
125
        [% total_remaining = total_remaining + c.amount_remaining %]
126
    [% END %]
127
    [% IF total_remaining %]
128
        <table>
129
            <caption>Account payments</caption>
130
            <tr>
131
                <th>Date</th>
132
                <th>Amount</th>
133
                <th>Balance remaining</th>
134
            </tr>
135
            [% FOREACH c IN account_credits %]
136
                [% IF c.amount_remaining > 0 %]
137
                    <tr>
138
                        <td>[% c.created_on | $KohaDates %]</td>
139
                        <td>[% c.amount_paid | $Currency %]</td>
140
                        <td>[% c.amount_remaining | $Currency %]</td>
141
                    </tr>
142
                [% END %]
143
            [% END %]
144
        </table>
115
    [% END %]
145
    [% END %]
116
    <tfoot>
117
        <tr>
118
            <td colspan="3">Total due</td>
119
            <td colspan="2">[% totaldue %]</td>
120
        </tr>
121
    </tfoot>
122
</table>
123
[% END %]
146
[% END %]
124
147
125
[% INCLUDE 'intranet-bottom.inc' %]
148
[% 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