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

--- Comment #59 from Michaela Sieber <[email protected]> ---
Created attachment 210952
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210952&action=edit
Bug 41307: Backfill the report type and period of the old counter logs

The counter log rows written before Bug 41307 have no report type and
no period, so the Import logs tab shows those rows without a report type
or a period, and their months cannot be read one by one.

The atomicupdate now backfills the rows that have no period, after it
adds the columns:
- the report type is the one of the counter file
- the months come from the Reporting_Period header row of the file, or
  from its month columns when the file has no such row. Before Bug 41294
  one harvest covered several months, so such a row becomes one row per
  month, all with the same file, import date, user and status
- every month gets status success: the old code only wrote a log row
  after a file was imported
- the background job is not linked
A row whose file has no reporting period, or whose report type is
longer than 10 characters, is reported and left without a period. Only
the first 4000 bytes of each file are read. A row that already has a
period is not read again, so running updatedatabase again changes
nothing.

Test plan:
1. On a database with harvests made before this patch, or after
   UPDATE erm_counter_logs SET report_type = NULL, report_year = NULL,
   report_month = NULL; and removing the new columns, run updatedatabase
2. Check that the rows now have a report type and a period, and that a
   file that covered several months has one row per month, all with the
   same file name
3. Open the provider, Import logs tab: every old row shows its report
   type and period, with the Download link
4. Run updatedatabase again, or run the update with the rows already
   backfilled: no counter log is changed

Assisted-by: Sonnet 5.5 (Anthropic)
Signed-off-by: Michaela Sieber <[email protected]>

-- 
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