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

(-)a/circ/circulation.pl (-27 lines)
Lines 273-290 if ($findborrower) { Link Here
273
}
273
}
274
274
275
# get the borrower information.....
275
# get the borrower information.....
276
my $balance = 0;
277
$patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
276
$patron ||= Koha::Patrons->find( $borrowernumber ) if $borrowernumber;
278
if ($patron) {
277
if ($patron) {
279
278
280
    $template->param( borrowernumber => $patron->borrowernumber );
279
    $template->param( borrowernumber => $patron->borrowernumber );
281
    output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
280
    output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
282
281
283
    my $overdues = $patron->get_overdues;
284
    my $issues = $patron->checkouts;
285
    $balance = $patron->account->balance;
286
287
288
    # if the expiry date is before today ie they have expired
282
    # if the expiry date is before today ie they have expired
289
    if ( $patron->is_expired ) {
283
    if ( $patron->is_expired ) {
290
        #borrowercard expired, no issues
284
        #borrowercard expired, no issues
Lines 303-313 if ($patron) { Link Here
303
            $template->param("returnbeforeexpiry" => 1);
297
            $template->param("returnbeforeexpiry" => 1);
304
        }
298
        }
305
    }
299
    }
306
    $template->param(
307
        overduecount => $overdues->count,
308
        issuecount   => $issues->count,
309
        finetotal    => $balance,
310
    );
311
300
312
    if ( $patron and $patron->is_debarred ) {
301
    if ( $patron and $patron->is_debarred ) {
313
        $template->param(
302
        $template->param(
Lines 434-440 if (@$barcodes) { Link Here
434
        );
423
        );
435
    }
424
    }
436
425
437
438
    # FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue
426
    # FIXME If the issue is confirmed, we launch another time checkouts->count, now display the issue count after issue
439
    $patron = Koha::Patrons->find( $borrowernumber );
427
    $patron = Koha::Patrons->find( $borrowernumber );
440
    $template_params->{issuecount} = $patron->checkouts->count;
428
    $template_params->{issuecount} = $patron->checkouts->count;
Lines 484-503 if ( $patron ) { Link Here
484
        $template->param( dbarred=> 1 );
472
        $template->param( dbarred=> 1 );
485
        $noissues = 1;
473
        $noissues = 1;
486
    }
474
    }
487
    my $account = $patron->account;
488
    if( ( my $owing = $account->non_issues_charges ) > 0 ) {
489
        my $noissuescharge = C4::Context->preference("noissuescharge") || 5; # FIXME If noissuescharge == 0 then 5, why??
490
        $noissues = ( not C4::Context->preference("AllowFineOverride") and ( $owing > $noissuescharge ) );
491
        $template->param(
492
            charges => 1,
493
            chargesamount => $owing,
494
        )
495
    } elsif ( $balance < 0 ) {
496
        $template->param(
497
            credits => 1,
498
            creditsamount => -$balance,
499
        );
500
    }
501
475
502
    my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
476
    my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
503
    $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
477
    $no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
Lines 617-623 $template->param( Link Here
617
    duedatespec       => $duedatespec,
591
    duedatespec       => $duedatespec,
618
    restoreduedatespec => $restoreduedatespec,
592
    restoreduedatespec => $restoreduedatespec,
619
    message           => $message,
593
    message           => $message,
620
    totaldue          => sprintf('%.2f', $balance), # FIXME not used in template?
621
    inprocess         => $inprocess,
594
    inprocess         => $inprocess,
622
    $view             => 1,
595
    $view             => 1,
623
    batch_allowed     => $batch_allowed,
596
    batch_allowed     => $batch_allowed,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc (-8 / +6 lines)
Lines 1-13 Link Here
1
[% USE Price %]
1
    <li id="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 id="outstanding-fees-amount"></span>
7
        [% IF !Koha.Preference('AllowFineOverride') && NoIssuesCharge && fines > NoIssuesCharge %]
4
        </a>.
8
           <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
5
6
        [% IF !Koha.Preference('AllowFineOverride') %]
7
            <span class="circ-hlt" id="outstanding-fees-over-limit" style="display: none;">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
9
        [% END %]
8
        [% END %]
10
        <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" class="btn btn-default btn-xs" >Make payment</a>
9
        <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" class="btn btn-default btn-xs" >Make payment</a>
11
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% borrowernumber %]" class="btn btn-default btn-xs" >Pay all fines</a></li>
10
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% borrowernumber %]" class="btn btn-default btn-xs" >Pay all fines</a></li>
12
    </li>
11
    </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 77-83 Link Here
77
                [% END %]
77
                [% END %]
78
            </div>
78
            </div>
79
        </form>
79
        </form>
80
    [% ELSE %]
80
    </div>
81
        <p>Patron has nothing checked out.</p>
81
    <p class="no-checkouts" style="display: none;">Patron has nothing checked out.</p>
82
    [% END %]
83
</div>
82
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts.inc (+11 lines)
Line 0 Link Here
1
[% USE Koha %]
2
<script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts_[% KOHA_VERSION %].js"></script>
3
<script type="text/javascript">
4
$(document).ready(function() {
5
    KOHA.Checkouts.BorrowerNumber = [% borrowernumber %];
6
    KOHA.Checkouts.NoIssuesCharge = [% Koha.Preference('noissuescharge') || "null" %];
7
    [% IF Koha.Preference('AllowFineOverride') %] KOHA.Checkouts.AllowFineOverride = true; [% END %]
8
    [% IF noissues && !forceallow %] KOHA.Checkouts.DisallowIssue = true; [% END %]
9
    [% IF Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') %] KOHA.Checkouts.ForceOnSiteCheckouts = true; [% END %]
10
});
11
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-49 / +25 lines)
Lines 16-21 Link Here
16
</title>
16
</title>
17
[% INCLUDE 'doc-head-close.inc' %]
17
[% INCLUDE 'doc-head-close.inc' %]
18
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
18
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
19
[% show_barcode_input = (Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce')) || !noissues || forceallow %]
20
<style>
21
.issue-allow, .issue-disallow {display: none;}
22
[% IF !show_barcode_input %]#mainform {display: none;}[% END %]
23
</style>
19
</head>
24
</head>
20
25
21
<body id="circ_circulation" class="circ">
26
<body id="circ_circulation" class="circ">
Lines 288-296 Link Here
288
</form>
293
</form>
289
294
290
[% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
295
[% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
291
    [% UNLESS noissues %]
292
        <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% patron.borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
296
        <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% patron.borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
293
    [% END %]
294
[% END %]
297
[% END %]
295
</div></div>
298
</div></div>
296
[% END %] <!-- NEEDSCONFIRMATION -->
299
[% END %] <!-- NEEDSCONFIRMATION -->
Lines 494-500 No patron matched <span class="ex">[% message | html %]</span> Link Here
494
    <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>
497
    <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>
495
[% END %]
498
[% END %]
496
499
497
[% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
498
<div class="yui-u first">
500
<div class="yui-u first">
499
501
500
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
502
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
Lines 531-537 No patron matched <span class="ex">[% message | html %]</span> Link Here
531
533
532
    <div class="checkout-settings">
534
    <div class="checkout-settings">
533
535
534
        [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
535
            [% IF ( SpecifyDueDate ) %]
536
            [% IF ( SpecifyDueDate ) %]
536
                <div id="specify-due-date" class="checkout-setting">
537
                <div id="specify-due-date" class="checkout-setting">
537
                    <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
538
                    <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
Lines 549-558 No patron matched <span class="ex">[% message | html %]</span> Link Here
549
                    <button class="btn btn-default btn-sm 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>
550
                    <button class="btn btn-default btn-sm 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>
550
                </div>
551
                </div>
551
            [% END %]
552
            [% END %]
552
        [% END %]
553
553
554
        [% UNLESS ( noissues ) %]
554
            <div id="set-automatic-renewal" class="checkout-setting issue-allow">
555
            <div id="set-automatic-renewal" class="checkout-setting">
556
                [% IF NEEDSCONFIRMATION %]
555
                [% IF NEEDSCONFIRMATION %]
557
                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
556
                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
558
                [% ELSE %]
557
                [% ELSE %]
Lines 579-597 No patron matched <span class="ex">[% message | html %]</span> Link Here
579
                    <label for="override_high_holds">Don't decrease checkout length based on holds</label>
578
                    <label for="override_high_holds">Don't decrease checkout length based on holds</label>
580
                </div>
579
                </div>
581
            [% END %]
580
            [% END %]
582
        [% END %]
583
581
584
        [% IF Koha.Preference('OnSiteCheckouts') %]
582
        [% IF Koha.Preference('OnSiteCheckouts') %]
585
            <div id="onsite_checkout-select" class="checkout-setting">
583
            <div id="onsite_checkout-select" class="checkout-setting">
586
                [% IF noissues %]
584
                    <div class="onsite-checkout-only issue-disallow">
587
                    <div class="onsite-checkout-only">
588
                        <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>
585
                        <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>
589
                        <input type="text" name="duedatespec" id="duedatespec" />
586
                        <input type="text" name="duedatespec" id="duedatespec" />
590
                        <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
587
                        <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
591
                    </div>
588
                    </div>
592
                [% ELSE %]
589
                    <div class="issue-allow">
593
                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
590
                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
594
                [% END %]
591
                    </div>
595
            </div>
592
            </div>
596
        [% END %]
593
        [% END %]
597
594
Lines 612-646 No patron matched <span class="ex">[% message | html %]</span> Link Here
612
[% END %]
609
[% END %]
613
</form></div>
610
</form></div>
614
611
615
[% END %]<!-- /unless noissues -->
616
617
[% IF ( noissues ) %]
618
    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
619
        <div class="yui-u">
620
    [% ELSE %]
621
        <div>
622
    [% END %]
623
[% ELSE %]
624
    <div class="yui-u">
612
    <div class="yui-u">
625
[% END %]
613
        <div id="circmessages" class="circmessage attention">
626
614
            <h3>Attention:</h3>
627
        [% IF ( noissues ) %]
615
            <div class="issue-disallow">
628
            [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
616
            [% IF !( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
629
                <div id="circmessages" class="circmessage attention">
630
            [% ELSE %]
631
                <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
617
                <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
632
                <div id="circmessages" class="circmessage warning">
633
            [% END %]
618
            [% END %]
634
            <h3>
619
                <h3>
635
                Cannot check out!
620
                    Cannot check out!
636
                [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
621
                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
637
                    <span class="circ-hlt">Only on-site checkouts are allowed</span>
622
                        <span class="circ-hlt">Only on-site checkouts are allowed</span>
638
                [% END %]
623
                    [% END %]
639
            </h3>
624
                </h3>
640
        [% ELSE %]
625
            </div>
641
            <div id="circmessages" class="circmessage attention">
642
                <h3>Attention:</h3>
643
        [% END %]
644
626
645
		<ul>
627
		<ul>
646
628
Lines 699-706 No patron matched <span class="ex">[% message | html %]</span> Link Here
699
                   [% END %]
681
                   [% END %]
700
                   <br/>
682
                   <br/>
701
                   <a class="btn btn-default btn-sm" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
683
                   <a class="btn btn-default btn-sm" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
702
                    [% IF (noissues && patron && CAN_user_circulate_force_checkout) %]
684
                    [% IF (borrowernumber && CAN_user_circulate_force_checkout) %]
703
                        <span class="override_debarment">
685
                        <span class="override_debarment issue-disallow">
704
                            <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber %]" class="btn btn-default btn-sm">Override restriction temporarily</a>
686
                            <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber %]" class="btn btn-default btn-sm">Override restriction temporarily</a>
705
                        </span>
687
                        </span>
706
                    [% END %]
688
                    [% END %]
Lines 710-718 No patron matched <span class="ex">[% message | html %]</span> Link Here
710
                [% IF ( odues ) %]<li><span class="circ-hlt">Overdues: Patron has ITEMS OVERDUE.</span> <a href="#checkouts">See highlighted items below</a></li>
692
                [% IF ( odues ) %]<li><span class="circ-hlt">Overdues: Patron has ITEMS OVERDUE.</span> <a href="#checkouts">See highlighted items below</a></li>
711
            [% END %]
693
            [% END %]
712
694
713
            [% IF ( charges ) %]
695
            [% INCLUDE 'blocked-fines.inc' %]
714
                [% INCLUDE 'blocked-fines.inc' fines = chargesamount %]
715
            [% END %]
716
696
717
            [% IF ( charges_guarantees ) %]
697
            [% IF ( charges_guarantees ) %]
718
                <li>
698
                <li>
Lines 798-808 No patron matched <span class="ex">[% message | html %]</span> Link Here
798
778
799
<ul>
779
<ul>
800
    <li>
780
    <li>
801
        [% IF ( issuecount ) %]
781
            <a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a>
802
            <a href="#checkouts">[% issuecount %] Checkout(s)</a>
803
        [% ELSE %]
804
            <a href="#checkouts">0 Checkouts</a>
805
        [% END %]
806
    </li>
782
    </li>
807
783
808
    [% IF relatives_issues_count %]
784
    [% IF relatives_issues_count %]
Lines 980-986 No patron matched <span class="ex">[% message | html %]</span> Link Here
980
    [% INCLUDE 'timepicker.inc' %]
956
    [% INCLUDE 'timepicker.inc' %]
981
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping_[% KOHA_VERSION %].js"></script>
957
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping_[% KOHA_VERSION %].js"></script>
982
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation_[% KOHA_VERSION %].js"></script>
958
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation_[% KOHA_VERSION %].js"></script>
983
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts_[% KOHA_VERSION %].js"></script>
959
    [% INCLUDE 'checkouts.inc' %]
984
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/holds_[% KOHA_VERSION %].js"></script>
960
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/holds_[% KOHA_VERSION %].js"></script>
985
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/circ-patron-search-results_[% KOHA_VERSION %].js"></script>
961
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/circ-patron-search-results_[% KOHA_VERSION %].js"></script>
986
    <script type="text/javascript">
962
    <script type="text/javascript">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-4 / +2 lines)
Lines 56-68 Link Here
56
56
57
    [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% patron.dateexpiry | $KohaDates %]</div>[% END %]
57
    [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% patron.dateexpiry | $KohaDates %]</div>[% END %]
58
58
59
    [% IF fines %]
60
    <div id="circmessages" class="circmessage attention">
59
    <div id="circmessages" class="circmessage attention">
61
      <ul>
60
      <ul>
62
        [% INCLUDE 'blocked-fines.inc' %]
61
        [% INCLUDE 'blocked-fines.inc' %]
63
      </ul>
62
      </ul>
64
    </div>
63
    </div>
65
    [% END %]
66
    <div id="messages" class="circmessage">
64
    <div id="messages" class="circmessage">
67
        <h4>Messages:</h4>
65
        <h4>Messages:</h4>
68
        <ul>
66
        <ul>
Lines 403-409 Link Here
403
</div>
401
</div>
404
<div id="finesholdsissues" class="toptabs">
402
<div id="finesholdsissues" class="toptabs">
405
    <ul>
403
    <ul>
406
        <li><a href="#checkouts">[% issuecount %] Checkout(s)</a></li>
404
        <li><a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a></li>
407
        [% IF relatives_issues_count %]
405
        [% IF relatives_issues_count %]
408
            <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li>
406
            <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li>
409
        [% END %]
407
        [% END %]
Lines 551-557 Link Here
551
    [% INCLUDE 'timepicker.inc' %]
549
    [% INCLUDE 'timepicker.inc' %]
552
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping_[% KOHA_VERSION %].js"></script>
550
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.rowGrouping_[% KOHA_VERSION %].js"></script>
553
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation_[% KOHA_VERSION %].js"></script>
551
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/circulation_[% KOHA_VERSION %].js"></script>
554
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/checkouts_[% KOHA_VERSION %].js"></script>
552
    [% INCLUDE 'checkouts.inc' %]
555
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/holds_[% KOHA_VERSION %].js"></script>
553
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/holds_[% KOHA_VERSION %].js"></script>
556
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script>
554
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script>
557
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/messaging-preference-form_[% KOHA_VERSION %].js"></script>
555
    <script type="text/javascript" src="[% interface %]/[% theme %]/js/messaging-preference-form_[% KOHA_VERSION %].js"></script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-2 / +41 lines)
Lines 1-6 Link Here
1
if ( KOHA === undefined ) var KOHA = {};
2
KOHA.Checkouts = {
3
    BorrowerNumber: null,
4
    NoIssuesCharge: null,
5
    AllowFineOverride: false,
6
    DisallowIssue: false,
7
    ForceOnSiteCheckouts: false,
8
    ToggleInput: function( allow_issue ) {
9
        if (KOHA.Checkouts.AllowFineOverride) allow_issue = true;
10
        if (KOHA.Checkouts.DisallowIssue) allow_issue = false;
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() {
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
27
            var noissue = KOHA.Checkouts.NoIssuesCharge !== null && data.owing >= KOHA.Checkouts.NoIssuesCharge;
28
            $("#outstanding-fees").toggle(data.owing > 0);
29
            $("#outstanding-fees-amount").text(data.owing_formatted);
30
            $("#outstanding-fees-over-limit").toggle(noissue);
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 76-82 $(document).ready(function() { Link Here
76
                content = "";
113
                content = "";
77
                if ( data.returned ) {
114
                if ( data.returned ) {
78
                    content = CIRCULATION_RETURNED;
115
                    content = CIRCULATION_RETURNED;
79
                    $(id).parent().parent().addClass('ok');
116
                    $(id).parent().parent().addClass('ok').find('.renew-td').text('');
80
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
117
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
81
                    if ( data.patronnote != null ) {
118
                    if ( data.patronnote != null ) {
82
                        $('.patron_note_' + data.itemnumber).html("Patron note: " + data.patronnote);
119
                        $('.patron_note_' + data.itemnumber).html("Patron note: " + data.patronnote);
Lines 110-115 $(document).ready(function() { Link Here
110
147
111
                var content = "";
148
                var content = "";
112
                if ( data.renew_okay ) {
149
                if ( data.renew_okay ) {
150
                    KOHA.Checkouts.UpdateCheckoutsAndFees();
113
                    issuesTable.api().ajax.reload();
151
                    issuesTable.api().ajax.reload();
114
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
152
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
115
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
153
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
Lines 429-435 $(document).ready(function() { Link Here
429
                        content += "</span>";
467
                        content += "</span>";
430
468
431
                        return content;
469
                        return content;
432
                    }
470
                    },
471
                    "sClass": "renew-td"
433
                },
472
                },
434
                {
473
                {
435
                    "bSortable": false,
474
                    "bSortable": false,
(-)a/members/moremember.pl (-2 lines)
Lines 129-138 if ( $userenv and $userenv->{number} ) { # Allow DB user to create a superlibrar Link Here
129
}
129
}
130
130
131
my $issues        = $patron->checkouts;
131
my $issues        = $patron->checkouts;
132
my $balance       = $patron->account->balance;
133
$template->param(
132
$template->param(
134
    issuecount => $issues->count,
133
    issuecount => $issues->count,
135
    fines      => $balance,
136
);
134
);
137
135
138
my $category_type = $patron->category->category_type;
136
my $category_type = $patron->category->category_type;
(-)a/svc/patron/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 $owing  = $patron->account->balance;
37
38
$response->param(
39
    overduecount    => $od,
40
    issuecount      => $issues,
41
    owing           => $owing || 0.00,
42
    owing_formatted => Koha::Number::Price->new( $owing )->format,
43
);
44
45
C4::Service->return_success( $response );

Return to bug 14803