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

(-)a/circ/circulation.pl (-14 lines)
Lines 261-267 if ($findborrower) { Link Here
261
# get the borrower information.....
261
# get the borrower information.....
262
if ($borrowernumber) {
262
if ($borrowernumber) {
263
    $borrower = GetMemberDetails( $borrowernumber, 0 );
263
    $borrower = GetMemberDetails( $borrowernumber, 0 );
264
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
265
264
266
    # Warningdate is the date that the warning starts appearing
265
    # Warningdate is the date that the warning starts appearing
267
    my (  $today_year,   $today_month,   $today_day) = Today();
266
    my (  $today_year,   $today_month,   $today_day) = Today();
Lines 291-302 if ($borrowernumber) { Link Here
291
            $template->param("returnbeforeexpiry" => 1);
290
            $template->param("returnbeforeexpiry" => 1);
292
        }
291
        }
293
    }
292
    }
294
    $template->param(
295
        overduecount => $od,
296
        issuecount   => $issue,
297
        finetotal    => $fines
298
    );
299
300
    if ( IsDebarred($borrowernumber) ) {
293
    if ( IsDebarred($borrowernumber) ) {
301
        $template->param(
294
        $template->param(
302
            'userdebarred'    => $borrower->{debarred},
295
            'userdebarred'    => $borrower->{debarred},
Lines 411-419 if (@$barcodes) { Link Here
411
        }
404
        }
412
    }
405
    }
413
406
414
    # FIXME If the issue is confirmed, we launch another time GetMemberIssuesAndFines, now display the issue count after issue
415
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines($borrowernumber);
416
417
    if ($question->{RESERVE_WAITING} or $question->{RESERVED}){
407
    if ($question->{RESERVE_WAITING} or $question->{RESERVED}){
418
        $template->param(
408
        $template->param(
419
            reserveborrowernumber => $question->{'resborrowernumber'}
409
            reserveborrowernumber => $question->{'resborrowernumber'}
Lines 424-433 if (@$barcodes) { Link Here
424
        itembiblionumber => $getmessageiteminfo->{'biblionumber'}
414
        itembiblionumber => $getmessageiteminfo->{'biblionumber'}
425
    );
415
    );
426
416
427
428
429
    $template_params->{issuecount} = $issue;
430
431
    if ( $iteminfo ) {
417
    if ( $iteminfo ) {
432
        $iteminfo->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($iteminfo->{biblionumber}), GetFrameworkCode($iteminfo->{biblionumber}));
418
        $iteminfo->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($iteminfo->{biblionumber}), GetFrameworkCode($iteminfo->{biblionumber}));
433
        $template_params->{item} = $iteminfo;
419
        $template_params->{item} = $iteminfo;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc (-10 / +6 lines)
Lines 1-14 Link Here
1
[% USE Price %]
1
<script type="text/javascript">
2
[% SET NoIssuesCharge = Koha.Preference('noissuescharge') %]
2
KOHA.Checkouts.BorrowerNumber = [% borrowernumber %];
3
3
KOHA.Checkouts.NoIssuesCharge = [% Koha.Preference('noissuescharge') || "null" %];
4
[% IF NoIssuesCharge && fines > NoIssuesCharge %]
4
</script>
5
    <li>
5
    <li id="outstanding-fees" style="display: none;">
6
        <span class="circ-hlt">Fees &amp; Charges:</span>
6
        <span class="circ-hlt">Fees &amp; Charges:</span>
7
        Patron has <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">
7
        Patron has <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">
8
            Outstanding fees &amp; charges
8
            Outstanding fees &amp; charges of <span id="outstanding-fees-amount"></span>
9
            [% IF ( fines ) %]
10
                of [% fines | $Price %]
11
            [% END %]
12
        </a>.
9
        </a>.
13
10
14
        [% IF !Koha.Preference('AllowFineOverride') %]
11
        [% IF !Koha.Preference('AllowFineOverride') %]
Lines 19-22 Link Here
19
        or
16
        or
20
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% borrowernumber %]">Pay all fines</a></li>
17
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% borrowernumber %]">Pay all fines</a></li>
21
    </li>
18
    </li>
22
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc (-4 / +3 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
<div id="checkouts">
2
<div id="checkouts">
3
    [% IF ( issuecount ) %]
3
    <div class="has-checkouts" style="display: none;">
4
        <div id="issues-table-loading-message">
4
        <div id="issues-table-loading-message">
5
            <p>
5
            <p>
6
                <a id="issues-table-load-now-button" href="#" class="btn"><i class="fa fa-book"></i> Show checkouts</a>
6
                <a id="issues-table-load-now-button" href="#" class="btn"><i class="fa fa-book"></i> Show checkouts</a>
Lines 69-75 Link Here
69
                [% END %]
69
                [% END %]
70
            </div>
70
            </div>
71
        </form>
71
        </form>
72
    [% ELSE %]
72
    </div>
73
        <p>Patron has nothing checked out.</p>
73
    <p class="no-checkouts" style="display: none;">Patron has nothing checked out.</p>
74
    [% END %]
75
</div>
74
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-46 / +26 lines)
Lines 23-28 Link Here
23
[% INCLUDE 'strings.inc' %]
23
[% INCLUDE 'strings.inc' %]
24
[% INCLUDE 'datatables.inc' %]
24
[% INCLUDE 'datatables.inc' %]
25
[% INCLUDE 'columns_settings.inc' %]
25
[% INCLUDE 'columns_settings.inc' %]
26
<style>
27
.issue-allow, .issue-disallow, #mainform {display: none;}
28
</style>
26
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
29
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
27
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
30
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
28
[% INCLUDE 'timepicker.inc' %]
31
[% INCLUDE 'timepicker.inc' %]
Lines 81-86 function toggle_onsite_checkout(){ Link Here
81
function Dopop(link) {
84
function Dopop(link) {
82
    var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
85
    var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
83
}
86
}
87
88
KOHA.Checkouts.DisallowIssue = [% noissues ? "true" : "false" %];
89
KOHA.Checkouts.ForceAllowIssue = [% forceallow ? "true" : "false" %];
90
KOHA.Checkouts.ForceOnSiteCheckouts = [% Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ? "true" : "false" %];
84
$(document).ready(function() {
91
$(document).ready(function() {
85
    $('#mainform').on('submit',function() {
92
    $('#mainform').on('submit',function() {
86
        if ($("#barcode") && $("#barcode").val()) {
93
        if ($("#barcode") && $("#barcode").val()) {
Lines 390-398 $(document).ready(function() { Link Here
390
</form>
397
</form>
391
398
392
[% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
399
[% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
393
    [% UNLESS noissues %]
400
        <button class="issue-allow" type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
394
        <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
395
    [% END %]
396
[% END %]
401
[% END %]
397
</div></div>
402
</div></div>
398
[% END %] <!-- NEEDSCONFIRMATION -->
403
[% END %] <!-- NEEDSCONFIRMATION -->
Lines 559-565 No patron matched <span class="ex">[% message %]</span> Link Here
559
    <div class="dialog alert"><strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.</div>
564
    <div class="dialog alert"><strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.</div>
560
[% END %]
565
[% END %]
561
566
562
[% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
563
<div class="yui-u first">
567
<div class="yui-u first">
564
568
565
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
569
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
Lines 592-598 No patron matched <span class="ex">[% message %]</span> Link Here
592
596
593
    <div class="checkout-settings">
597
    <div class="checkout-settings">
594
598
595
        [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
596
            [% IF ( SpecifyDueDate ) %]
599
            [% IF ( SpecifyDueDate ) %]
597
                <div id="specify-due-date" class="checkout-setting">
600
                <div id="specify-due-date" class="checkout-setting">
598
                    <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
601
                    <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
Lines 610-619 No patron matched <span class="ex">[% message %]</span> Link Here
610
                    <button class="btn btn-small action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
613
                    <button class="btn btn-small action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
611
                </div>
614
                </div>
612
            [% END %]
615
            [% END %]
613
        [% END %]
614
616
615
        [% UNLESS ( noissues ) %]
617
            <div id="set-automatic-renewal" class="checkout-setting issue-allow">
616
            <div id="set-automatic-renewal" class="checkout-setting">
617
                [% IF NEEDSCONFIRMATION %]
618
                [% IF NEEDSCONFIRMATION %]
618
                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
619
                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
619
                [% ELSE %]
620
                [% ELSE %]
Lines 640-658 No patron matched <span class="ex">[% message %]</span> Link Here
640
                    <label for="override_high_holds">Don't decrease checkout length based on holds</label>
641
                    <label for="override_high_holds">Don't decrease checkout length based on holds</label>
641
                </div>
642
                </div>
642
            [% END %]
643
            [% END %]
643
        [% END %]
644
644
645
        [% IF Koha.Preference('OnSiteCheckouts') %]
645
        [% IF Koha.Preference('OnSiteCheckouts') %]
646
            <div id="onsite_checkout-select" class="checkout-setting">
646
            <div id="onsite_checkout-select" class="checkout-setting">
647
                [% IF noissues %]
647
                    <div class="onsite-checkout-only issue-disallow">
648
                    <div class="onsite-checkout-only">
649
                        <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
648
                        <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
650
                        <input type="text" name="duedatespec" id="duedatespec" readonly="readonly" />
649
                        <input type="text" name="duedatespec" id="duedatespec" readonly="readonly" />
651
                        <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
650
                        <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
652
                    </div>
651
                    </div>
653
                [% ELSE %]
652
                    <div class="issue-allow">
654
                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
653
                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
655
                [% END %]
654
                    </div>
656
            </div>
655
            </div>
657
        [% END %]
656
        [% END %]
658
657
Lines 674-708 No patron matched <span class="ex">[% message %]</span> Link Here
674
[% END %]
673
[% END %]
675
</form></div>
674
</form></div>
676
675
677
[% END %]<!-- /unless noissues -->
678
679
[% IF ( noissues ) %]
680
    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
681
        <div class="yui-u">
682
    [% ELSE %]
683
        <div>
684
    [% END %]
685
[% ELSE %]
686
    <div class="yui-u">
676
    <div class="yui-u">
687
[% END %]
677
        <div id="circmessages" class="circmessage attention">
688
678
            <h3>Attention:</h3>
689
        [% IF ( noissues ) %]
679
            <div class="issue-disallow">
690
            [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
680
            [% IF !( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
691
                <div id="circmessages" class="circmessage attention">
692
            [% ELSE %]
693
                <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
681
                <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
694
                <div id="circmessages" class="circmessage warning">
695
            [% END %]
682
            [% END %]
696
            <h3>
683
                <h3>
697
                Cannot check out!
684
                    Cannot check out!
698
                [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
685
                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
699
                    <span class="circ-hlt">Only on-site checkouts are allowed</span>
686
                        <span class="circ-hlt">Only on-site checkouts are allowed</span>
700
                [% END %]
687
                    [% END %]
701
            </h3>
688
                </h3>
702
        [% ELSE %]
689
            </div>
703
            <div id="circmessages" class="circmessage attention">
704
                <h3>Attention:</h3>
705
        [% END %]
706
690
707
		<ul>
691
		<ul>
708
692
Lines 761-768 No patron matched <span class="ex">[% message %]</span> Link Here
761
745
762
                   <br/>
746
                   <br/>
763
                   <a class="btn btn-small" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
747
                   <a class="btn btn-small" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
764
                    [% IF (noissues && borrowernumber && CAN_user_circulate_force_checkout) %]
748
                    [% IF (borrowernumber && CAN_user_circulate_force_checkout) %]
765
                        <span class="override_debarment">
749
                        <span class="override_debarment issue-disallow">
766
                            <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% borrowernumber %]" class="btn btn-small">Override restriction temporarily</a>
750
                            <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% borrowernumber %]" class="btn btn-small">Override restriction temporarily</a>
767
                        </span>
751
                        </span>
768
                    [% END %]
752
                    [% END %]
Lines 861-871 No patron matched <span class="ex">[% message %]</span> Link Here
861
845
862
<ul>
846
<ul>
863
    <li>
847
    <li>
864
        [% IF ( issuecount ) %]
848
            <a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a>
865
            <a href="#checkouts">[% issuecount %] Checkout(s)</a>
866
        [% ELSE %]
867
            <a href="#checkouts">0 Checkouts</a>
868
        [% END %]
869
    </li>
849
    </li>
870
850
871
    [% IF relatives_issues_count %]
851
    [% IF relatives_issues_count %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-4 / +2 lines)
Lines 175-183 function validate1(date) { Link Here
175
[% ELSE %]
175
[% ELSE %]
176
    [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry | $KohaDates %]</div>[% END %]
176
    [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry | $KohaDates %]</div>[% END %]
177
177
178
    [% IF fines %]
178
    [% INCLUDE 'blocked-fines.inc' %]
179
        [% INCLUDE 'blocked-fines.inc' %]
180
    [% END %]
181
179
182
    [% IF ( flagged ) %]
180
    [% IF ( flagged ) %]
183
    <div id="circmessages" class="circmessage attention">
181
    <div id="circmessages" class="circmessage attention">
Lines 467-473 function validate1(date) { Link Here
467
465
468
<div id="finesholdsissues" class="toptabs">
466
<div id="finesholdsissues" class="toptabs">
469
    <ul>
467
    <ul>
470
        <li><a href="#checkouts">[% issuecount %] Checkout(s)</a></li>
468
        <li><a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a></li>
471
        [% IF relatives_issues_count %]
469
        [% IF relatives_issues_count %]
472
            <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li>
470
            <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li>
473
        [% END %]
471
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (+39 lines)
Lines 1-6 Link Here
1
if ( KOHA === undefined ) var KOHA = {};
2
KOHA.Checkouts = {
3
    NoIssuesCharge: null,
4
    BorrowerNumber: null,
5
    DisallowIssue: false,
6
    ForceAllowIssue: false,
7
    ForceOnSiteCheckouts: false,
8
    ToggleInput: function( allow_issue ) {
9
        if (KOHA.Checkouts.DisallowIssue) allow_issue = false;
10
        if (KOHA.Checkouts.ForceAllowIssue) allow_issue = true;
11
12
        $(".issue-allow").toggle(allow_issue);
13
        $(".issue-disallow").toggle(!allow_issue);
14
        $("#mainform").toggle(allow_issue || KOHA.Checkouts.ForceOnSiteCheckouts);
15
16
        if (!allow_issue) {
17
            $(".circmessage.attention").removeClass("attention").addClass("warning");
18
        }
19
    },
20
    UpdateCheckoutsAndFees: function(checkouts_only=false) {
21
        $.get( "/cgi-bin/koha/svc/patron/fines", {borrowernumber: KOHA.Checkouts.BorrowerNumber}, function( data ) {
22
            $("#issuecount").text(data.issuecount);
23
            var has_checkouts = data.issuecount > 0;
24
            $(".has-checkouts").toggle(has_checkouts);
25
            $(".no-checkouts").toggle(!has_checkouts);
26
            if (checkouts_only) return;
27
28
            var noissue = KOHA.Checkouts.NoIssuesCharge && data.owing >= KOHA.Checkouts.NoIssuesCharge;
29
            $("#outstanding-fees").toggle(noissue);
30
            $("#outstanding-fees-amount").text(data.owing_formatted);
31
            KOHA.Checkouts.ToggleInput(!noissue);
32
        } );
33
    }
34
}
35
1
$(document).ready(function() {
36
$(document).ready(function() {
2
    $.ajaxSetup ({ cache: false });
37
    $.ajaxSetup ({ cache: false });
3
38
39
    KOHA.Checkouts.UpdateCheckoutsAndFees();
40
4
    var barcodefield = $("#barcode");
41
    var barcodefield = $("#barcode");
5
    var issuesTable;
42
    var issuesTable;
6
43
Lines 65-70 $(document).ready(function() { Link Here
65
102
66
                content = "";
103
                content = "";
67
                if ( data.returned ) {
104
                if ( data.returned ) {
105
                    KOHA.Checkouts.UpdateCheckoutsAndFees(true);
68
                    content = CIRCULATION_RETURNED;
106
                    content = CIRCULATION_RETURNED;
69
                    $(id).parent().parent().addClass('ok');
107
                    $(id).parent().parent().addClass('ok');
70
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
108
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
Lines 97-102 $(document).ready(function() { Link Here
97
135
98
                var content = "";
136
                var content = "";
99
                if ( data.renew_okay ) {
137
                if ( data.renew_okay ) {
138
                    KOHA.Checkouts.UpdateCheckoutsAndFees();
100
                    issuesTable.api().ajax.reload();
139
                    issuesTable.api().ajax.reload();
101
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
140
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
102
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
141
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
(-)a/members/moremember.pl (-3 lines)
Lines 115-123 my $borrowernumber = $input->param('borrowernumber'); Link Here
115
my $error = $input->param('error');
115
my $error = $input->param('error');
116
$template->param( error => $error ) if ( $error );
116
$template->param( error => $error ) if ( $error );
117
117
118
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines($borrowernumber);
119
$template->param( issuecount => $issue, fines => $fines );
120
121
my $data = GetMember( 'borrowernumber' => $borrowernumber );
118
my $data = GetMember( 'borrowernumber' => $borrowernumber );
122
119
123
if ( not defined $data ) {
120
if ( not defined $data ) {
(-)a/svc/patron/fines (-1 / +40 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright 2016 CatalystIT
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use strict;
21
use warnings;
22
23
use C4::Service;
24
use C4::Members qw/GetMemberIssuesAndFines/;
25
use Koha::Number::Price;
26
27
my ( $query, $response ) = C4::Service->init( borrowers => '*' );
28
29
my $borrowernumber = $query->param('borrowernumber');
30
31
my ( $od, $issue, $owing ) = GetMemberIssuesAndFines( $borrowernumber );
32
33
$response->param(
34
    overduecount    => $od,
35
    issuecount      => $issue,
36
    owing           => $owing || 0.00,
37
    owing_formatted => Koha::Number::Price->new( $owing )->format,
38
);
39
40
C4::Service->return_success( $response );

Return to bug 14803