Bug 27444 - Allow reports to count open/closed days based on the calendar
Summary: Allow reports to count open/closed days based on the calendar
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-15 18:39 UTC by Andrew Fuerste-Henry
Modified: 2021-01-15 18:40 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2021-01-15 18:39:27 UTC
When writing reports related to fines or overdue notices, one runs into difficulties based on how Koha holidays are stored. There's no good way for SQL to calculate out how many days within a given span were open days. So if you're using the calendar to calculate when to send overdue notices at 10 open days past the due date, there's no way to get SQL to tell you which items should have gotten an overdue notice today.

This becomes more of an issue as we use the patron emailer more, since the patron emailer relies upon a report. If one wanted to use the patron emailer to send a fourth overdue notice, one would not be able to calculate when to send that notice using the Koha calendar.

I'm not sure what the solution is here. Maybe some syntax one could use in a report to ask Koha to generate a value? So you could say something like:

WHERE timestampdiff(days,date_due,curdate()) = <<opendays:date_due,curdate()>>
?