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 should pass successfully. Sponsored-by: OpenFifth <https://openfifth.co.uk/> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This commit is contained in:
parent
160b1556b6
commit
58b560d9f9
|
|
@ -3238,7 +3238,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(
|
||||
{
|
||||
|
|
@ -3280,7 +3280,7 @@ sub CanBookBeRenewed {
|
|||
{
|
||||
return ( 0, 'overdue' );
|
||||
} elsif ( $finesblockrenewing && $balance > $finesblockrenewing ) {
|
||||
return ( 0, 'too_much_oweing' );
|
||||
return ( 0, 'too_much_owing' );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -5053,7 +5053,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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1246,7 +1246,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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@
|
|||
<input type="submit" class="btn btn-default approve" value="Override and renew" />
|
||||
</form>
|
||||
[% END %]
|
||||
[% ELSIF error == "auto_renew" or error == "auto_too_much_oweing" %]
|
||||
[% ELSIF error == "auto_renew" or error == "auto_too_much_owing" %]
|
||||
<p>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal. </p>
|
||||
[% SET override_limit = error == "auto_renew" ? "AUTO_RENEW" : "TOO_MUCH" %]
|
||||
|
||||
|
|
@ -139,7 +139,7 @@
|
|||
<button type="submit" class="btn btn-default approve"><i class="fa fa-check"></i> Override limit and renew</button>
|
||||
</form>
|
||||
[% END %]
|
||||
[% ELSIF error == "too_much_oweing" %]
|
||||
[% ELSIF error == "too_much_owing" %]
|
||||
<li>The patron has a debt of [% balance | $Price %].</li>
|
||||
[% IF Koha.Preference('AllowFineOverrideRenewing') %]
|
||||
<form method="post" action="/cgi-bin/koha/circ/renew.pl">
|
||||
|
|
|
|||
|
|
@ -468,7 +468,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 +=
|
||||
"<span class='renewals-disabled'>" +
|
||||
|
|
@ -503,7 +503,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 +=
|
||||
"<span class='renewals-disabled'>" +
|
||||
__(
|
||||
|
|
|
|||
|
|
@ -59,8 +59,8 @@
|
|||
[% INCLUDE "patron-restrictions.inc" %]
|
||||
[% END %]
|
||||
|
||||
[% IF ( too_much_oweing ) %]
|
||||
<li id="too_much_oweing"> You have unpaid fines. Amount: [% too_much_oweing | $Price %]. </li>
|
||||
[% IF ( too_much_owing ) %]
|
||||
<li id="too_much_owing"> You have unpaid fines. Amount: [% too_much_owing | $Price %]. </li>
|
||||
[% END %]
|
||||
|
||||
[% IF ( too_many_reserves ) %]
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@
|
|||
<span class="usr-msg no-renew-overdue">Not allowed <span class="renewals">(overdue)</span></span>
|
||||
[% ELSIF ( ISSUE.auto_too_late ) %]
|
||||
<span class="usr-msg no-renew-too-late">No longer renewable</span>
|
||||
[% ELSIF ISSUE.auto_too_much_oweing %]
|
||||
[% ELSIF ISSUE.auto_too_much_owing %]
|
||||
<span class="usr-msg auto-renew-fines">Automatic renewal failed, you have unpaid fines.</span>
|
||||
<span class="renewals"
|
||||
>( [% I18N.tx("{renewals_left} of {renewals_allowed} renewals remaining", { renewals_left = ISSUE.renewsleft, renewals_allowed = ISSUE.renewsallowed }) %]
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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' ) {
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -1324,7 +1324,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(
|
||||
{
|
||||
|
|
@ -1392,8 +1392,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(
|
||||
{
|
||||
|
|
@ -1414,7 +1414,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'
|
||||
);
|
||||
|
||||
|
|
@ -1972,20 +1972,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");
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue