Bug 33271: Add collective owing message to moremember page

To test:
1. Turn on NoIssuesChargeGuarantorsWithGuarantees and set the amount to 5.
2. Create a guarantor/guarantee relationship.
3. Add a manual invoice to the guarantor that is larger than 5.00.
4. Notice the message on that circulation ( check out tab ) page. " Charges: Patron's guarantors and their other guarantees collectively owe X. Checkouts are BLOCKED because fine balance is OVER THE LIMIT. "
5. Look at the moremember ( details ) page. The same message does not appear.
6. Apply patch, restart_all
7. Try step 5 again, the message should now appear.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Lucas Gass 2023-04-12 17:29:43 +00:00 committed by Tomas Cohen Arazi
parent 3a805557db
commit 8939dc9928
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 14 additions and 1 deletions

View File

@ -76,7 +76,7 @@
[% END %]
<a class="btn btn-xs btn-default" href="#reldebarments" onclick="$('#reldebarments-tab').click()"><i class="fa fa-ban"></i> View restrictions</a>
[% IF (noissues && CAN_user_circulate_force_checkout) %]
[% IF (noissues && CAN_user_circulate_force_checkout && !moremember) %]
<span class="override_debarment">
<a href="/cgi-bin/koha/circ/circulation.pl?forceallow=1&amp;borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-xs btn-default">Override restriction temporarily</a>
</span>

View File

@ -251,6 +251,19 @@ if( ( my $owing = $account->non_issues_charges ) > 0 ) {
);
}
# Check the debt of this patrons guarantors *and* the guarantees of those guarantors
my $no_issues_charge_guarantors = C4::Context->preference("NoIssuesChargeGuarantorsWithGuarantees");
if ( $no_issues_charge_guarantors ) {
my $guarantors_non_issues_charges = $patron->relationships_debt({ include_guarantors => 1, only_this_guarantor => 0, include_this_patron => 1 });
if ( $guarantors_non_issues_charges > $no_issues_charge_guarantors ) {
$template->param(
noissues => 1,
charges_guarantors_guarantees => $guarantors_non_issues_charges
);
}
}
# if the expiry date is before today ie they have expired
if ( $patron->is_expired ) {
#borrowercard expired, no issues