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

(-)a/circ/circulation.pl (-14 lines)
Lines 261-267 if ($findborrower) { Link Here
261
# get the borrower information.....
261
# get the borrower information.....
262
if ($borrowernumber) {
262
if ($borrowernumber) {
263
    $borrower = GetMemberDetails( $borrowernumber, 0 );
263
    $borrower = GetMemberDetails( $borrowernumber, 0 );
264
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
265
264
266
    # Warningdate is the date that the warning starts appearing
265
    # Warningdate is the date that the warning starts appearing
267
    my (  $today_year,   $today_month,   $today_day) = Today();
266
    my (  $today_year,   $today_month,   $today_day) = Today();
Lines 291-302 if ($borrowernumber) { Link Here
291
            $template->param("returnbeforeexpiry" => 1);
290
            $template->param("returnbeforeexpiry" => 1);
292
        }
291
        }
293
    }
292
    }
294
    $template->param(
295
        overduecount => $od,
296
        issuecount   => $issue,
297
        finetotal    => $fines
298
    );
299
300
    if ( IsDebarred($borrowernumber) ) {
293
    if ( IsDebarred($borrowernumber) ) {
301
        $template->param(
294
        $template->param(
302
            'userdebarred'    => $borrower->{debarred},
295
            'userdebarred'    => $borrower->{debarred},
Lines 411-419 if (@$barcodes) { Link Here
411
        }
404
        }
412
    }
405
    }
413
406
414
    # FIXME If the issue is confirmed, we launch another time GetMemberIssuesAndFines, now display the issue count after issue
415
    my ( $od, $issue, $fines ) = GetMemberIssuesAndFines($borrowernumber);
416
417
    if ($question->{RESERVE_WAITING} or $question->{RESERVED}){
407
    if ($question->{RESERVE_WAITING} or $question->{RESERVED}){
418
        $template->param(
408
        $template->param(
419
            reserveborrowernumber => $question->{'resborrowernumber'}
409
            reserveborrowernumber => $question->{'resborrowernumber'}
Lines 424-433 if (@$barcodes) { Link Here
424
        itembiblionumber => $getmessageiteminfo->{'biblionumber'}
414
        itembiblionumber => $getmessageiteminfo->{'biblionumber'}
425
    );
415
    );
426
416
427
428
429
    $template_params->{issuecount} = $issue;
430
431
    if ( $iteminfo ) {
417
    if ( $iteminfo ) {
432
        $iteminfo->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($iteminfo->{biblionumber}), GetFrameworkCode($iteminfo->{biblionumber}));
418
        $iteminfo->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($iteminfo->{biblionumber}), GetFrameworkCode($iteminfo->{biblionumber}));
433
        $template_params->{item} = $iteminfo;
419
        $template_params->{item} = $iteminfo;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc (-10 / +6 lines)
Lines 1-14 Link Here
1
[% USE Price %]
1
<script type="text/javascript">
2
[% SET NoIssuesCharge = Koha.Preference('noissuescharge') %]
2
KOHA.Checkouts.BorrowerNumber = [% borrowernumber %];
3
3
KOHA.Checkouts.NoIssuesCharge = [% Koha.Preference('noissuescharge') || "null" %];
4
[% IF NoIssuesCharge && fines > NoIssuesCharge %]
4
</script>
5
    <li>
5
    <li id="outstanding-fees" style="display: none;">
6
        <span class="circ-hlt">Fees &amp; Charges:</span>
6
        <span class="circ-hlt">Fees &amp; Charges:</span>
7
        Patron has <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">
7
        Patron has <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">
8
            Outstanding fees &amp; charges
8
            Outstanding fees &amp; charges of <span id="outstanding-fees-amount"></span>
9
            [% IF ( fines ) %]
10
                of [% fines | $Price %]
11
            [% END %]
12
        </a>.
9
        </a>.
13
10
14
        [% IF !Koha.Preference('AllowFineOverride') %]
11
        [% IF !Koha.Preference('AllowFineOverride') %]
Lines 19-22 Link Here
19
        or
16
        or
20
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% borrowernumber %]">Pay all fines</a></li>
17
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% borrowernumber %]">Pay all fines</a></li>
21
    </li>
18
    </li>
22
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-46 / +26 lines)
Lines 23-28 Link Here
23
[% INCLUDE 'strings.inc' %]
23
[% INCLUDE 'strings.inc' %]
24
[% INCLUDE 'datatables.inc' %]
24
[% INCLUDE 'datatables.inc' %]
25
[% INCLUDE 'columns_settings.inc' %]
25
[% INCLUDE 'columns_settings.inc' %]
26
<style>
27
.issue-allow, .issue-disallow, #mainform {display: none;}
28
</style>
26
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
29
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
27
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
30
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
28
[% INCLUDE 'timepicker.inc' %]
31
[% INCLUDE 'timepicker.inc' %]
Lines 82-87 function toggle_onsite_checkout(){ Link Here
82
function Dopop(link) {
85
function Dopop(link) {
83
    var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
86
    var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
84
}
87
}
88
89
KOHA.Checkouts.DisallowIssue = [% noissues ? "true" : "false" %];
90
KOHA.Checkouts.ForceAllowIssue = [% forceallow ? "true" : "false" %];
91
KOHA.Checkouts.ForceOnSiteCheckouts = [% Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ? "true" : "false" %];
85
$(document).ready(function() {
92
$(document).ready(function() {
86
    $('#mainform').on('submit',function() {
93
    $('#mainform').on('submit',function() {
87
        if ($("#barcode") && $("#barcode").val()) {
94
        if ($("#barcode") && $("#barcode").val()) {
Lines 424-432 $(document).ready(function() { Link Here
424
</form>
431
</form>
425
432
426
[% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
433
[% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
427
    [% UNLESS noissues %]
434
        <button class="issue-allow" type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
428
        <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
429
    [% END %]
430
[% END %]
435
[% END %]
431
</div></div>
436
</div></div>
432
[% END %] <!-- NEEDSCONFIRMATION -->
437
[% END %] <!-- NEEDSCONFIRMATION -->
Lines 589-595 No patron matched <span class="ex">[% message %]</span> Link Here
589
    <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>
594
    <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>
590
[% END %]
595
[% END %]
591
596
592
[% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
593
<div class="yui-u first">
597
<div class="yui-u first">
594
598
595
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
599
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
Lines 622-628 No patron matched <span class="ex">[% message %]</span> Link Here
622
626
623
    <div class="checkout-settings">
627
    <div class="checkout-settings">
624
628
625
        [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
626
            [% IF ( SpecifyDueDate ) %]
629
            [% IF ( SpecifyDueDate ) %]
627
                <div id="specify-due-date" class="checkout-setting">
630
                <div id="specify-due-date" class="checkout-setting">
628
                    <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
631
                    <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
Lines 640-649 No patron matched <span class="ex">[% message %]</span> Link Here
640
                    <button class="btn btn-small action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
643
                    <button class="btn btn-small action" id="cleardate" name="cleardate" onclick="this.checked = false; this.form.duedatespec.value = ''; this.form.stickyduedate.checked = false; this.form.barcode.focus(); return false;" >Clear</button>
641
                </div>
644
                </div>
642
            [% END %]
645
            [% END %]
643
        [% END %]
644
646
645
        [% UNLESS ( noissues ) %]
647
            <div id="set-automatic-renewal" class="checkout-setting issue-allow">
646
            <div id="set-automatic-renewal" class="checkout-setting">
647
                [% IF NEEDSCONFIRMATION %]
648
                [% IF NEEDSCONFIRMATION %]
648
                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
649
                    <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
649
                [% ELSE %]
650
                [% ELSE %]
Lines 670-688 No patron matched <span class="ex">[% message %]</span> Link Here
670
                    <label for="override_high_holds">Don't decrease checkout length based on holds</label>
671
                    <label for="override_high_holds">Don't decrease checkout length based on holds</label>
671
                </div>
672
                </div>
672
            [% END %]
673
            [% END %]
673
        [% END %]
674
674
675
        [% IF Koha.Preference('OnSiteCheckouts') %]
675
        [% IF Koha.Preference('OnSiteCheckouts') %]
676
            <div id="onsite_checkout-select" class="checkout-setting">
676
            <div id="onsite_checkout-select" class="checkout-setting">
677
                [% IF noissues %]
677
                    <div class="onsite-checkout-only issue-disallow">
678
                    <div class="onsite-checkout-only">
679
                        <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>
678
                        <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>
680
                        <input type="text" name="duedatespec" id="duedatespec" readonly="readonly" />
679
                        <input type="text" name="duedatespec" id="duedatespec" readonly="readonly" />
681
                        <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
680
                        <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
682
                    </div>
681
                    </div>
683
                [% ELSE %]
682
                    <div class="issue-allow">
684
                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
683
                    <input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
685
                [% END %]
684
                    </div>
686
            </div>
685
            </div>
687
        [% END %]
686
        [% END %]
688
687
Lines 704-738 No patron matched <span class="ex">[% message %]</span> Link Here
704
[% END %]
703
[% END %]
705
</form></div>
704
</form></div>
706
705
707
[% END %]<!-- /unless noissues -->
708
709
[% IF ( noissues ) %]
710
    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
711
        <div class="yui-u">
712
    [% ELSE %]
713
        <div>
714
    [% END %]
715
[% ELSE %]
716
    <div class="yui-u">
706
    <div class="yui-u">
717
[% END %]
707
        <div id="circmessages" class="circmessage attention">
718
708
            <h3>Attention:</h3>
719
        [% IF ( noissues ) %]
709
            <div class="issue-disallow">
720
            [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
710
            [% IF !( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
721
                <div id="circmessages" class="circmessage attention">
722
            [% ELSE %]
723
                <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
711
                <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
724
                <div id="circmessages" class="circmessage warning">
725
            [% END %]
712
            [% END %]
726
            <h3>
713
                <h3>
727
                Cannot check out!
714
                    Cannot check out!
728
                [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
715
                    [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
729
                    <span class="circ-hlt">Only on-site checkouts are allowed</span>
716
                        <span class="circ-hlt">Only on-site checkouts are allowed</span>
730
                [% END %]
717
                    [% END %]
731
            </h3>
718
                </h3>
732
        [% ELSE %]
719
            </div>
733
            <div id="circmessages" class="circmessage attention">
734
                <h3>Attention:</h3>
735
        [% END %]
736
720
737
		<ul>
721
		<ul>
738
722
Lines 786-793 No patron matched <span class="ex">[% message %]</span> Link Here
786
770
787
                   <br/>
771
                   <br/>
788
                   <a class="btn btn-small" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
772
                   <a class="btn btn-small" href="#reldebarments" onclick="$('#debarments-tab-link').click()"><i class="fa fa-ban"></i> View restrictions</a>
789
                    [% IF (noissues && borrowernumber && CAN_user_circulate_force_checkout) %]
773
                    [% IF (borrowernumber && CAN_user_circulate_force_checkout) %]
790
                        <span class="override_debarment">
774
                        <span class="override_debarment issue-disallow">
791
                            <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% borrowernumber %]" class="btn btn-small">Override restriction temporarily</a>
775
                            <a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% borrowernumber %]" class="btn btn-small">Override restriction temporarily</a>
792
                        </span>
776
                        </span>
793
                    [% END %]
777
                    [% END %]
Lines 885-895 No patron matched <span class="ex">[% message %]</span> Link Here
885
869
886
<ul>
870
<ul>
887
    <li>
871
    <li>
888
        [% IF ( issuecount ) %]
872
            <a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a>
889
            <a href="#checkouts">[% issuecount %] Checkout(s)</a>
890
        [% ELSE %]
891
            <a href="#checkouts">0 Checkouts</a>
892
        [% END %]
893
    </li>
873
    </li>
894
874
895
    [% IF relatives_issues_count %]
875
    [% IF relatives_issues_count %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-4 / +2 lines)
Lines 173-181 function validate1(date) { Link Here
173
[% ELSE %]
173
[% ELSE %]
174
    [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry | $KohaDates %]</div>[% END %]
174
    [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry | $KohaDates %]</div>[% END %]
175
175
176
    [% IF fines %]
176
    [% INCLUDE 'blocked-fines.inc' %]
177
        [% INCLUDE 'blocked-fines.inc' %]
178
    [% END %]
179
177
180
    [% IF ( flagged ) %]
178
    [% IF ( flagged ) %]
181
    <div id="circmessages" class="circmessage attention">
179
    <div id="circmessages" class="circmessage attention">
Lines 447-453 function validate1(date) { Link Here
447
445
448
<div id="finesholdsissues" class="toptabs">
446
<div id="finesholdsissues" class="toptabs">
449
    <ul>
447
    <ul>
450
        <li><a href="#checkouts">[% issuecount %] Checkout(s)</a></li>
448
        <li><a href="#checkouts"><span id="issuecount">0</span> Checkout(s)</a></li>
451
        [% IF relatives_issues_count %]
449
        [% IF relatives_issues_count %]
452
            <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li>
450
            <li><a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a></li>
453
        [% END %]
451
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (+36 lines)
Lines 1-6 Link Here
1
if ( KOHA === undefined ) var KOHA = {};
2
KOHA.Checkouts = {
3
    NoIssuesCharge: null,
4
    BorrowerNumber: null,
5
    DisallowIssue: false,
6
    ForceAllowIssue: false,
7
    ForceOnSiteCheckouts: false,
8
    ToggleInput: function( allow_issue ) {
9
        if (KOHA.Checkouts.DisallowIssue) allow_issue = false;
10
        if (KOHA.Checkouts.ForceAllowIssue) allow_issue = true;
11
12
        $(".issue-allow").toggle(allow_issue);
13
        $(".issue-disallow").toggle(!allow_issue);
14
        $("#mainform").toggle(allow_issue || KOHA.Checkouts.ForceOnSiteCheckouts);
15
16
        if (!allow_issue) {
17
            $(".circmessage.attention").removeClass("attention").addClass("warning");
18
        }
19
    },
20
    UpdateCheckoutsAndFees: function(checkouts_only=false) {
21
        $.get( "/cgi-bin/koha/svc/patron/fines", {borrowernumber: KOHA.Checkouts.BorrowerNumber}, function( data ) {
22
            $("#issuecount").text(data.issuecount);
23
            if (checkouts_only) return;
24
25
            var noissue = KOHA.Checkouts.NoIssuesCharge && data.owing >= KOHA.Checkouts.NoIssuesCharge;
26
            $("#outstanding-fees").toggle(noissue);
27
            $("#outstanding-fees-amount").text(data.owing_formatted);
28
            KOHA.Checkouts.ToggleInput(!noissue);
29
        } );
30
    }
31
}
32
1
$(document).ready(function() {
33
$(document).ready(function() {
2
    $.ajaxSetup ({ cache: false });
34
    $.ajaxSetup ({ cache: false });
3
35
36
    KOHA.Checkouts.UpdateCheckoutsAndFees();
37
4
    var barcodefield = $("#barcode");
38
    var barcodefield = $("#barcode");
5
    var issuesTable;
39
    var issuesTable;
6
40
Lines 65-70 $(document).ready(function() { Link Here
65
99
66
                content = "";
100
                content = "";
67
                if ( data.returned ) {
101
                if ( data.returned ) {
102
                    KOHA.Checkouts.UpdateCheckoutsAndFees(true);
68
                    content = CIRCULATION_RETURNED;
103
                    content = CIRCULATION_RETURNED;
69
                    $(id).parent().parent().addClass('ok');
104
                    $(id).parent().parent().addClass('ok');
70
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
105
                    $('#date_due_' + data.itemnumber).html(CIRCULATION_RETURNED);
Lines 97-102 $(document).ready(function() { Link Here
97
132
98
                var content = "";
133
                var content = "";
99
                if ( data.renew_okay ) {
134
                if ( data.renew_okay ) {
135
                    KOHA.Checkouts.UpdateCheckoutsAndFees();
100
                    issuesTable.api().ajax.reload();
136
                    issuesTable.api().ajax.reload();
101
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
137
                    content = CIRCULATION_RENEWED_DUE + " " + data.date_due;
102
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
138
                    $('#date_due_' + data.itemnumber).replaceWith( data.date_due );
(-)a/members/moremember.pl (-3 lines)
Lines 115-123 my $borrowernumber = $input->param('borrowernumber'); Link Here
115
my $error = $input->param('error');
115
my $error = $input->param('error');
116
$template->param( error => $error ) if ( $error );
116
$template->param( error => $error ) if ( $error );
117
117
118
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines($borrowernumber);
119
$template->param( issuecount => $issue, fines => $fines );
120
121
my $data = GetMember( 'borrowernumber' => $borrowernumber );
118
my $data = GetMember( 'borrowernumber' => $borrowernumber );
122
119
123
if ( not defined $data ) {
120
if ( not defined $data ) {
(-)a/svc/patron/fines (-1 / +40 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright 2016 CatalystIT
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use strict;
21
use warnings;
22
23
use C4::Service;
24
use C4::Members qw/GetMemberIssuesAndFines/;
25
use Koha::Number::Price;
26
27
my ( $query, $response ) = C4::Service->init( borrowers => '*' );
28
29
my $borrowernumber = $query->param('borrowernumber');
30
31
my ( $od, $issue, $owing ) = GetMemberIssuesAndFines( $borrowernumber );
32
33
$response->param(
34
    overduecount    => $od,
35
    issuecount      => $issue,
36
    owing           => $owing || 0.00,
37
    owing_formatted => Koha::Number::Price->new( $owing )->format,
38
);
39
40
C4::Service->return_success( $response );

Return to bug 14803