https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42218

--- Comment #25 from Matt Blenkinsop <[email protected]> ---
Created attachment 210268
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210268&action=edit
Bug 42218: Rebuild erm_usage_yus from the monthly usage

Yearly usage rows were written by CounterFile per COUNTER file: the
months of one file were summed and the row was deduplicated on a hash
that included the total. A re-harvest of the same year with a different
total added a second row, and a year spread over two files gave two
partial totals. The yearly numbers were wrong and could not be repaired.

erm_usage_yus stays a table, but its rows are now always the sum of
erm_usage_mus per year, so erm_usage_mus is the only source of the
yearly numbers:
- YearlyUsages->rebuild deletes and inserts the rows of one provider,
  report type and year from the sum of erm_usage_mus over every key
  column (usage object, provider, year, metric type, access type, yop
  and report type). It locks the provider row, as the jobs of the months
  of one provider run in parallel
- CounterFile no longer builds or stores yearly usage entries per file.
  When all rows are done it calls rebuild for each year of the file
- UsageObject->yearly_usages is a plain getter, the same as
  erm_usage_yuses
- Koha::ERM::EUsage::YearlyUsage->store and ->delete throw, the object
  is read-only
- the SUSHI harvester job report drops the added_yus and skipped_yus
  counters and the template no longer shows them

Assisted-by: Sonnet 5 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to