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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt (-13 / +3 lines)
Lines 44-67 Link Here
44
                        <a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a></li>
44
                        <a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a></li>
45
                    [% ELSIF pending %]
45
                    [% ELSIF pending %]
46
                        <p>Your discharge will be available on this page within a few days.</p>
46
                        <p>Your discharge will be available on this page within a few days.</p>
47
                    [% ELSIF failure %]
48
                        <p>You cannot be discharged because you have checked out items. Please return your checked out items before asking for a discharge.</p>
49
                        <ul>
50
                        [% IF has_debt %]
51
                            <li>You have unpaid charges. Please pay your charges before reapplying.</li>
52
                        [% END %]
53
                        [% IF has_issues %]
54
                            <li>You have checked out items. Please return your checked out items before reapplying.</li>
55
                        [% END %]
56
                        [% IF !has_issue and !has_debt %]
57
                            <li>You cannot be discharged for an unknown reason. Please contact library staff for more information.</li>
58
                        [% END %]
59
                        </ul>
60
                    [% ELSIF not messages %]
47
                    [% ELSIF not messages %]
61
                        <h2>What is a discharge?</h2>
48
                        <h2>What is a discharge?</h2>
62
                        <p>This document certifies that you have returned all borrowed items. It is sometimes asked during a file transfer from a school to another. The discharge is sent by us to your school. You will also find it available on your reader account.</p>
49
                        <p>This document certifies that you have returned all borrowed items. It is sometimes asked during a file transfer from a school to another. The discharge is sent by us to your school. You will also find it available on your reader account.</p>
63
                        <p><strong>Warning</strong>: This request is only valid if you are in good standing with the library. Once the application is made, you can not borrow library materials.</p>
50
                        <p><strong>Warning</strong>: This request is only valid if you are in good standing with the library. Once the application is made, you can not borrow library materials.</p>
64
                        [% UNLESS can_be_discharged %]
51
                        [% UNLESS can_be_discharged %]
52
                            [% IF failure %]
53
                                <p> There was an error during the discharge process </p>
54
                            [% END %]
65
                            <div class="alert alert-info">You cannot be discharged because:
55
                            <div class="alert alert-info">You cannot be discharged because:
66
                            <ul>
56
                            <ul>
67
                                [% IF discharge_problems.checkouts %]
57
                                [% IF discharge_problems.checkouts %]
(-)a/opac/opac-discharge.pl (-6 lines)
Lines 49-61 my ( $can_be_discharged, $discharge_problems ) = Link Here
49
    Koha::Patron::Discharge::can_be_discharged( { borrowernumber => $loggedinuser } );
49
    Koha::Patron::Discharge::can_be_discharged( { borrowernumber => $loggedinuser } );
50
my $patron                = Koha::Patrons->find($loggedinuser);
50
my $patron                = Koha::Patrons->find($loggedinuser);
51
my $has_pending_checkouts = $patron->checkouts->count;
51
my $has_pending_checkouts = $patron->checkouts->count;
52
my $has_debt              = ( $patron->account->outstanding_debits->total_outstanding > 0 );
53
52
54
$template->param(
53
$template->param(
55
    can_be_discharged  => $can_be_discharged,
54
    can_be_discharged  => $can_be_discharged,
56
    discharge_problems => $discharge_problems,
55
    discharge_problems => $discharge_problems,
57
    has_checkouts      => $has_pending_checkouts,
58
    has_debt           => $has_debt,
59
);
56
);
60
57
61
my $pending = Koha::Patron::Discharge::count(
58
my $pending = Koha::Patron::Discharge::count(
Lines 82-89 if ( $op eq 'cud-request' ) { Link Here
82
        $template->param( success => 1 );
79
        $template->param( success => 1 );
83
    } else {
80
    } else {
84
        $template->param( failure    => 1 );
81
        $template->param( failure    => 1 );
85
        $template->param( has_issues => $has_pending_checkouts );
86
        $template->param( has_debt   => $has_debt );
87
    }
82
    }
88
} elsif ( $op eq 'get' ) {
83
} elsif ( $op eq 'get' ) {
89
    unless ($available) {
84
    unless ($available) {
90
- 

Return to bug 14250