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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt (+62 lines)
Lines 177-182 Link Here
177
                    [% ELSE %]
177
                    [% ELSE %]
178
                        <h4>You have no fines or charges</h4>
178
                        <h4>You have no fines or charges</h4>
179
                    [% END %]
179
                    [% END %]
180
181
                    [% FOREACH r IN relatives %]
182
                        <h3 id="g[% r.patron.id %]">[% r.patron.firstname %] [% r.patron.surname %]'s fines and charges</h3>
183
184
                        <table class="table table-bordered table-striped" id="finestable-[% r.id %]">
185
                            <thead>
186
                                <tr>
187
                                    <th class="title-string">Date</th>
188
                                    <th>Description</th>
189
                                    <th>Fine amount</th>
190
                                    <th>Amount outstanding</th>
191
                                </tr>
192
                            </thead>
193
194
                            <tbody>
195
                                [% SET account_sum = 0 %]
196
                                [% FOREACH a IN r.accountlines %]
197
                                    [% SET account_sum = account_sum + a.amountoutstanding %]
198
                                    <tr>
199
                                        <td><span title="[% a.date %]">[% a.date | $KohaDates %]</span></td>
200
                                        <td>
201
                                            [% SWITCH a.accounttype %]
202
                                            [% CASE 'Pay' %]Payment, thanks
203
                                            [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
204
                                            [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
205
                                            [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
206
                                            [% CASE 'N' %]New card
207
                                            [% CASE 'F' %]Fine
208
                                            [% CASE 'A' %]Account management fee
209
                                            [% CASE 'M' %]Sundry
210
                                            [% CASE 'L' %]Lost item
211
                                            [% CASE 'W' %]Writeoff
212
                                            [% CASE 'FU' %]Accruing fine
213
                                            [% CASE 'HE' %]Hold waiting too long
214
                                            [% CASE 'Rent' %]Rental fee
215
                                            [% CASE 'FOR' %]Forgiven
216
                                            [% CASE 'LR' %]Lost item fee refund
217
                                            [% CASE 'PF' %]Processing fee
218
                                            [% CASE 'PAY' %]Payment
219
                                            [% CASE 'WO' %]Writeoff
220
                                            [% CASE 'C' %]Credit
221
                                            [% CASE 'CR' %]Credit
222
                                            [% CASE %][% a.accounttype %]
223
                                          [%- END -%]
224
                                          [%- IF a.payment_type %], [% AuthorisedValues.GetByCode('PAYMENT_TYPE', a.payment_type, 1) %][% END %]
225
                                          [%- IF a.description %], [% a.description %][% END %]
226
                                          [% IF a.itemnumber %]([% a.item.biblio.title %])[% END %]
227
                                        </td>
228
                                        [% IF ( a.amount < 0 ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% a.amount | $Price %]</td>
229
                                        [% IF ( a.amountoutstanding < 0 ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% a.amountoutstanding | $Price %]</td>
230
                                    </tr>
231
                                [% END %]
232
                            </tbody>
233
234
                            <tfoot>
235
                                <tr>
236
                                    <th class="sum" colspan="3">Total due</th>
237
                                    <td class="sum">[% account_sum | $Price %]</td>
238
                                </tr>
239
                            </tfoot>
240
                        </table>
241
                        [% END %]
180
                </div> <!-- / #useraccount -->
242
                </div> <!-- / #useraccount -->
181
            </div> <!-- / .span10 -->
243
            </div> <!-- / .span10 -->
182
        </div> <!-- / .row-fluid -->
244
        </div> <!-- / .row-fluid -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+22 lines)
Lines 133-138 Link Here
133
                                [% IF ( BORROWER_INFO.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% amountoutstanding | $Price %])</a></li>[% END %]
133
                                [% IF ( BORROWER_INFO.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% amountoutstanding | $Price %])</a></li>[% END %]
134
                                [% IF ( BORROWER_INFO.amountoverzero ) %]<li><a href="#opac-user-fines">Fines ([% amountoutstanding | $Price %])</a></li>[% END %]
134
                                [% IF ( BORROWER_INFO.amountoverzero ) %]<li><a href="#opac-user-fines">Fines ([% amountoutstanding | $Price %])</a></li>[% END %]
135
                                [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% amountoutstanding | $Price %])</a></li>[% END %]
135
                                [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% amountoutstanding | $Price %])</a></li>[% END %]
136
137
                                [% IF relatives %]<li><a href="#opac-user-relative-fines">Relatives' fines</a></li>[% END %]
136
                            [% END %]
138
                            [% END %]
137
139
138
                            [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
140
                            [% IF borrower_club_enrollments.count || borrower_enrollable_clubs.count %]
Lines 396-401 Link Here
396
                                    </table>
398
                                    </table>
397
                                </div>
399
                                </div>
398
                            [% END %]
400
                            [% END %]
401
402
                            [% IF relatives_with_fines %]
403
                               <div id="opac-user-relative-fines"> <h3>Fines and charges</h3>
404
                                    <table class="table table-bordered table-striped">
405
                                        <thead>
406
                                            <tr>
407
                                                <th colspan="2">Amount</th>
408
                                            </tr>
409
                                        </thead>
410
                                        <tbody>
411
                                            [% FOREACH r IN relatives_with_fines %]
412
                                            <tr>
413
                                                <td>[% r.firstname %] [% r.surname %] currently owes fines and charges amounting to:</td>
414
                                                <td><a href="/cgi-bin/koha/opac-account.pl#g[% r.id %]">[% r.account.balance | $Price %]</a></td>
415
                                            </tr>
416
                                            [% END %]
417
                                        </tbody>
418
                                    </table>
419
                                </div>
420
                            [% END %]
399
                        [% END # / OPACFinesTab %]
421
                        [% END # / OPACFinesTab %]
400
422
401
                        [% IF relatives %]
423
                        [% IF relatives %]
(-)a/opac/opac-account.pl (+27 lines)
Lines 67-72 while ( my $line = $accts->next ) { Link Here
67
    push @accountlines, $accountline;
67
    push @accountlines, $accountline;
68
}
68
}
69
69
70
if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor')
71
    || C4::Context->preference('AllowStaffToSetCheckoutsVisibilityForGuarantor')
72
  )
73
{
74
    my @relatives;
75
76
    # Filter out guarantees that don't want guarantor to see checkouts
77
    foreach my $gr ( $patron->guarantee_relationships() ) {
78
        my $g = $gr->guarantee;
79
        if ( $g->privacy_guarantor_checkouts ) {
80
81
            my $relatives_accountlines = Koha::Account::Lines->search(
82
                { borrowernumber => $g->borrowernumber },
83
                { order_by       => { -desc => 'accountlines_id' } }
84
            );
85
            push(
86
                @relatives,
87
                {
88
                    patron       => $g,
89
                    accountlines => $relatives_accountlines,
90
                }
91
            );
92
        }
93
    }
94
    $template->param( relatives => \@relatives );
95
}
96
70
$template->param(
97
$template->param(
71
    ACCOUNT_LINES => \@accountlines,
98
    ACCOUNT_LINES => \@accountlines,
72
    total         => sprintf( "%.2f", $total ), # FIXME Use TT plugin Price
99
    total         => sprintf( "%.2f", $total ), # FIXME Use TT plugin Price
(-)a/opac/opac-user.pl (-1 / +12 lines)
Lines 350-355 if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor' Link Here
350
    $template->param( relatives => \@relatives );
350
    $template->param( relatives => \@relatives );
351
}
351
}
352
352
353
if (   C4::Context->preference('AllowPatronToSetFinesVisibilityForGuarantor')
354
    || C4::Context->preference('AllowStaffToSetFinesVisibilityForGuarantor') )
355
{
356
    my @relatives_with_fines;
357
    # Filter out guarantees that don't want guarantor to see checkouts
358
    foreach my $gr ( $patron->guarantee_relationships() ) {
359
        my $g = $gr->guarantee;
360
        push( @relatives_with_fines, $g ) if $g->privacy_guarantor_fines;
361
    }
362
    $template->param( relatives_with_fines => \@relatives_with_fines );
363
}
364
353
$template->param(
365
$template->param(
354
    borrower                 => scalar Koha::Patrons->find($borrowernumber),
366
    borrower                 => scalar Koha::Patrons->find($borrowernumber),
355
    patron_messages          => $patron_messages,
367
    patron_messages          => $patron_messages,
356
- 

Return to bug 20691