@@ -, +, @@ has checked out items --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt | 7 ++++++- opac/opac-discharge.pl | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt @@ -44,7 +44,12 @@

What is a discharge?

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.

Warning: 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.

- Ask for a discharge + [% IF has_checkouts %] +
You cannot be discharged, you have checked out items. Please return items before asking for a discharge.
+ [% ELSE %] + Ask for a discharge + [% END %] + [% END %] --- a/opac/opac-discharge.pl +++ a/opac/opac-discharge.pl @@ -47,6 +47,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ debug => 1, }); +my $can_be_discharged = Koha::Patron::Discharge::can_be_discharged({ borrowernumber => $loggedinuser }); +if ($can_be_discharged == 0) { + $template->param( has_checkouts => 1 ); +} + if ( $op eq 'request' ) { my $success = Koha::Patron::Discharge::request({ borrowernumber => $loggedinuser, --