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

(-)a/circ/circulation.pl (-31 lines)
Lines 278-295 if ($findborrower) { Link Here
278
}
278
}
279
279
280
# get the borrower information.....
280
# get the borrower information.....
281
my $balance = 0;
282
$patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
281
$patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
283
if ($patron) {
282
if ($patron) {
284
283
285
    $template->param( borrowernumber => $patron->borrowernumber );
284
    $template->param( borrowernumber => $patron->borrowernumber );
286
    output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
285
    output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
287
286
288
    my $overdues = $patron->get_overdues;
289
    my $issues = $patron->checkouts;
290
    $balance = $patron->account->balance;
291
292
293
    # if the expiry date is before today ie they have expired
287
    # if the expiry date is before today ie they have expired
294
    if ( $patron->is_expired ) {
288
    if ( $patron->is_expired ) {
295
        #borrowercard expired, no issues
289
        #borrowercard expired, no issues
Lines 308-318 if ($patron) { Link Here
308
            $template->param("returnbeforeexpiry" => 1);
302
            $template->param("returnbeforeexpiry" => 1);
309
        }
303
        }
310
    }
304
    }
311
    $template->param(
312
        overduecount => $overdues->count,
313
        issuecount   => $issues->count,
314
        finetotal    => $balance,
315
    );
316
305
317
    if ( $patron and $patron->is_debarred ) {
306
    if ( $patron and $patron->is_debarred ) {
318
        $template->param(
307
        $template->param(
Lines 447-457 if (@$barcodes) { Link Here
447
        );
436
        );
448
    }
437
    }
449
438
450
451
    # FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue
452
    $patron = Koha::Patrons->find( $borrowernumber );
453
    $template_params->{issuecount} = $patron->checkouts->count;
454
455
    if ( $item ) {
439
    if ( $item ) {
456
        $template_params->{item} = $item;
440
        $template_params->{item} = $item;
457
        $template_params->{biblio} = $biblio;
441
        $template_params->{biblio} = $biblio;
Lines 497-516 if ( $patron ) { Link Here
497
        $template->param( dbarred=> 1 );
481
        $template->param( dbarred=> 1 );
498
        $noissues = 1;
482
        $noissues = 1;
499
    }
483
    }
500
    my $account = $patron->account;
501
    if( ( my $owing = $account->non_issues_charges ) > 0 ) {
502
        my $noissuescharge = C4::Context->preference("noissuescharge") || 5; # FIXME If noissuescharge == 0 then 5, why??
503
        $noissues ||= ( not C4::Context->preference("AllowFineOverride") and ( $owing > $noissuescharge ) );
504
        $template->param(
505
            charges => 1,
506
            chargesamount => $owing,
507
        )
508
    } elsif ( $balance < 0 ) {
509
        $template->param(
510
            credits => 1,
511
            creditsamount => -$balance,
512
        );
513
    }
514
484
515
    my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
485
    my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
516
    $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
486
    $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
Lines 615-621 $template->param( Link Here
615
    duedatespec       => $duedatespec,
585
    duedatespec       => $duedatespec,
616
    restoreduedatespec => $restoreduedatespec,
586
    restoreduedatespec => $restoreduedatespec,
617
    message           => $message,
587
    message           => $message,
618
    totaldue          => sprintf('%.2f', $balance), # FIXME not used in template?
619
    inprocess         => $inprocess,
588
    inprocess         => $inprocess,
620
    $view             => 1,
589
    $view             => 1,
621
    batch_allowed     => $batch_allowed,
590
    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">Fees &amp; Charges:</span>
2
        <span class="circ-hlt">Fees &amp; Charges:</span>
6
        Patron has outstanding fees &amp; 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 81-89 Link Here
81
                [% END %]
81
                [% END %]
82
            </div>
82
            </div>
83
        </form>
83
        </form>
84
    [% ELSE %]
84
    </div>
85
        <p>Patron has nothing checked out.</p>
85
    <p class="no-checkouts" style="display: none;">Patron has nothing checked out.</p>
86
    [% END %]
87
</div>
86
</div>
88
87
89
<!-- Claims Returned Modal -->
88
<!-- 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/includes/doc-head-close.inc (-3 / +3 lines)
Lines 26-34 Link Here
26
var Koha = {};
26
var Koha = {};
27
</script>
27
</script>
28
28
29
<script src="[% themelang | uri %]/js/locale_data.js"></script>
29
<script src="[% themelang %]/js/locale_data.js"></script>
30
<script src="[% interface | uri %]/js/Gettext.js"></script>
30
<script src="[% interface %]/js/Gettext.js"></script>
31
<script src="[% interface | uri %]/js/i18n.js"></script>
31
<script src="[% interface %]/js/i18n.js"></script>
32
32
33
[% IF ( login ) %]
33
[% IF ( login ) %]
34
    [% Asset.css("css/login.css") | $raw %]
34
    [% Asset.css("css/login.css") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-41 / +18 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 295-303 Link Here
295
                            </form>
300
                            </form>
296
301
297
                            [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
302
                            [% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
298
                                [% UNLESS noissues %]
299
                                    <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>
303
                                    <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>
300
                                [% END %]
301
                            [% END %]
304
                            [% END %]
302
                        </div> <!-- /#circ_needsconfirmation -->
305
                        </div> <!-- /#circ_needsconfirmation -->
303
                    [% END # /NEEDSCONFIRMATION %]
306
                    [% END # /NEEDSCONFIRMATION %]
Lines 504-510 Link Here
504
                            [% END %]
507
                            [% END %]
505
508
506
                            <div class="row">
509
                            <div class="row">
507
                                [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
508
                                    <div class="col-sm-6">
510
                                    <div class="col-sm-6">
509
                                        <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
511
                                        <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
510
                                            <input type="hidden" name="restoreduedatespec" />
512
                                            <input type="hidden" name="restoreduedatespec" />
Lines 543-549 Link Here
543
545
544
                                            <div class="circ-settings">
546
                                            <div class="circ-settings">
545
547
546
                                                    [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
547
                                                        [% IF ( SpecifyDueDate ) %]
548
                                                        [% IF ( SpecifyDueDate ) %]
548
                                                            <div id="specify-due-date" class="circ-setting">
549
                                                            <div id="specify-due-date" class="circ-setting">
549
                                                                <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
550
                                                                <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
Lines 561-570 Link Here
561
                                                                <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>
562
                                                                <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>
562
                                                            </div>
563
                                                            </div>
563
                                                        [% END %]
564
                                                        [% END %]
564
                                                    [% END %]
565
565
566
                                                    [% UNLESS ( noissues ) %]
566
                                                        <div id="set-automatic-renewal" class="circ-setting issue-allow">
567
                                                        <div id="set-automatic-renewal" class="circ-setting">
568
                                                            [% IF NEEDSCONFIRMATION %]
567
                                                            [% IF NEEDSCONFIRMATION %]
569
                                                                [% IF auto_renew %]
568
                                                                [% IF auto_renew %]
570
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
569
                                                                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
Lines 599-621 Link Here
599
                                                                <label for="override_high_holds">Don't decrease checkout length based on holds</label>
598
                                                                <label for="override_high_holds">Don't decrease checkout length based on holds</label>
600
                                                            </div>
599
                                                            </div>
601
                                                        [% END %]
600
                                                        [% END %]
602
                                                    [% END %]
603
601
604
                                                    [% IF Koha.Preference('OnSiteCheckouts') %]
602
                                                    [% IF Koha.Preference('OnSiteCheckouts') %]
605
                                                        <div id="onsite_checkout-select" class="circ-setting">
603
                                                        <div id="onsite_checkout-select" class="circ-setting">
606
                                                            [% IF noissues %]
604
                                                                <div class="onsite-checkout-only issue-disallow">
607
                                                                <div class="onsite-checkout-only">
608
                                                                    <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>
605
                                                                    <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>
609
                                                                    <input type="text" name="duedatespec" id="duedatespec" />
606
                                                                    <input type="text" name="duedatespec" id="duedatespec" />
610
                                                                    <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
607
                                                                    <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
611
                                                                </div>
608
                                                                </div>
612
                                                            [% ELSE %]
609
                                                                <div class="issue-allow">
613
                                                                [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
610
                                                                [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
614
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
611
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
615
                                                                [% ELSE %]
612
                                                                [% ELSE %]
616
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
613
                                                                <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
617
                                                                [% END %]
614
                                                                [% END %]
618
                                                            [% END %]
615
                                                                </div>
619
                                                        </div>
616
                                                        </div>
620
                                                    [% END %]
617
                                                    [% END %]
621
618
Lines 638-661 Link Here
638
                                        </form> <!-- /#mainform -->
635
                                        </form> <!-- /#mainform -->
639
                                    </div> <!-- /.col-sm-6 -->
636
                                    </div> <!-- /.col-sm-6 -->
640
637
641
                                [% END #/IF !noissues %]
642
643
                                [% IF ( noissues ) %]
644
                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
645
                                        <div class="col-sm-6">
646
                                    [% ELSE %]
647
                                        <div>
648
                                    [% END %]
649
                                [% ELSE %]
650
                                    <div class="col-sm-6">
638
                                    <div class="col-sm-6">
651
                                [% END %]
652
639
653
                                [% IF ( noissues ) %]
640
                                <div id="circmessages" class="circmessage attention">
641
                                    <h3>Attention:</h3>
642
                                    <div class="issue-disallow">
654
                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
643
                                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
655
                                        <div id="circmessages" class="circmessage attention">
656
                                    [% ELSE %]
657
                                        <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
644
                                        <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
658
                                        <div id="circmessages" class="circmessage warning">
659
                                    [% END %]
645
                                    [% END %]
660
                                    <h3>
646
                                    <h3>
661
                                        Cannot check out!
647
                                        Cannot check out!
Lines 663-672 Link Here
663
                                            <span class="circ-hlt">Only on-site checkouts are allowed</span>
649
                                            <span class="circ-hlt">Only on-site checkouts are allowed</span>
664
                                        [% END %]
650
                                        [% END %]
665
                                    </h3>
651
                                    </h3>
666
                                [% ELSE %]
652
                                    </div>
667
                                    <div id="circmessages" class="circmessage attention">
668
                                        <h3>Attention:</h3>
669
                                [% END %]
670
653
671
                                <ul>
654
                                <ul>
672
                                    [% IF ( has_modifications ) %]
655
                                    [% IF ( has_modifications ) %]
Lines 730-737 Link Here
730
                                            <br/>
713
                                            <br/>
731
                                            <a class="btn btn-default" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
714
                                            <a class="btn btn-default" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
732
715
733
                                            [% IF (noissues && patron && CAN_user_circulate_force_checkout) %]
716
                                            [% IF (patron && CAN_user_circulate_force_checkout) %]
734
                                                <span class="override_debarment">
717
                                                <span class="override_debarment issue-disallow">
735
                                                    <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default">Override restriction temporarily</a>
718
                                                    <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default">Override restriction temporarily</a>
736
                                                </span>
719
                                                </span>
737
                                            [% END %]
720
                                            [% END %]
Lines 748-756 Link Here
748
                                        <li><span class="circ-hlt return-claims">Return claims: Patron has [% return_claims.count | html %] RETURN CLAIMS.</span>
731
                                        <li><span class="circ-hlt return-claims">Return claims: Patron has [% return_claims.count | html %] RETURN CLAIMS.</span>
749
                                    [% END %]
732
                                    [% END %]
750
733
751
                                    [% IF ( charges ) %]
734
                                    [% INCLUDE 'blocked-fines.inc' %]
752
                                        [% INCLUDE 'blocked-fines.inc' fines = chargesamount %]
753
                                    [% END %]
754
735
755
                                    [% IF age_limitations %]
736
                                    [% IF age_limitations %]
756
                                        [% INCLUDE 'category-out-of-age-limit.inc' %]
737
                                        [% INCLUDE 'category-out-of-age-limit.inc' %]
Lines 836-846 Link Here
836
                    <div id="patronlists" class="toptabs">
817
                    <div id="patronlists" class="toptabs">
837
                        <ul>
818
                        <ul>
838
                            <li>
819
                            <li>
839
                                [% IF ( issuecount ) %]
820
                                <a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a>
840
                                    <a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
841
                                [% ELSE %]
842
                                    <a href="#checkouts">0 Checkouts</a>
843
                                [% END %]
844
                            </li>
821
                            </li>
845
822
846
                            [% IF relatives_issues_count %]
823
                            [% IF relatives_issues_count %]
Lines 1051-1057 Link Here
1051
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
1028
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
1052
    </script>
1029
    </script>
1053
    [% Asset.js("js/pages/circulation.js") | $raw %]
1030
    [% Asset.js("js/pages/circulation.js") | $raw %]
1054
    [% Asset.js("js/checkouts.js") | $raw %]
1031
    [% INCLUDE 'checkouts.inc' %]
1055
    [% Asset.js("js/holds.js") | $raw %]
1032
    [% Asset.js("js/holds.js") | $raw %]
1056
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1033
    [% Asset.js("js/circ-patron-search-results.js") | $raw %]
1057
    <script>
1034
    <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-11 / +4 lines)
Lines 64-81 Link Here
64
                            </div>
64
                            </div>
65
                        [% END %]
65
                        [% END %]
66
66
67
                        [% IF fines || age_limitations %]
68
                            <div id="circmessages" class="circmessage attention">
67
                            <div id="circmessages" class="circmessage attention">
69
                                <ul>
68
                                <ul>
70
                                    [% IF fines %]
71
                                        [% INCLUDE 'blocked-fines.inc' %]
69
                                        [% INCLUDE 'blocked-fines.inc' %]
72
                                    [% END %]
73
                                    [% IF age_limitations %]
70
                                    [% IF age_limitations %]
74
                                        [% INCLUDE 'category-out-of-age-limit.inc' %]
71
                                        [% INCLUDE 'category-out-of-age-limit.inc' %]
75
                                    [% END %]
72
                                    [% END %]
76
                                </ul>
73
                                </ul>
77
                            </div>
74
                            </div>
78
                        [% END %]
79
75
80
                        [% IF ( patron_messages ) %]
76
                        [% IF ( patron_messages ) %]
81
                            <div id="messages" class="circmessage">
77
                            <div id="messages" class="circmessage">
Lines 692-698 Link Here
692
                    <div id="finesholdsissues" class="toptabs">
688
                    <div id="finesholdsissues" class="toptabs">
693
                        <ul>
689
                        <ul>
694
                            <li>
690
                            <li>
695
                                <a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
691
                                <a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a>
696
                            </li>
692
                            </li>
697
                            [% IF relatives_issues_count %]
693
                            [% IF relatives_issues_count %]
698
                                <li>
694
                                <li>
Lines 754-764 Link Here
754
                        [% INCLUDE "relatives-issues-table.inc" %]
750
                        [% INCLUDE "relatives-issues-table.inc" %]
755
751
756
                        <div id="finesandcharges">
752
                        <div id="finesandcharges">
757
                            [% IF ( fines ) %]
753
                                <p class="outstanding-fees" style="display: none;">Total due: <span class="outstanding-fees-amount"></p>
758
                                <p>Total due: [% fines | $Price %]</p>
754
                                <p class="no-outstanding-fees">No outstanding charges</p>
759
                            [% ELSE %]
760
                                <p>No outstanding charges</p>
761
                            [% END %]
762
                        </div>
755
                        </div>
763
756
764
                        [% IF CAN_user_clubs && ( enrollments.count || enrollable.count ) %]
757
                        [% IF CAN_user_clubs && ( enrollments.count || enrollable.count ) %]
Lines 878-884 Link Here
878
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
871
        var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
879
    </script>
872
    </script>
880
    [% Asset.js("js/pages/circulation.js") | $raw %]
873
    [% Asset.js("js/pages/circulation.js") | $raw %]
881
    [% Asset.js("js/checkouts.js") | $raw %]
874
    [% INCLUDE 'checkouts.inc' %]
882
    [% Asset.js("js/holds.js") | $raw %]
875
    [% Asset.js("js/holds.js") | $raw %]
883
    [% INCLUDE 'str/members-menu.inc' %]
876
    [% INCLUDE 'str/members-menu.inc' %]
884
    [% Asset.js("js/members-menu.js") | $raw %]
877
    [% 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 PATRON_NOTE */
1
/* global PATRON_NOTE */
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 = CIRCULATION_RETURNED;
163
                    content = CIRCULATION_RETURNED;
120
                    $(id).parent().parent().addClass('ok');
164
                    $(id).parent().parent().addClass('ok').find('.renew-td').text('');
121
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
165
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
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 161-166 $(document).ready(function() { Link Here
161
205
162
                var content = "";
206
                var content = "";
163
                if ( data.renew_okay ) {
207
                if ( data.renew_okay ) {
208
                    KOHA.Checkouts.UpdateCheckoutsAndFees();
164
                    issuesTable.api().ajax.reload();
209
                    issuesTable.api().ajax.reload();
165
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
210
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
166
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
211
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
Lines 536-542 $(document).ready(function() { Link Here
536
                        content += "</span>";
581
                        content += "</span>";
537
582
538
                        return content;
583
                        return content;
539
                    }
584
                    },
585
                    "sClass": "renew-td"
540
                },
586
                },
541
                {
587
                {
542
                    "bSortable": false,
588
                    "bSortable": false,
(-)a/members/moremember.pl (-1 lines)
Lines 201-207 $template->param( Link Here
201
    patron          => $patron,
201
    patron          => $patron,
202
    issuecount      => $patron->checkouts->count,
202
    issuecount      => $patron->checkouts->count,
203
    holds_count     => $patron->holds->count,
203
    holds_count     => $patron->holds->count,
204
    fines           => $patron->account->balance,
205
    translated_language => $translated_language,
204
    translated_language => $translated_language,
206
    detailview      => 1,
205
    detailview      => 1,
207
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
206
    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