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

(-)a/circ/circulation.pl (-31 lines)
Lines 253-270 if ($findborrower) { Link Here
253
}
253
}
254
254
255
# get the borrower information.....
255
# get the borrower information.....
256
my $balance = 0;
257
$patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
256
$patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
258
if ($patron) {
257
if ($patron) {
259
258
260
    $template->param( borrowernumber => $patron->borrowernumber );
259
    $template->param( borrowernumber => $patron->borrowernumber );
261
    output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
260
    output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
262
261
263
    my $overdues = $patron->get_overdues;
264
    my $issues = $patron->checkouts;
265
    $balance = $patron->account->balance;
266
267
268
    # if the expiry date is before today ie they have expired
262
    # if the expiry date is before today ie they have expired
269
    if ( $patron->is_expired ) {
263
    if ( $patron->is_expired ) {
270
        #borrowercard expired, no issues
264
        #borrowercard expired, no issues
Lines 283-293 if ($patron) { Link Here
283
            $template->param("returnbeforeexpiry" => 1);
277
            $template->param("returnbeforeexpiry" => 1);
284
        }
278
        }
285
    }
279
    }
286
    $template->param(
287
        overduecount => $overdues->count,
288
        issuecount   => $issues->count,
289
        finetotal    => $balance,
290
    );
291
280
292
    if ( $patron and $patron->is_debarred ) {
281
    if ( $patron and $patron->is_debarred ) {
293
        $template->param(
282
        $template->param(
Lines 429-439 if (@$barcodes) { Link Here
429
        );
418
        );
430
    }
419
    }
431
420
432
433
    # FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue
434
    $patron = Koha::Patrons->find( $borrowernumber );
435
    $template_params->{issuecount} = $patron->checkouts->count;
436
437
    if ( $item ) {
421
    if ( $item ) {
438
        $template_params->{item} = $item;
422
        $template_params->{item} = $item;
439
        $template_params->{biblio} = $biblio;
423
        $template_params->{biblio} = $biblio;
Lines 479-498 if ( $patron ) { Link Here
479
        $template->param( dbarred=> 1 );
463
        $template->param( dbarred=> 1 );
480
        $noissues = 1;
464
        $noissues = 1;
481
    }
465
    }
482
    my $account = $patron->account;
483
    if( ( my $owing = $account->non_issues_charges ) > 0 ) {
484
        my $noissuescharge = C4::Context->preference("noissuescharge") || 5; # FIXME If noissuescharge == 0 then 5, why??
485
        $noissues ||= ( not C4::Context->preference("AllowFineOverride") and ( $owing > $noissuescharge ) );
486
        $template->param(
487
            charges => 1,
488
            chargesamount => $owing,
489
        )
490
    } elsif ( $balance < 0 ) {
491
        $template->param(
492
            credits => 1,
493
            creditsamount => -$balance,
494
        );
495
    }
496
466
497
    # Check the debt of this patrons guarantors *and* the guarantees of those guarantors
467
    # Check the debt of this patrons guarantors *and* the guarantees of those guarantors
498
    my $no_issues_charge_guarantors = C4::Context->preference("NoIssuesChargeGuarantorsWithGuarantees");
468
    my $no_issues_charge_guarantors = C4::Context->preference("NoIssuesChargeGuarantorsWithGuarantees");
Lines 610-616 $template->param( Link Here
610
    duedatespec       => $duedatespec,
580
    duedatespec       => $duedatespec,
611
    restoreduedatespec => $restoreduedatespec,
581
    restoreduedatespec => $restoreduedatespec,
612
    message           => $message,
582
    message           => $message,
613
    totaldue          => sprintf('%.2f', $balance), # FIXME not used in template?
614
    inprocess         => $inprocess,
583
    inprocess         => $inprocess,
615
    $view             => 1,
584
    $view             => 1,
616
    batch_allowed     => $batch_allowed,
585
    batch_allowed     => $batch_allowed,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc (-8 / +4 lines)
Lines 1-13 Link Here
1
[% USE Price %]
1
    <li class="outstanding-fees" style="display: none;">
2
[% SET NoIssuesCharge = Koha.Preference('noissuescharge') %]
3
[% IF fines and fines > 0 %]
4
    <li>
5
        <span class="circ-hlt">Charges:</span>
2
        <span class="circ-hlt">Charges:</span>
6
        Patron has outstanding charges of [% fines | $Price %].
3
        Patron has outstanding fees &amp; charges of <span class="outstanding-fees-amount"></span>
7
        [% IF !Koha.Preference('AllowFineOverride') && NoIssuesCharge && fines > NoIssuesCharge %]
4
        [% IF !Koha.Preference('AllowFineOverride') %]
8
           <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
5
           <span class="circ-hlt" class="outstanding-fees-over-limit" style="display: none;">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
9
        [% END %]
6
        [% END %]
10
        <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default btn-xs" >Make payment</a>
7
        <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default btn-xs" >Make payment</a>
11
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default btn-xs" >Pay all fines</a></li>
8
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default btn-xs" >Pay all fines</a></li>
12
    </li>
9
    </li>
13
[% 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 btn-default"><i class="fa fa-book"></i> Show checkouts</a>
6
                <a id="issues-table-load-now-button" href="#" class="btn btn-default"><i class="fa fa-book"></i> Show checkouts</a>
Lines 86-94 Link Here
86
                [% END %]
86
                [% END %]
87
            </div>
87
            </div>
88
        </form>
88
        </form>
89
    [% ELSE %]
89
    </div>
90
        <p>Patron has nothing checked out.</p>
90
    <p class="no-checkouts" style="display: none;">Patron has nothing checked out.</p>
91
    [% END %]
92
</div>
91
</div>
93
92
94
<!-- Claims Returned Modal -->
93
<!-- Claims Returned Modal -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts.inc (+10 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% Asset.js("js/checkouts.js") | $raw %]
3
<script type="text/javascript">
4
$(document).ready(function() {
5
    KOHA.Checkouts.init([% patron.borrowernumber %], [% Koha.Preference('noissuescharge') || "null" %]);
6
    [% IF Koha.Preference('AllowFineOverride') %] KOHA.Checkouts.AllowFineOverride = true; [% END %]
7
    [% IF noissues && !forceallow %] KOHA.Checkouts.DisallowIssue = true; [% END %]
8
    [% IF Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') %] KOHA.Checkouts.ForceOnSiteCheckouts = true; [% END %]
9
});
10
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-39 / +17 lines)
Lines 9-14 Link Here
9
[% USE Price %]
9
[% USE Price %]
10
[% USE AuthorisedValues %]
10
[% USE AuthorisedValues %]
11
[% SET footerjs = 1 %]
11
[% SET footerjs = 1 %]
12
[% SET show_barcode_input = (Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce')) || !noissues || forceallow %]
12
[% INCLUDE 'doc-head-open.inc' %]
13
[% INCLUDE 'doc-head-open.inc' %]
13
[% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
14
[% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
14
[% SET destination = "circ" %]
15
[% SET destination = "circ" %]
Lines 19-24 Link Here
19
    [% END %]
20
    [% END %]
20
</title>
21
</title>
21
[% INCLUDE 'doc-head-close.inc' %]
22
[% INCLUDE 'doc-head-close.inc' %]
23
<style>
24
.issue-allow, .issue-disallow {display: none;}
25
[% IF !show_barcode_input %]#mainform {display: none;}[% END %]
26
</style>
22
</head>
27
</head>
23
28
24
<body id="circ_circulation" class="circ">
29
<body id="circ_circulation" class="circ">
Lines 305-313 Link Here
305
                            </form>
310
                            </form>
306
311
307
                            [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
312
                            [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
308
                                [% UNLESS noissues %]
309
                                    <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber | html %]&borrowernumber=[% patron.borrowernumber | html %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
313
                                    <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber | html %]&borrowernumber=[% patron.borrowernumber | html %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
310
                                [% END %]
311
                            [% END %]
314
                            [% END %]
312
                        </div> <!-- /#circ_needsconfirmation -->
315
                        </div> <!-- /#circ_needsconfirmation -->
313
                    [% END # /NEEDSCONFIRMATION %]
316
                    [% END # /NEEDSCONFIRMATION %]
Lines 519-525 Link Here
519
                            [% END %]
522
                            [% END %]
520
523
521
                            <div class="row">
524
                            <div class="row">
522
                                [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
523
                                    <div class="col-sm-6">
525
                                    <div class="col-sm-6">
524
                                        <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
526
                                        <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
525
                                            <input type="hidden" name="restoreduedatespec" />
527
                                            <input type="hidden" name="restoreduedatespec" />
Lines 558-564 Link Here
558
560
559
                                            <div class="circ-settings">
561
                                            <div class="circ-settings">
560
562
561
                                                    [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
562
                                                        [% IF ( SpecifyDueDate ) %]
563
                                                        [% IF ( SpecifyDueDate ) %]
563
                                                            <div id="specify-due-date" class="circ-setting">
564
                                                            <div id="specify-due-date" class="circ-setting">
564
                                                                <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
565
                                                                <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
Lines 576-585 Link Here
576
                                                                <button class="btn btn-default btn-xs 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>
577
                                                                <button class="btn btn-default btn-xs 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>
577
                                                            </div>
578
                                                            </div>
578
                                                        [% END %]
579
                                                        [% END %]
579
                                                    [% END %]
580
580
581
                                                    [% UNLESS ( noissues ) %]
581
                                                        <div id="set-automatic-renewal" class="circ-setting issue-allow">
582
                                                        <div id="set-automatic-renewal" class="circ-setting">
583
                                                            [% IF NEEDSCONFIRMATION %]
582
                                                            [% IF NEEDSCONFIRMATION %]
584
                                                                [% IF auto_renew %]
583
                                                                [% IF auto_renew %]
585
                                                                    [% IF patron.autorenew_checkouts %]
584
                                                                    [% IF patron.autorenew_checkouts %]
Lines 622-644 Link Here
622
                                                                <label for="override_high_holds">Don't decrease checkout length based on holds</label>
621
                                                                <label for="override_high_holds">Don't decrease checkout length based on holds</label>
623
                                                            </div>
622
                                                            </div>
624
                                                        [% END %]
623
                                                        [% END %]
625
                                                    [% END %]
626
624
627
                                                    [% IF Koha.Preference('OnSiteCheckouts') %]
625
                                                    [% IF Koha.Preference('OnSiteCheckouts') %]
628
                                                        <div id="onsite_checkout-select" class="circ-setting">
626
                                                        <div id="onsite_checkout-select" class="circ-setting">
629
                                                            [% IF noissues %]
627
                                                                <div class="onsite-checkout-only issue-disallow">
630
                                                                <div class="onsite-checkout-only">
631
                                                                    <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>
628
                                                                    <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>
632
                                                                    <input type="text" name="duedatespec" id="duedatespec" />
629
                                                                    <input type="text" name="duedatespec" id="duedatespec" />
633
                                                                    <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
630
                                                                    <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
634
                                                                </div>
631
                                                                </div>
635
                                                            [% ELSE %]
632
                                                                <div class="issue-allow">
636
                                                                [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
633
                                                                [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
637
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
634
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
638
                                                                [% ELSE %]
635
                                                                [% ELSE %]
639
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
636
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
640
                                                                [% END %]
637
                                                                [% END %]
641
                                                            [% END %]
638
                                                                </div>
642
                                                        </div>
639
                                                        </div>
643
                                                    [% END %]
640
                                                    [% END %]
644
641
Lines 660-683 Link Here
660
                                        </form> <!-- /#mainform -->
657
                                        </form> <!-- /#mainform -->
661
                                    </div> <!-- /.col-sm-6 -->
658
                                    </div> <!-- /.col-sm-6 -->
662
659
663
                                [% END #/IF !noissues %]
664
665
                                [% IF ( noissues ) %]
666
                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
667
                                        <div class="col-sm-6">
668
                                    [% ELSE %]
669
                                        <div>
670
                                    [% END %]
671
                                [% ELSE %]
672
                                    <div class="col-sm-6">
660
                                    <div class="col-sm-6">
673
                                [% END %]
674
661
675
                                [% IF ( noissues ) %]
662
                                <div id="circmessages" class="circmessage attention">
663
                                    <h3>Attention:</h3>
664
                                    <div class="issue-disallow">
676
                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
665
                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
677
                                        <div id="circmessages" class="circmessage attention">
678
                                    [% ELSE %]
679
                                        <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
666
                                        <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
680
                                        <div id="circmessages" class="circmessage warning">
681
                                    [% END %]
667
                                    [% END %]
682
                                    <h3>
668
                                    <h3>
683
                                        Cannot check out!
669
                                        Cannot check out!
Lines 685-694 Link Here
685
                                            <span class="circ-hlt">Only on-site checkouts are allowed</span>
671
                                            <span class="circ-hlt">Only on-site checkouts are allowed</span>
686
                                        [% END %]
672
                                        [% END %]
687
                                    </h3>
673
                                    </h3>
688
                                [% ELSE %]
674
                                    </div>
689
                                    <div id="circmessages" class="circmessage attention">
690
                                        <h3>Attention:</h3>
691
                                [% END %]
692
675
693
                                <ul>
676
                                <ul>
694
                                    [% IF ( has_modifications ) %]
677
                                    [% IF ( has_modifications ) %]
Lines 752-759 Link Here
752
                                            <br/>
735
                                            <br/>
753
                                            <a class="btn btn-default" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
736
                                            <a class="btn btn-default" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
754
737
755
                                            [% IF (noissues && patron && CAN_user_circulate_force_checkout) %]
738
                                            [% IF (patron && CAN_user_circulate_force_checkout) %]
756
                                                <span class="override_debarment">
739
                                                <span class="override_debarment issue-disallow">
757
                                                    <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default">Override restriction temporarily</a>
740
                                                    <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default">Override restriction temporarily</a>
758
                                                </span>
741
                                                </span>
759
                                            [% END %]
742
                                            [% END %]
Lines 770-776 Link Here
770
                                        <li><span class="circ-hlt return-claims">Return claims: Patron has [% return_claims.count | html %] RETURN CLAIMS.</span>
753
                                        <li><span class="circ-hlt return-claims">Return claims: Patron has [% return_claims.count | html %] RETURN CLAIMS.</span>
771
                                    [% END %]
754
                                    [% END %]
772
755
773
774
                                    [% IF age_limitations %]
756
                                    [% IF age_limitations %]
775
                                        [% INCLUDE 'category-out-of-age-limit.inc' %]
757
                                        [% INCLUDE 'category-out-of-age-limit.inc' %]
776
                                    [% END %]
758
                                    [% END %]
Lines 866-876 Link Here
866
                    <div id="patronlists" class="toptabs">
848
                    <div id="patronlists" class="toptabs">
867
                        <ul>
849
                        <ul>
868
                            <li>
850
                            <li>
869
                                [% IF ( issuecount ) %]
851
                                <a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a>
870
                                    <a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
871
                                [% ELSE %]
872
                                    <a href="#checkouts">0 Checkouts</a>
873
                                [% END %]
874
                            </li>
852
                            </li>
875
853
876
                            [% IF relatives_issues_count %]
854
                            [% IF relatives_issues_count %]
Lines 1096-1102 Link Here
1096
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
1074
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
1097
    </script>
1075
    </script>
1098
    [% Asset.js("js/pages/circulation.js") | $raw %]
1076
    [% Asset.js("js/pages/circulation.js") | $raw %]
1099
    [% Asset.js("js/checkouts.js") | $raw %]
1077
    [% INCLUDE 'checkouts.inc' %]
1100
    [% Asset.js("js/holds.js") | $raw %]
1078
    [% Asset.js("js/holds.js") | $raw %]
1101
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1079
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1102
    <script>
1080
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-15 / +6 lines)
Lines 70-87 Link Here
70
                            </div>
70
                            </div>
71
                        [% END %]
71
                        [% END %]
72
72
73
                        [% IF fines || age_limitations %]
74
                            <div id="circmessages" class="circmessage attention">
73
                            <div id="circmessages" class="circmessage attention">
75
                                <ul>
74
                                <ul>
76
                                    [% IF fines %]
77
                                        [% INCLUDE 'blocked-fines.inc' %]
75
                                        [% INCLUDE 'blocked-fines.inc' %]
78
                                    [% END %]
79
                                    [% IF age_limitations %]
76
                                    [% IF age_limitations %]
80
                                        [% INCLUDE 'category-out-of-age-limit.inc' %]
77
                                        [% INCLUDE 'category-out-of-age-limit.inc' %]
81
                                    [% END %]
78
                                    [% END %]
82
                                </ul>
79
                                </ul>
83
                            </div>
80
                            </div>
84
                        [% END %]
85
81
86
                        [% IF ( patron_messages ) %]
82
                        [% IF ( patron_messages ) %]
87
                            <div id="messages" class="circmessage">
83
                            <div id="messages" class="circmessage">
Lines 729-735 Link Here
729
                    <div id="finesholdsissues" class="toptabs">
725
                    <div id="finesholdsissues" class="toptabs">
730
                        <ul>
726
                        <ul>
731
                            <li>
727
                            <li>
732
                                <a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
728
                                <a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a>
733
                            </li>
729
                            </li>
734
                            [% IF relatives_issues_count %]
730
                            [% IF relatives_issues_count %]
735
                                <li>
731
                                <li>
Lines 801-815 Link Here
801
797
802
                        [% INCLUDE "relatives-issues-table.inc" %]
798
                        [% INCLUDE "relatives-issues-table.inc" %]
803
799
804
                        [% IF ( fines ) %]
800
                        <div id="finesandcharges">
805
                            <div id="finesandcharges">
801
                            <p class="outstanding-fees" style="display: none;">Total due: <span class="outstanding-fees-amount"></p>
806
                                [% IF ( fines ) %]
802
                            <p class="no-outstanding-fees">No outstanding charges</p>
807
                                    <p>Total due: [% fines | $Price %]</p>
803
                        </div>
808
                                [% ELSE %]
809
                                    <p>No outstanding charges</p>
810
                                [% END %]
811
                            </div>
812
                        [% END %]
813
804
814
                        [% IF CAN_user_clubs && ( enrollments.count || enrollable.count ) %]
805
                        [% IF CAN_user_clubs && ( enrollments.count || enrollable.count ) %]
815
                            <div id="clubs-tab">
806
                            <div id="clubs-tab">
Lines 937-943 Link Here
937
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
928
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
938
    </script>
929
    </script>
939
    [% Asset.js("js/pages/circulation.js") | $raw %]
930
    [% Asset.js("js/pages/circulation.js") | $raw %]
940
    [% Asset.js("js/checkouts.js") | $raw %]
931
    [% INCLUDE 'checkouts.inc' %]
941
    [% Asset.js("js/holds.js") | $raw %]
932
    [% Asset.js("js/holds.js") | $raw %]
942
    [% INCLUDE 'str/members-menu.inc' %]
933
    [% INCLUDE 'str/members-menu.inc' %]
943
    [% Asset.js("js/members-menu.js") | $raw %]
934
    [% Asset.js("js/members-menu.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-2 / +48 lines)
Lines 1-5 Link Here
1
/* global __ */
1
/* global __ */
2
2
3
if ( KOHA === undefined ) var KOHA = {};
4
KOHA.Checkouts = {
5
    BorrowerNumber: null,
6
    NoIssuesCharge: null,
7
    AllowFineOverride: false,
8
    DisallowIssue: false,
9
    ForceOnSiteCheckouts: false,
10
    ToggleInput: function( allow_issue ) {
11
        if (this.AllowFineOverride) allow_issue = true;
12
        if (this.DisallowIssue) allow_issue = false;
13
14
        $(".issue-allow").toggle(allow_issue);
15
        $(".issue-disallow").toggle(!allow_issue);
16
        $("#mainform").toggle(allow_issue || this.ForceOnSiteCheckouts);
17
18
        if (!allow_issue) {
19
            $(".circmessage.attention").removeClass("attention").addClass("warning");
20
        }
21
    },
22
    UpdateCheckoutsAndFees: function() {
23
        var self = this;
24
        $.get( "/cgi-bin/koha/svc/fines", {borrowernumber: this.BorrowerNumber}, function( data ) {
25
            $("#issuecount").text(data.issuecount);
26
            var has_checkouts = data.issuecount > 0;
27
            $(".has-checkouts").toggle(has_checkouts);
28
            $(".no-checkouts").toggle(!has_checkouts);
29
30
            var has_outstanding = data.balance > 0;
31
            var noissue = this.NoIssuesCharge !== null && data.balance >= this.NoIssuesCharge;
32
            $(".outstanding-fees").toggle(has_outstanding);
33
            $(".no-outstanding-fees").toggle(!has_outstanding);
34
            $(".outstanding-fees-amount").text(data.balance_formatted);
35
            $(".outstanding-fees-over-limit").toggle(noissue);
36
            self.ToggleInput(!noissue);
37
        } );
38
    },
39
    init: function(borrowernumber, noissuescharge) {
40
        this.BorrowerNumber = borrowernumber;
41
        this.NoIssuesCharge = noissuescharge;
42
43
        this.UpdateCheckoutsAndFees();
44
    }
45
}
46
3
$(document).ready(function() {
47
$(document).ready(function() {
4
    $.ajaxSetup ({ cache: false });
48
    $.ajaxSetup ({ cache: false });
5
49
Lines 117-123 $(document).ready(function() { Link Here
117
                content = "";
161
                content = "";
118
                if ( data.returned ) {
162
                if ( data.returned ) {
119
                    content = __("Checked in");
163
                    content = __("Checked in");
120
                    $(id).parent().parent().addClass('ok');
164
                    $(id).parent().parent().addClass('ok').find('.renew-td').text('');
121
                    $('#date_due_' + data.itemnumber).html( __("Checked in") );
165
                    $('#date_due_' + data.itemnumber).html( __("Checked in") );
122
                    if ( data.patronnote != null ) {
166
                    if ( data.patronnote != null ) {
123
                        $('.patron_note_' + data.itemnumber).html( __("Patron note") + ": " + data.patronnote);
167
                        $('.patron_note_' + data.itemnumber).html( __("Patron note") + ": " + data.patronnote);
Lines 176-181 $(document).ready(function() { Link Here
176
220
177
                var content = "";
221
                var content = "";
178
                if ( data.renew_okay ) {
222
                if ( data.renew_okay ) {
223
                    KOHA.Checkouts.UpdateCheckoutsAndFees();
179
                    issuesTable.api().ajax.reload();
224
                    issuesTable.api().ajax.reload();
180
                    content = __("Renewed, due:") + " " + data.date_due;
225
                    content = __("Renewed, due:") + " " + data.date_due;
181
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
226
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
Lines 567-573 $(document).ready(function() { Link Here
567
                        }
612
                        }
568
613
569
                        return content;
614
                        return content;
570
                    }
615
                    },
616
                    "sClass": "renew-td"
571
                },
617
                },
572
                {
618
                {
573
                    "bSortable": false,
619
                    "bSortable": false,
(-)a/members/moremember.pl (-1 lines)
Lines 200-206 $template->param( Link Here
200
    patron          => $patron,
200
    patron          => $patron,
201
    issuecount      => $patron->checkouts->count,
201
    issuecount      => $patron->checkouts->count,
202
    holds_count     => $patron->holds->count,
202
    holds_count     => $patron->holds->count,
203
    fines           => $patron->account->balance,
204
    translated_language => $translated_language,
203
    translated_language => $translated_language,
205
    detailview      => 1,
204
    detailview      => 1,
206
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
205
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
(-)a/svc/fines (-1 / +45 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 Koha::Patrons;
25
use Koha::Number::Price;
26
27
my ( $query, $response ) = C4::Service->init( borrowers => '*' );
28
29
my $borrowernumber = $query->param('borrowernumber')
30
  or return C4::Service->return_error('input', "No 'borrowernumber'");
31
my $patron = Koha::Patrons->find( $borrowernumber )
32
  or return C4::Service->return_error('input', "Invalid 'borrowernumber'", borrowernumber => $borrowernumber);
33
34
my $od      = $patron->get_overdues->count;
35
my $issues  = $patron->checkouts->count;
36
my $balance = $patron->account->balance;
37
38
$response->param(
39
    overduecount    => $od,
40
    issuecount      => $issues,
41
    balance         => $balance || 0.00,
42
    balance_formatted => Koha::Number::Price->new( $balance )->format,
43
);
44
45
C4::Service->return_success( $response );

Return to bug 14803