@@ -, +, @@ regular and on-site checkouts --- C4/Circulation.pm | 18 +++++++--- .../prog/en/modules/circ/circulation.tt | 41 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 5 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -477,6 +477,7 @@ sub TooMany { reason => 'TOO_MANY_ONSITE_CHECKOUTS', count => $onsite_checkout_count, max_allowed => $max_onsite_checkouts_allowed, + issuing_rule => $issuing_rule, } } } @@ -487,6 +488,7 @@ sub TooMany { reason => 'TOO_MANY_CHECKOUTS', count => $checkout_count, max_allowed => $max_checkouts_allowed, + issuing_rule => $issuing_rule, }; } } elsif ( not $onsite_checkout ) { @@ -495,6 +497,7 @@ sub TooMany { reason => 'TOO_MANY_CHECKOUTS', count => $checkout_count - $onsite_checkout_count, max_allowed => $max_checkouts_allowed, + issuing_rule => $issuing_rule, }; } } @@ -531,6 +534,7 @@ sub TooMany { reason => 'TOO_MANY_ONSITE_CHECKOUTS', count => $onsite_checkout_count, max_allowed => $max_onsite_checkouts_allowed, + issuing_rule => $issuing_rule, } } } @@ -541,6 +545,7 @@ sub TooMany { reason => 'TOO_MANY_CHECKOUTS', count => $checkout_count, max_allowed => $max_checkouts_allowed, + issuing_rule => $issuing_rule, }; } } elsif ( not $onsite_checkout ) { @@ -549,13 +554,14 @@ sub TooMany { reason => 'TOO_MANY_CHECKOUTS', count => $checkout_count - $onsite_checkout_count, max_allowed => $max_checkouts_allowed, + issuing_rule => $issuing_rule, }; } } } if ( not defined( $issuing_rule ) and not defined($branch_borrower_circ_rule->{maxissueqty}) ) { - return { reason => 'NO_RULE_DEFINED', max_allowed => 0 }; + return { reason => 'NO_RULE_DEFINED', max_allowed => 0, issuing_rule => $issuing_rule }; } # OK, the patron can issue !!! @@ -842,13 +848,15 @@ sub CanBookBeIssued { $needsconfirmation{PATRON_CANT} = 1; } if ( C4::Context->preference("AllowTooManyOverride") ) { - $needsconfirmation{TOO_MANY} = $toomany->{reason}; + $needsconfirmation{TOO_MANY} = $toomany->{reason}; $needsconfirmation{current_loan_count} = $toomany->{count}; - $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed}; + $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed}; + $needsconfirmation{issuing_rule} = $toomany->{issuing_rule}; } else { - $issuingimpossible{TOO_MANY} = $toomany->{reason}; + $issuingimpossible{TOO_MANY} = $toomany->{reason}; $issuingimpossible{current_loan_count} = $toomany->{count}; - $issuingimpossible{max_loans_allowed} = $toomany->{max_allowed}; + $issuingimpossible{max_loans_allowed} = $toomany->{max_allowed}; + $issuingimpossible{issuing_rule} = $toomany->{issuing_rule}; } } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -230,10 +230,18 @@ $(document).ready(function() { [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %]
  • Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.
  • +
  • + Maximum checkouts calculated from the circulation rule for + [% INCLUDE issuing_rule_criteria %] +
  • [% END %] [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %]
  • Too many on-site checked out. [% current_loan_count %] on-site checked out, only [% max_loans_allowed %] are allowed.
  • +
  • + Maximum on-site checkouts calculated from the circulation rule for + [% INCLUDE issuing_rule_criteria %] +
  • [% END %] [% IF ( BORRNOTSAMEBRANCH ) %] @@ -513,6 +521,10 @@ $(document).ready(function() { [% IF ( TOO_MANY ) %]
  • Too many checked out. [% current_loan_count %] checked out, only [% max_loans_allowed %] are allowed.
  • +
  • + Maximum checkouts calculated from the circulation rule for + [% INCLUDE issuing_rule_criteria %] +
  • [% END %] [% IF ( ITEMNOTSAMEBRANCH ) %] @@ -1039,3 +1051,32 @@ No patron matched [% message | html %] [% INCLUDE 'intranet-bottom.inc' %] + +[% BLOCK issuing_rule_criteria %] + +[% END %] --