When a document is checked in : 1) The due date displayed is the date of the checkin operation. It's not very useful for librarians as they can't see if the patron was late. 2) When checking in a late document, the displayed "due date" is not even the date of today, but the date of tomorrow! To correct both problems: -> Shouldn't we display the initial due date instead?
CORRECTION: The bug only appears when the document is late, and the displayed date is then the date of tomorrow. Only one problem then. And no question about the solution.
*** Bug 8046 has been marked as a duplicate of this bug. ***
I suspect this commit: 99eccc18ed4a21fa416a3d61fed3f70825dc2203 (Bug 5549), but it's hard to tell because I can't even open returns.pl under that revision ("Undefined subroutine &main::now called at /home/oleonard/kohaclone/circ/returns.pl line 180.")
Looks like the problem comes from the _FixFineDaysOnReturn function in Circulation.pm The commit mentionned by Owen is pushed but the bug 5549 is still only signed off. Are the houly loans partly implemented ?
No the patch on there is a further enhancement.
Ok. What I see is that after the following line : my $dt_due = dt_from_string( $datedue ); the $datedue value is broken, getting the value of today. Is dt_from_string really supposed to work this way?
I misread some logs, the error actually comes from the following line in _FixFineDaysOnReturn: my $deltadays = $calendar->days_between( $dt_due, $dt_today ); When calculating the delay for the fine management, the due date is modified. I'm not familiar with these dates handling and I'm not sure yet of the best fix. I keep looking at it.
Created attachment 9428 [details] [review] proposed patch #1 The due date was sent as a DateTime object parameter to the method "days_between" in Koha/Calendar.pm and was altered in the process. Added cloning to prevent this behaviour.
Created attachment 9429 [details] [review] [SIGNED-OFF] Bug 8045: fixes "date due" when checking in Added cloning of object parameters in "days_between" method. Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> Checked in items that were overdue, due in the future and not checked out and all showed the right info in the check in table.
Clones start and end dates, which prevents any leaked modifications to the object. Marking as Passed QA.
Bugfix will be in 3.8.1