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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/browser-strings.inc (+34 lines)
Line 0 Link Here
1
[% USE AuthorisedValues %]
2
<script type="text/javascript">
3
//<![CDATA[
4
    var BROWSER_RETURN_TO_SEARCH = _("Return to results");
5
    var BROWSER_PREVIOUS = _("Previous");
6
    var BROWSER_NEXT = _("Next");
7
8
    var STRINGS = {
9
        "DebitTypes": {
10
            "FINE"                      : _("Fine"),
11
            "ACCOUNT_MANAGEMENT_FEE"    : _("Account management fee"),
12
            "SUNDRY"                    : _("Sundry"),
13
            "LOST"                      : _("Lost item"),
14
            "HOLD"                      : _("Hold fee"),
15
            "RENTAL"                    : _("Rental fee"),
16
            "NEW_CARD"                  : _("New card"),
17
            [% FOREACH a IN AuthorisedValues.Get('MANUAL_INV') %]
18
                "[% a.authorised_value %]" : "[% a.lib %]",
19
            [% END %]
20
        },
21
22
        "CreditTypes": {
23
            "CREDIT"                    : _("Credit"),
24
            "PAYMENT"                   : _("Payment"),
25
            "WRITEOFF"                  : _("Writeoff"),
26
            "FOUND"                     : _("Lost item found"),
27
            "FORGIVEN"                  : _("Forgiven"),
28
            [% FOREACH a IN AuthorisedValues.Get('MANUAL_CREDIT') %]
29
                "[% a.authorised_value %]" : "[% a.lib %]",
30
            [% END %]
31
        }
32
    }
33
//]]>
34
</script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt (-55 / +356 lines)
Lines 1-9 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE Currency %]
3
4
4
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your fines and charges
5
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your fines and charges
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% BLOCK cssinclude %][% END %]
7
[% BLOCK cssinclude %][% END %]
8
9
[% INCLUDE 'browser-strings.inc' %]
10
7
</head>
11
</head>
8
<body id="opac-account" class="scrollto">
12
<body id="opac-account" class="scrollto">
9
[% INCLUDE 'masthead.inc' %]
13
[% INCLUDE 'masthead.inc' %]
Lines 11-17 Link Here
11
<div class="main">
15
<div class="main">
12
    <ul class="breadcrumb">
16
    <ul class="breadcrumb">
13
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
17
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
14
        <li>[% FOREACH BORROWER_INF IN BORROWER_INFO %]<a href="/cgi-bin/koha/opac-user.pl">[% BORROWER_INF.firstname %] [% BORROWER_INF.surname %]</a>[% END %] <span class="divider">&rsaquo;</span></li>
18
        <li><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]</a> <span class="divider">&rsaquo;</span></li>
15
        <li><a href="#">Your fines and charges</a></li>
19
        <li><a href="#">Your fines and charges</a></li>
16
    </ul>
20
    </ul>
17
21
Lines 25-85 Link Here
25
            <div class="span10">
29
            <div class="span10">
26
                <div id="useraccount" class="maincontent">
30
                <div id="useraccount" class="maincontent">
27
                    <h3>Fines and charges</h3>
31
                    <h3>Fines and charges</h3>
32
                    [% IF credits || debits %]
33
34
                        <p>
35
                            <h3>Account balance: [% borrower.account_balance | $Currency %]</h3>
36
                        </p>
37
38
                        <div>
39
                            <div id="account-debits">
40
                                <a id="account-debits-switcher" href="#" onclick="return false">View payments</a>
41
                                <table cellpadding="0" cellspacing="0" border="0" class="display" id="debits-table">
42
                                    <thead>
43
                                        <tr>
44
                                            <th colspan="99">Fees</th>
45
                                        </tr>
46
                                        <tr>
47
                                            <th></th>
48
                                            <th>ID</th>
49
                                            <th>Description</th>
50
                                            <th>Type</th>
51
                                            <th>Amount</th>
52
                                            <th>Outstanding</th>
53
                                            <th>Created on</th>
54
                                            <th>Updated on</th>
55
                                        </tr>
56
                                    </thead>
57
                                    <tbody></tbody>
58
                                </table>
59
                            </div>
28
60
29
                    [% IF ( ACCOUNT_LINES ) %]
61
                            <div id="account-credits">
30
                        <table class="table table-bordered table-striped">
62
                                <a id="account-credits-switcher" href="#"  onclick="return false">View fees</a>
31
                            <thead>
63
                                <table cellpadding="0" cellspacing="0" border="0" class="display" id="credits-table">
32
                                <tr>
64
                                    <thead>
33
                                    <th>Date</th>
65
                                        <tr>
34
                                    <th>Description</th>
66
                                            <th colspan="99">Payments</th>
35
                                    <th>Fine amount</th>
67
                                        </tr>
36
                                    <th>Amount outstanding</th>
68
                                        <tr>
37
                                </tr>
69
                                            <th></th>
38
                            </thead>
70
                                            <th>ID</th>
39
71
                                            <th>Notes</th>
40
                            <tfoot>
72
                                            <th>Type</th>
41
                            <tr>
73
                                            <th>Amount</th>
42
                                <th class="sum" colspan="3">Total due</th>
74
                                            <th>Remaining</th>
43
                                <td class="sum">[% total %]</td>
75
                                            <th>Created on</th>
44
                            </tr>
76
                                            <th>Updated on</th>
45
                            </tfoot>
77
                                        </tr>
46
78
                                    </thead>
47
                            <tbody>
79
                                    <tbody></tbody>
48
                                [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
80
                                </table>
49
                                    [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
81
                            </div>
50
                                        <td>[% ACCOUNT_LINE.date | $KohaDates %]</td>
82
                        </div>
51
                                        <td>
52
                                            [% SWITCH ACCOUNT_LINE.accounttype %]
53
                                            [% CASE 'Pay' %]Payment, thanks
54
                                            [% CASE 'Pay00' %]Payment, thanks (cash via SIP2)
55
                                            [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2)
56
                                            [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2)
57
                                            [% CASE 'N' %]New card
58
                                            [% CASE 'F' %]Fine
59
                                            [% CASE 'A' %]Account management fee
60
                                            [% CASE 'M' %]Sundry
61
                                            [% CASE 'L' %]Lost item
62
                                            [% CASE 'W' %]Writeoff
63
                                            [% CASE 'FU' %]Accruing fine
64
                                            [% CASE 'Rent' %]Rental fee
65
                                            [% CASE 'FOR' %]Forgiven
66
                                            [% CASE 'LR' %]Lost item fee refund
67
                                            [% CASE 'PAY' %]Payment
68
                                            [% CASE 'WO' %]Writeoff
69
                                            [% CASE 'C' %]Credit
70
                                            [% CASE 'CR' %]Credit
71
                                            [% CASE %][% ACCOUNT_LINE.accounttype %]
72
                                          [%- END -%]
73
                                          [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %]
74
                                          [% IF ACCOUNT_LINE.title %]([% ACCOUNT_LINE.title %])[% END %]
75
                                        </td>
76
                                        [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td>
77
                                        [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td>
78
                                    </tr>
79
                                [% END %]
80
                            </tbody>
81
82
                        </table>
83
                    [% ELSE %]
83
                    [% ELSE %]
84
                        <h4>You have no fines or charges</h4>
84
                        <h4>You have no fines or charges</h4>
85
                    [% END %]
85
                    [% END %]
Lines 90-93 Link Here
90
</div> <!-- / .main -->
90
</div> <!-- / .main -->
91
91
92
[% INCLUDE 'opac-bottom.inc' %]
92
[% INCLUDE 'opac-bottom.inc' %]
93
94
[% INCLUDE 'datatables.inc' %]
95
96
<script type="text/javascript">
97
//<![CDATA[
98
$(document).ready(function() {
99
    $('#account-credits').hide();
100
    $('#account-debits-switcher').click(function() {
101
         $('#account-debits').slideUp();
102
         $('#account-credits').slideDown();
103
    });
104
    $('#account-credits-switcher').click(function() {
105
         $('#account-credits').slideUp();
106
         $('#account-debits').slideDown();
107
    });
108
109
    var anOpen = [];
110
    var sImageUrl = "[% interface %]/[% theme %]/images/";
111
112
    var debitsTable = $('#debits-table').dataTable( {
113
        "bProcessing": true,
114
        "aoColumns": [
115
            {
116
                "mDataProp": null,
117
                "sClass": "control center",
118
                "sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">'
119
            },
120
            { "mDataProp": "debit_id" },
121
            { "mDataProp": "description" },
122
            {
123
                "mDataProp": "type",
124
                "fnRender": function ( o, val ) {
125
                    return STRINGS['DebitTypes'][val] || val;
126
                },
127
            },
128
            { "mDataProp": "amount_original" },
129
            { "mDataProp": "amount_outstanding" },
130
            { "mDataProp": "created_on" },
131
            { "mDataProp": "updated_on" }
132
        ],
133
        "aaData": [
134
            [% FOREACH d IN debits %]
135
                {
136
                    [% PROCESS format_data data=d highlight='debit' %]
137
138
                    // Data for related item if there is one linked
139
                    "title": "[% d.item.biblio.title || d.deleted_item.biblio.title || d.deleted_item.deleted_biblio.title %]",
140
                    "biblionumber": "[% d.item.biblio.biblionumber || d.deleted_item.biblio.biblionumber %]",
141
                    "barcode": "[% d.item.barcode || d.deleted_item.barcode %]",
142
                    "itemnumber": "[% d.item.itemnumber %]", //This way itemnumber will be undef if deleted
143
144
145
                    // Data for related issue if there is one linked
146
                    [% IF d.issue %]
147
                        [% SET table = 'issue' %]
148
                    [% ELSIF d.old_issue %]
149
                        [% SET table = 'old_issue' %]
150
                    [% END %]
151
152
                    [% IF table %]
153
                        "issue": {
154
                            [% PROCESS format_data data=d.$table %]
155
                        },
156
                    [% END %]
157
158
159
                    "account_offsets": [
160
                        [% FOREACH ao IN d.account_offsets %]
161
                            {
162
                                [% PROCESS format_data data=ao highlight='offset'%]
163
164
                                "credit": {
165
                                    [% PROCESS format_data data=ao.credit highlight='credit' %]
166
                                }
167
                            },
168
                        [% END %]
169
                    ]
170
171
                },
172
            [% END %]
173
        ]
174
    } );
175
176
    $('#debits-table td.control').live( 'click', function () {
177
        var nTr = this.parentNode;
178
        var i = $.inArray( nTr, anOpen );
179
180
        if ( i === -1 ) {
181
            $('img', this).attr( 'src', sImageUrl+"details_close.png" );
182
            var nDetailsRow = debitsTable.fnOpen( nTr, fnFormatDebitDetails(debitsTable, nTr), 'details' );
183
            $('div.innerDetails', nDetailsRow).slideDown();
184
            anOpen.push( nTr );
185
        }
186
        else {
187
            $('img', this).attr( 'src', sImageUrl+"details_open.png" );
188
            $('div.innerDetails', $(nTr).next()[0]).slideUp( function () {
189
                debitsTable.fnClose( nTr );
190
                anOpen.splice( i, 1 );
191
            } );
192
        }
193
    } );
194
195
    var creditsTable = $('#credits-table').dataTable( {
196
        "bProcessing": true,
197
        "aoColumns": [
198
            {
199
                "mDataProp": null,
200
                "sClass": "control center",
201
                "sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">'
202
            },
203
            { "mDataProp": "credit_id" },
204
            { "mDataProp": "notes" },
205
            { "mDataProp": "type" },
206
            { "mDataProp": "amount_paid" },
207
            { "mDataProp": "amount_remaining" },
208
            { "mDataProp": "created_on" },
209
            { "mDataProp": "updated_on" }
210
        ],
211
        "aaData": [
212
            [% FOREACH c IN credits %]
213
                {
214
                    [% PROCESS format_data data=c highlight='credit' %]
215
216
                    "account_offsets": [
217
                        [% FOREACH ao IN c.account_offsets %]
218
                            {
219
                                [% PROCESS format_data data=ao highlight='offset' %]
220
221
                                "debit": {
222
                                    [% PROCESS format_data data=ao.debit highlight='debit' %]
223
                                }
224
                            },
225
                        [% END %]
226
                    ]
227
228
                },
229
            [% END %]
230
        ]
231
    } );
232
233
    $('#credits-table td.control').live( 'click', function () {
234
        var nTr = this.parentNode;
235
        var i = $.inArray( nTr, anOpen );
236
237
        if ( i === -1 ) {
238
            $('img', this).attr( 'src', sImageUrl+"details_close.png" );
239
            var nDetailsRow = creditsTable.fnOpen( nTr, fnFormatCreditDetails(creditsTable, nTr), 'details' );
240
            $('div.innerDetails', nDetailsRow).slideDown();
241
            anOpen.push( nTr );
242
        }
243
        else {
244
            $('img', this).attr( 'src', sImageUrl+"details_open.png" );
245
            $('div.innerDetails', $(nTr).next()[0]).slideUp( function () {
246
                creditsTable.fnClose( nTr );
247
                anOpen.splice( i, 1 );
248
            } );
249
        }
250
    } );
251
252
} );
253
254
function fnFormatDebitDetails( debitsTable, nTr ) {
255
    var oData = debitsTable.fnGetData( nTr );
256
257
    var sOut = "<div class='innerDetails' style='display:none;'>";
258
259
    var account_offsets = oData.account_offsets;
260
261
    sOut += "<ul>";
262
    if ( oData.title ) {
263
        sOut += "<li>" + _("Title: ");
264
        if ( oData.biblionumber ) {
265
            sOut += "<a href='/cgi-bin/koha/opac-detail.pl?biblionumber=" + oData.biblionumber + "'>";
266
        }
267
268
        sOut += oData.title;
269
270
        if ( oData.biblionumber ) {
271
            sOut += "</a>";
272
        }
273
274
        sOut += "</li>";
275
    }
276
277
    if ( oData.barcode ) {
278
        sOut += "<li>" + _("Barcode: ") + oData.barcode + "</li>";
279
    }
280
281
    if ( oData.notes ) {
282
        sOut += "<li>" + _("Notes: ") + oData.notes + "</li>";
283
    }
284
285
    sOut += "</ul>";
286
287
    if ( account_offsets.length ) {
288
        sOut +=
289
            "<div class='innerDetails'>" +
290
                "<table cellpadding='5' cellspacing='0' border='0' style='margin:10px;'>" +
291
                    "<thead>" +
292
                        "<tr><th colspan='99'>" + _("Payments applied") + "</th></tr>" +
293
                        "<tr>" +
294
                            "<th>" + _("ID") + "</th>" +
295
                            "<th>" + _("Created on") + "</th>" +
296
                            "<th>" + _("Payment amount") + "</th>" +
297
                            "<th>" + _("Applied amount") + "</th>" +
298
                            "<th>" + _("Type") + "</th>" +
299
                            "<th>" + _("Notes") + "</th>" +
300
                        "</tr>" +
301
                    "</thead>" +
302
                    "<tbody>";
303
304
        for ( var i = 0; i < account_offsets.length; i++ ) {
305
            ao = account_offsets[i];
306
            sOut +=
307
            "<tr>" +
308
                "<td>" + ao.credit_id + "</td>" +
309
                "<td>" + ao.created_on + "</td>" +
310
                "<td>" + ao.credit.amount_paid + "</td>" +
311
                "<td>" + ao.amount + "</td>" +
312
                "<td>" + ao.credit.type + "</td>" +
313
                "<td>" + ao.credit.notes + "</td>" +
314
            "</tr>";
315
        }
316
317
        sOut +=
318
            "</tbody>"+
319
            "</table>";
320
    }
321
322
    sOut +=
323
        "</div>";
324
325
    return sOut;
326
}
327
328
function fnFormatCreditDetails( creditsTable, nTr ) {
329
    var oData = creditsTable.fnGetData( nTr );
330
331
    var sOut = "<div class='innerDetails' style='display:none;'>";
332
333
    var account_offsets = oData.account_offsets;
334
335
    if ( account_offsets.length ) {
336
        sOut +=
337
                "<table cellpadding='5' cellspacing='0' border='0' style='margin:10px;'>" +
338
                    "<thead>" +
339
                        "<tr><th colspan='99'>" + _("Fees paid") + "</th></tr>" +
340
                        "<tr>" +
341
                            "<th>" + _("ID") + "</th>" +
342
                            "<th>" + _("Description") + "</th>" +
343
                            "<th>" + _("Type") + "</th>" +
344
                            "<th>" + _("Amount") + "</th>" +
345
                            "<th>" + _("Remaining") + "</th>" +
346
                            "<th>" + _("Created on") + "</th>" +
347
                            "<th>" + _("Updated on") + "</th>" +
348
                            "<th>" + _("Notes") + "</th>" +
349
                        "</tr>" +
350
                    "</thead>" +
351
                    "<tbody>";
352
353
        for ( var i = 0; i < account_offsets.length; i++ ) {
354
            ao = account_offsets[i];
355
            sOut +=
356
            "<tr>" +
357
                "<td>" + ao.debit.debit_id + "</td>" +
358
                "<td>" + ao.debit.description + "</td>" +
359
                "<td>" + ao.debit.type + "</td>" +
360
                "<td>" + ao.debit.amount_original + "</td>" +
361
                "<td>" + ao.debit.amount_outstanding + "</td>" +
362
                "<td>" + ao.debit.created_on + "</td>" +
363
                "<td>" + ao.debit.updated_on + "</td>" +
364
                "<td>" + ao.debit.notes + "</td>" +
365
            "</tr>";
366
        }
367
368
        sOut +=
369
            "</tbody>"+
370
            "</table>";
371
    }
372
373
    sOut +=
374
        "</div>";
375
376
    return sOut;
377
}
378
379
//]]>
380
</script>
381
93
[% BLOCK jsinclude %][% END %]
382
[% BLOCK jsinclude %][% END %]
383
384
[% BLOCK format_data %]
385
    [% FOREACH key IN data.result_source.columns %]
386
        [% IF key.match('^amount') %]
387
            "[% key %]": "[% data.$key FILTER $Currency %]",
388
        [% ELSIF key.match('_on$') %]
389
            "[% key %]": "[% data.$key | $KohaDates %]",
390
        [% ELSE %]
391
            "[% key %]": "[% data.$key %]",
392
        [% END %]
393
    [% END %]
394
[% END %]
(-)a/opac/opac-account.pl (-33 / +13 lines)
Lines 18-24 Link Here
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
20
21
22
use strict;
21
use strict;
23
use CGI;
22
use CGI;
24
use C4::Members;
23
use C4::Members;
Lines 39-78 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
39
    }
38
    }
40
);
39
);
41
40
42
# get borrower information ....
41
my @debits = Koha::Database->new()->schema->resultset('AccountDebit')->search(
43
my $borr = GetMemberDetails( $borrowernumber );
42
    { 'me.borrowernumber' => $borrowernumber },
44
my @bordat;
43
    { prefetch            => { account_offsets => 'credit' } }
45
$bordat[0] = $borr;
44
);
46
47
$template->param( BORROWER_INFO => \@bordat );
48
49
#get account details
50
my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
51
52
for ( my $i = 0 ; $i < $numaccts ; $i++ ) {
53
    $accts->[$i]{'amount'} = sprintf( "%.2f", $accts->[$i]{'amount'} || '0.00');
54
    if ( $accts->[$i]{'amount'} >= 0 ) {
55
        $accts->[$i]{'amountcredit'} = 1;
56
    }
57
    $accts->[$i]{'amountoutstanding'} =
58
      sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} || '0.00' );
59
    if ( $accts->[$i]{'amountoutstanding'} >= 0 ) {
60
        $accts->[$i]{'amountoutstandingcredit'} = 1;
61
    }
62
}
63
45
64
# add the row parity
46
my @credits = Koha::Database->new()->schema->resultset('AccountCredit')->search(
65
my $num = 0;
47
    { 'me.borrowernumber' => $borrowernumber },
66
foreach my $row (@$accts) {
48
    { prefetch            => { account_offsets => 'debit' } }
67
    $row->{'even'} = 1 if $num % 2 == 0;
49
);
68
    $row->{'odd'}  = 1 if $num % 2 == 1;
69
    $num++;
70
}
71
50
72
$template->param (
51
$template->param(
73
    ACCOUNT_LINES => $accts,
52
    borrower    => GetMemberDetails($borrowernumber),
74
    total => sprintf( "%.2f", $total ),
53
    debits      => \@debits,
75
	accountview => 1
54
    credits     => \@credits,
55
    accountview => 1
76
);
56
);
77
57
78
output_html_with_http_headers $query, $cookie, $template->output;
58
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/opac/opac-user.pl (-14 / +4 lines)
Lines 35-40 use C4::Items; Link Here
35
use C4::Letters;
35
use C4::Letters;
36
use C4::Branch; # GetBranches
36
use C4::Branch; # GetBranches
37
use Koha::DateUtils;
37
use Koha::DateUtils;
38
use Koha::Database;
38
39
39
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
40
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
40
41
Lines 45-50 use Date::Calc qw( Link Here
45
);
46
);
46
47
47
my $query = new CGI;
48
my $query = new CGI;
49
my $schema = Koha::Database->new()->schema();
48
50
49
BEGIN {
51
BEGIN {
50
    if (C4::Context->preference('BakerTaylorEnabled')) {
52
    if (C4::Context->preference('BakerTaylorEnabled')) {
Lines 162-167 my @overdues; Link Here
162
my @issuedat;
164
my @issuedat;
163
my $itemtypes = GetItemTypes();
165
my $itemtypes = GetItemTypes();
164
my $issues = GetPendingIssues($borrowernumber);
166
my $issues = GetPendingIssues($borrowernumber);
167
my $account_debit_rs = $schema->resultset('AccountDebit');
165
if ($issues){
168
if ($issues){
166
    foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
169
    foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
167
        # check for reserves
170
        # check for reserves
Lines 170-188 if ($issues){ Link Here
170
            $issue->{'reserved'} = 1;
173
            $issue->{'reserved'} = 1;
171
        }
174
        }
172
175
173
        my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
176
        $issue->{'charges'} = $account_debit_rs->search({ borrowernumber => $borrowernumber, itemnumber => $issue->{'itemnumber'} })->get_column('amount_outstanding')->sum();
174
        my $charges = 0;
175
        foreach my $ac (@$accts) {
176
            if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
177
                $charges += $ac->{'amountoutstanding'}
178
                  if $ac->{'accounttype'} eq 'F';
179
                $charges += $ac->{'amountoutstanding'}
180
                  if $ac->{'accounttype'} eq 'FU';
181
                $charges += $ac->{'amountoutstanding'}
182
                  if $ac->{'accounttype'} eq 'L';
183
            }
184
        }
185
        $issue->{'charges'} = $charges;
186
        $issue->{'subtitle'} = GetRecordValue('subtitle', GetMarcBiblio($issue->{'biblionumber'}), GetFrameworkCode($issue->{'biblionumber'}));
177
        $issue->{'subtitle'} = GetRecordValue('subtitle', GetMarcBiblio($issue->{'biblionumber'}), GetFrameworkCode($issue->{'biblionumber'}));
187
        # check if item is renewable
178
        # check if item is renewable
188
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
179
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
189
- 

Return to bug 6427