Bug 35418: Fix _get_usage_months

No longer falls in an endless loop if the last month in the report period is december.

Test plan:
1) Apply just the tests patch, run EUsage tests
prove t/db_dependent/Koha/ERM/EUsage/
2) Wait for a few seconds. Notice SushiCounter.t it hangs. CTRL+C (cancel it)
3) Apply the fix patch.
4) Run the tests again. Notice all EUsage tests pass with no issues.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-11-28 13:24:49 +00:00 committed by Tomas Cohen Arazi
parent 684d9263e8
commit 9988925fb5
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -681,7 +681,7 @@ sub _get_usage_months {
my $end_year = substr( $end_date[0], 0, 4 );
my @month_headings = ();
while ( $begin_month <= $end_month || $begin_year < $end_year ) {
while ( $begin_year <= $end_year && ( $begin_year != $end_year || $begin_month <= $end_month ) ) {
push(
@month_headings,
$column_headings_formatting