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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt (-19 / +11 lines)
Lines 42-60 Link Here
42
                        <p><a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a></p>
42
                        <p><a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a></p>
43
                    [% ELSIF pending %]
43
                    [% ELSIF pending %]
44
                        <p>Your discharge will be available on this page within a few days.</p>
44
                        <p>Your discharge will be available on this page within a few days.</p>
45
                    [% ELSIF failure %]
46
                        <p>You cannot be discharged because you have checked out items. Please return your checked out items before asking for a discharge.</p>
47
                        <ul>
48
                            [% IF has_debt %]
49
                                <li>You have unpaid charges. Please pay your charges before reapplying.</li>
50
                            [% END %]
51
                            [% IF has_issues %]
52
                                <li>You have checked out items. Please return your checked out items before reapplying.</li>
53
                            [% END %]
54
                            [% IF !has_issue and !has_debt %]
55
                                <li>You cannot be discharged for an unknown reason. Please contact library staff for more information.</li>
56
                            [% END %]
57
                        </ul>
58
                    [% ELSIF not messages %]
45
                    [% ELSIF not messages %]
59
                        <h2>What is a discharge?</h2>
46
                        <h2>What is a discharge?</h2>
60
                        <p
47
                        <p
Lines 63-74 Link Here
63
                        >
50
                        >
64
                        <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>
51
                        <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>
65
                        [% UNLESS can_be_discharged %]
52
                        [% UNLESS can_be_discharged %]
66
                            <div class="alert alert-info"
53
                            [% IF failure %]
67
                                >You cannot be discharged for following reasons:
54
                                <p> There was an error during the discharge process </p>
68
                                <ul>
55
                            [% END %]
69
                                    [% IF discharge_problems.checkouts %]
56
                            <div class="alert alert-info">You cannot be discharged because:
70
                                        <li> You have [% discharge_problems.checkouts | html %] item(s) checked out. Please return your checked out items before reapplying. </li>
57
                            <ul>
71
                                    [% END %]
58
                                [% IF discharge_problems.checkouts %]
59
                                    <li>
60
                                        You have [% discharge_problems.checkouts | html %] item(s) checked out.
61
                                        Please return your checked out items before reapplying.
62
                                    </li>
63
                                [% END %]
72
64
73
                                    [% IF discharge_problems.debt %]
65
                                    [% IF discharge_problems.debt %]
74
                                        <li> You have unpaid charges of [% discharge_problems.debt | $Price %]. Please pay your charges before reapplying. </li>
66
                                        <li> You have unpaid charges of [% discharge_problems.debt | $Price %]. Please pay your charges before reapplying. </li>
(-)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