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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc (+62 lines)
Lines 116-121 Link Here
116
    <h4>You have no fines or charges</h4>
116
    <h4>You have no fines or charges</h4>
117
[% END %]
117
[% END %]
118
118
119
[% FOREACH r IN relatives %]
120
    <h3 id="g[% r.patron.id %]">[% r.patron.firstname %] [% r.patron.surname %]'s fines and charges</h3>
121
122
    <table class="table table-bordered table-striped" id="finestable-[% r.id %]">
123
        <thead>
124
            <tr>
125
                <th class="title-string">Date</th>
126
                <th>Description</th>
127
                <th>Fine amount</th>
128
                <th>Amount outstanding</th>
129
            </tr>
130
        </thead>
131
132
        <tbody>
133
            [% SET account_sum = 0 %]
134
            [% FOREACH a IN r.accountlines %]
135
                [% SET account_sum = account_sum + a.amountoutstanding %]
136
                <tr>
137
                    <td><span title="[% a.date %]">[% a.date | $KohaDates %]</span></td>
138
                    <td>
139
                        [% SWITCH a.accounttype %]
140
                        [% CASE 'Pay' %]Payment, thanks
141
                        [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
142
                        [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
143
                        [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
144
                        [% CASE 'N' %]New card
145
                        [% CASE 'F' %]Fine
146
                        [% CASE 'A' %]Account management fee
147
                        [% CASE 'M' %]Sundry
148
                        [% CASE 'L' %]Lost item
149
                        [% CASE 'W' %]Writeoff
150
                        [% CASE 'FU' %]Accruing fine
151
                        [% CASE 'HE' %]Hold waiting too long
152
                        [% CASE 'Rent' %]Rental fee
153
                        [% CASE 'FOR' %]Forgiven
154
                        [% CASE 'LR' %]Lost item fee refund
155
                        [% CASE 'PF' %]Processing fee
156
                        [% CASE 'PAY' %]Payment
157
                        [% CASE 'WO' %]Writeoff
158
                        [% CASE 'C' %]Credit
159
                        [% CASE 'CR' %]Credit
160
                        [% CASE %][% a.accounttype %]
161
                        [%- END -%]
162
                        [%- IF a.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', a.payment_type, 1) %][% END %]
163
                        [%- IF a.description %], [% a.description %][% END %]
164
                        [% IF a.itemnumber %]([% a.item.biblio.title %])[% END %]
165
                    </td>
166
                    [% IF ( a.amount < 0 ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% a.amount | $Price %]</td>
167
                    [% IF ( a.amountoutstanding < 0 ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% a.amountoutstanding | $Price %]</td>
168
                </tr>
169
            [% END %]
170
        </tbody>
171
172
        <tfoot>
173
            <tr>
174
                <th class="sum" colspan="3">Total due</th>
175
                <td class="sum">[% account_sum | $Price %]</td>
176
            </tr>
177
        </tfoot>
178
    </table>
179
[% END %]
180
119
[%- BLOCK account_status_description -%]
181
[%- BLOCK account_status_description -%]
120
    [%- SWITCH account.status -%]
182
    [%- SWITCH account.status -%]
121
        [%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
183
        [%- CASE 'UNRETURNED' -%]<span> (Accruing)</span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-1 / +22 lines)
Lines 149-156 Link Here
149
                            [% IF relatives %]<li><a href="#opac-user-relative-issues">Relatives' checkouts</a></li>[% END %]
149
                            [% IF relatives %]<li><a href="#opac-user-relative-issues">Relatives' checkouts</a></li>[% END %]
150
                            [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count | html %])</a></li>[% END %]
150
                            [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count | html %])</a></li>[% END %]
151
                            [% IF ( OPACFinesTab ) %]
151
                            [% IF ( OPACFinesTab ) %]
152
                            [% IF ( amountoutstanding > 0 ) %]<li><a href="#opac-user-fines">Fines ([% amountoutstanding | $Price %])</a></li>[% END %]
152
                                [% IF ( amountoutstanding > 0 ) %]<li><a href="#opac-user-fines">Fines ([% amountoutstanding | $Price %])</a></li>[% END %]
153
                                [% IF ( amountoutstanding < 0 ) %]<li><a href="#opac-user-fines">Credits ([% amountoutstanding * -1 | $Price %])</a></li>[% END %]
153
                                [% IF ( amountoutstanding < 0 ) %]<li><a href="#opac-user-fines">Credits ([% amountoutstanding * -1 | $Price %])</a></li>[% END %]
154
                                [% IF relatives_with_fines %]<li><a href="#opac-user-relative-fines">Relatives' fines</a></li>[% END %]
154
                            [% END %]
155
                            [% END %]
155
156
156
                            [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
157
                            [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
Lines 411-416 Link Here
411
                                    </table>
412
                                    </table>
412
                                </div>
413
                                </div>
413
                            [% END %]
414
                            [% END %]
415
416
                            [% IF relatives_with_fines %]
417
                               <div id="opac-user-relative-fines"> <h3>Fines and charges</h3>
418
                                    <table class="table table-bordered table-striped">
419
                                        <thead>
420
                                            <tr>
421
                                                <th colspan="2">Amount</th>
422
                                            </tr>
423
                                        </thead>
424
                                        <tbody>
425
                                            [% FOREACH r IN relatives_with_fines %]
426
                                            <tr>
427
                                                <td>[% r.firstname %] [% r.surname %] currently owes fines and charges amounting to:</td>
428
                                                <td><a href="/cgi-bin/koha/opac-account.pl#g[% r.id %]">[% r.account.balance | $Price %]</a></td>
429
                                            </tr>
430
                                            [% END %]
431
                                        </tbody>
432
                                    </table>
433
                                </div>
434
                            [% END %]
414
                        [% END # / OPACFinesTab %]
435
                        [% END # / OPACFinesTab %]
415
436
416
                        [% IF relatives %]
437
                        [% IF relatives %]
(-)a/opac/opac-account.pl (+28 lines)
Lines 44-49 my $account = $patron->account; Link Here
44
my $total = $account->balance;
44
my $total = $account->balance;
45
my $accountlines = $account->lines;
45
my $accountlines = $account->lines;
46
46
47
if ( C4::Context->preference('AllowPatronToSetFinesVisibilityForGuarantor')
48
    || C4::Context->preference('AllowStaffToSetFinesVisibilityForGuarantor')
49
  )
50
{
51
    my @relatives;
52
53
    # Filter out guarantees that don't want guarantor to see checkouts
54
    foreach my $gr ( $patron->guarantee_relationships() ) {
55
        my $g = $gr->guarantee;
56
        if ( $g->privacy_guarantor_fines ) {
57
58
            my $relatives_accountlines = Koha::Account::Lines->search(
59
                { borrowernumber => $g->borrowernumber },
60
                { order_by       => { -desc => 'accountlines_id' } }
61
            );
62
            push(
63
                @relatives,
64
                {
65
                    patron       => $g,
66
                    accountlines => $relatives_accountlines,
67
                }
68
            );
69
        }
70
    }
71
    $template->param( relatives => \@relatives );
72
}
73
74
47
$template->param(
75
$template->param(
48
    ACCOUNT_LINES => $accountlines,
76
    ACCOUNT_LINES => $accountlines,
49
    total         => $total,
77
    total         => $total,
(-)a/opac/opac-user.pl (-1 / +13 lines)
Lines 340-345 if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor' Link Here
340
    $template->param( relatives => \@relatives );
340
    $template->param( relatives => \@relatives );
341
}
341
}
342
342
343
if (   C4::Context->preference('AllowPatronToSetFinesVisibilityForGuarantor')
344
    || C4::Context->preference('AllowStaffToSetFinesVisibilityForGuarantor') )
345
{
346
    my @relatives_with_fines;
347
    # Filter out guarantees that don't want guarantor to see checkouts
348
    foreach my $gr ( $patron->guarantee_relationships() ) {
349
        my $g = $gr->guarantee;
350
        push( @relatives_with_fines, $g ) if $g->privacy_guarantor_fines;
351
    }
352
    $template->param( relatives_with_fines => \@relatives_with_fines );
353
}
354
355
343
$template->param(
356
$template->param(
344
    patron_messages          => $patron_messages,
357
    patron_messages          => $patron_messages,
345
    opacnote                 => $borr->{opacnote},
358
    opacnote                 => $borr->{opacnote},
346
- 

Return to bug 20691