From 128ec6eb4eab2a397075ef010a021859abfc342e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 23 Oct 2025 11:50:27 +0100 Subject: [PATCH] Bug 23415: (QA follow-up) Fix spelling: oweing -> owing Standardizes error code spelling across the codebase: - Changes 'too_much_oweing' to 'too_much_owing' - Changes 'auto_too_much_oweing' to 'auto_too_much_owing' The word "owing" is the correct spelling in English. Files updated: - C4/Circulation.pm - C4/SIP/Sip/MsgType.pm - circ/renew.pl - koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt - koha-tmpl/intranet-tmpl/prog/js/checkouts.js - koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt - koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt - misc/cronjobs/automatic_renewals.pl - opac/opac-reserve.pl - opac/opac-user.pl - t/db_dependent/Circulation.t All tests pass successfully. --- C4/Circulation.pm | 6 +++--- C4/SIP/Sip/MsgType.pm | 2 +- circ/renew.pl | 2 +- .../prog/en/modules/circ/renew.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 4 ++-- .../bootstrap/en/modules/opac-reserve.tt | 4 ++-- .../bootstrap/en/modules/opac-user.tt | 2 +- misc/cronjobs/automatic_renewals.pl | 2 +- opac/opac-reserve.pl | 2 +- opac/opac-user.pl | 2 +- t/db_dependent/Circulation.t | 20 +++++++++---------- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 85e5d6a1619..2865b54fc3c 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3210,7 +3210,7 @@ sub CanBookBeRenewed { # extra notices being sent. Cron also implies no override return ( 0, $auto_renew ) if $auto_renew =~ 'auto_account_expired'; return ( 0, $auto_renew ) if $auto_renew =~ 'auto_too_late'; - return ( 0, $auto_renew ) if $auto_renew =~ 'auto_too_much_oweing'; + return ( 0, $auto_renew ) if $auto_renew =~ 'auto_too_much_owing'; my $issuing_rule = Koha::CirculationRules->get_effective_rules( { @@ -3252,7 +3252,7 @@ sub CanBookBeRenewed { { return ( 0, 'overdue' ); } elsif ( $finesblockrenewing && $balance > $finesblockrenewing ) { - return ( 0, 'too_much_oweing' ); + return ( 0, 'too_much_owing' ); } } @@ -4994,7 +4994,7 @@ sub _CanBookBeAutoRenewed { ? $patron->account->balance : $patron->account->outstanding_debits->total_outstanding; if ( $amountoutstanding and $amountoutstanding > $fine_no_renewals ) { - return "auto_too_much_oweing"; + return "auto_too_much_owing"; } } diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm index 9f1cdd54602..c7c24d1ea0e 100644 --- a/C4/SIP/Sip/MsgType.pm +++ b/C4/SIP/Sip/MsgType.pm @@ -1253,7 +1253,7 @@ sub handle_fee_paid { "auto_account_expired" => "Scheduled for automatic renewal and cannot be renewed because the patron's account has expired", "auto_renew" => "Scheduled for automatic renewal", - "auto_too_much_oweing" => "Scheduled for automatic renewal", + "auto_too_much_owing" => "Scheduled for automatic renewal", "on_reserve" => "On hold for another patron", "patron_restricted" => "Patron is currently restricted", "item_denied_renewal" => "Item is not allowed renewal", diff --git a/circ/renew.pl b/circ/renew.pl index ecbc33e105c..44ab1435fca 100755 --- a/circ/renew.pl +++ b/circ/renew.pl @@ -95,7 +95,7 @@ if ( $op eq 'cud-renew' && $barcode ) { ); } - if ( $error && ( $error eq 'too_much_oweing' or $error eq 'auto_too_much_oweing' ) ) { + if ( $error && ( $error eq 'too_much_owing' or $error eq 'auto_too_much_owing' ) ) { if ( $override_debt && C4::Context->preference("AllowFineOverrideRenewing") ) { $can_renew = 1; $error = undef; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt index 45593c5bc43..5da4ffd761e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt @@ -126,7 +126,7 @@ [% END %] - [% ELSIF error == "auto_renew" or error == "auto_too_much_oweing" %] + [% ELSIF error == "auto_renew" or error == "auto_too_much_owing" %]

[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal.

[% SET override_limit = error == "auto_renew" ? "AUTO_RENEW" : "TOO_MUCH" %] @@ -139,7 +139,7 @@ [% END %] - [% ELSIF error == "too_much_oweing" %] + [% ELSIF error == "too_much_owing" %]
  • The patron has a debt of [% balance | $Price %].
  • [% IF Koha.Preference('AllowFineOverrideRenewing') %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index c6088f24b78..107541a2c99 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -437,7 +437,7 @@ function LoadIssuesTable() { span_style = "display: none"; span_class = "renewals-allowed"; } else if ( - oObj.can_renew_error == "auto_too_much_oweing" + oObj.can_renew_error == "auto_too_much_owing" ) { msg += "" + @@ -472,7 +472,7 @@ function LoadIssuesTable() { span_style = "display: none"; span_class = "renewals-allowed"; - } else if (oObj.can_renew_error == "too_much_oweing") { + } else if (oObj.can_renew_error == "too_much_owing") { msg += "" + __( diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 363702f9262..c821eba5d8b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -59,8 +59,8 @@ [% INCLUDE "patron-restrictions.inc" %] [% END %] - [% IF ( too_much_oweing ) %] -
  • You have unpaid fines. Amount: [% too_much_oweing | $Price %].
  • + [% IF ( too_much_owing ) %] +
  • You have unpaid fines. Amount: [% too_much_owing | $Price %].
  • [% END %] [% IF ( too_many_reserves ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 27d287c20b2..6534b4923a1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -451,7 +451,7 @@ Not allowed (overdue) [% ELSIF ( ISSUE.auto_too_late ) %] No longer renewable - [% ELSIF ISSUE.auto_too_much_oweing %] + [% ELSIF ISSUE.auto_too_much_owing %] Automatic renewal failed, you have unpaid fines. ( [% I18N.tx("{renewals_left} of {renewals_allowed} renewals remaining", { renewals_left = ISSUE.renewsleft, renewals_allowed = ISSUE.renewsallowed }) %] diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl index faa3cdf43d0..0761c68b804 100755 --- a/misc/cronjobs/automatic_renewals.pl +++ b/misc/cronjobs/automatic_renewals.pl @@ -243,7 +243,7 @@ sub _ProcessRenewals { || $error eq 'too_unseen' || $error eq 'auto_account_expired' || $error eq 'auto_too_late' - || $error eq 'auto_too_much_oweing' + || $error eq 'auto_too_much_owing' || $error eq 'auto_too_soon' || $error eq 'item_denied_renewal' || $error eq 'item_issued_to_other_patron' diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index d35ae935f37..6be009e0d3f 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -125,7 +125,7 @@ if ( !$can_place_holds ) { if ( $msg->message eq 'expired' ) { $template->param( expired_patron => 1 ); } elsif ( $msg->message eq 'debt_limit' ) { - $template->param( too_much_oweing => sprintf( "%.02f", $msg->{payload}->{total_outstanding} ) ); + $template->param( too_much_owing => sprintf( "%.02f", $msg->{payload}->{total_outstanding} ) ); } elsif ( $msg->message eq 'bad_address' ) { $template->param( GNA => 1 ); } elsif ( $msg->message eq 'card_lost' ) { diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 429374fa457..4b59548d0f1 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -258,7 +258,7 @@ if ( $pending_checkouts->count ) { # Useless test $issue->{'auto_renew'} = 1 if $renewerror eq 'auto_renew'; $issue->{'auto_too_soon'} = 1 if $renewerror eq 'auto_too_soon'; $issue->{'auto_too_late'} = 1 if $renewerror eq 'auto_too_late'; - $issue->{'auto_too_much_oweing'} = 1 if $renewerror eq 'auto_too_much_oweing'; + $issue->{'auto_too_much_owing'} = 1 if $renewerror eq 'auto_too_much_owing'; $issue->{'item_denied_renewal'} = 1 if $renewerror eq 'item_denied_renewal'; $issue->{'item_issued_to_other_patron'} = 1 if $renewerror eq 'item_issued_to_other_patron'; diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index 8aef1fb44df..eff67f6cc81 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -1325,7 +1325,7 @@ subtest "CanBookBeRenewed tests" => sub { is( $error, 'auto_renew', 'Cannot renew, renew is automatic' ); }; - subtest "auto_too_much_oweing | OPACFineNoRenewalsBlockAutoRenew & OPACFineNoRenewalsIncludeCredits" => sub { + subtest "auto_too_much_owing | OPACFineNoRenewalsBlockAutoRenew & OPACFineNoRenewalsIncludeCredits" => sub { plan tests => 10; my $item_to_auto_renew = $builder->build_sample_item( { @@ -1393,8 +1393,8 @@ subtest "CanBookBeRenewed tests" => sub { } )->status('RETURNED')->store; ( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $issue ); - is( $renewokay, 0, 'Do not renew, renewal is automatic' ); - is( $error, 'auto_too_much_oweing', 'Cannot auto renew, FineNoRenewals=10, patron has 15' ); + is( $renewokay, 0, 'Do not renew, renewal is automatic' ); + is( $error, 'auto_too_much_owing', 'Cannot auto renew, FineNoRenewals=10, patron has 15' ); $account->add_credit( { @@ -1415,7 +1415,7 @@ subtest "CanBookBeRenewed tests" => sub { ( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $issue ); is( $renewokay, 0, 'Do not renew, renewal is automatic' ); is( - $error, 'auto_too_much_oweing', + $error, 'auto_too_much_owing', 'Cannot auto renew, FineNoRenewals=10, OPACFineNoRenewalsIncludeCredits=1, patron has 15 debt, 5 credit' ); @@ -1903,20 +1903,20 @@ subtest "CanBookBeRenewed tests" => sub { # Too much debt t::lib::Mocks::mock_preference( 'FineNoRenewals', 1 ); ( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $issue_1 ); - is( $renewokay, 0, 'Cannot renew, too much debt and FineNoRenewals=1' ); - is( $error, 'too_much_oweing', 'Cannot renew, debt not allowed (returned code is too_much_oweing)' ); + is( $renewokay, 0, 'Cannot renew, too much debt and FineNoRenewals=1' ); + is( $error, 'too_much_owing', 'Cannot renew, debt not allowed (returned code is too_much_owing)' ); # AllowFineOverrideRenewing should not affect CanBookBeRenewed behavior # The preference only controls whether staff can override in the UI t::lib::Mocks::mock_preference( 'AllowFineOverrideRenewing', 1 ); ( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $issue_1 ); - is( $renewokay, 0, 'Cannot renew, too much debt even with AllowFineOverrideRenewing enabled' ); - is( $error, 'too_much_oweing', 'Error code still too_much_oweing with AllowFineOverrideRenewing enabled' ); + is( $renewokay, 0, 'Cannot renew, too much debt even with AllowFineOverrideRenewing enabled' ); + is( $error, 'too_much_owing', 'Error code still too_much_owing with AllowFineOverrideRenewing enabled' ); t::lib::Mocks::mock_preference( 'AllowFineOverrideRenewing', 0 ); ( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $issue_1 ); - is( $renewokay, 0, 'Cannot renew, too much debt with AllowFineOverrideRenewing disabled' ); - is( $error, 'too_much_oweing', 'Error code still too_much_oweing with AllowFineOverrideRenewing disabled' ); + is( $renewokay, 0, 'Cannot renew, too much debt with AllowFineOverrideRenewing disabled' ); + is( $error, 'too_much_owing', 'Error code still too_much_owing with AllowFineOverrideRenewing disabled' ); C4::Context->dbh->do("DELETE FROM accountlines"); }; -- 2.51.0