http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8251
Koha Team Lyon 3 <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #10348|0 |1 is obsolete| | --- Comment #9 from Koha Team Lyon 3 <[email protected]> --- Created attachment 10597 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=10597&action=edit Patrons get incorrectly debarred >From a duration calculated with "$duration= $datestart_temp - $dateend_temp" subtract method (used to exclude holidays) can't apply correctly because it only do subtraction to the day value and not the global amount of month and days. Depending on the amount of closed holidays, this may end with a negative value for the days : a patron may not be restricted even with much late. example : A patron is 1 month and 3 days late. There are 6 days closed for holidays. Duration hash will look like this : $VAR1 = bless( { 'seconds' => 0, 'minutes' => 0, 'end_of_month' => 'wrap', 'nanoseconds' => 0, 'days' => -3, 'months' => 1 }, 'DateTime::Duration' ); May be there is an adequate Datetime::Duration method to calculate correctly but I could'nt find it in Datetime jungle. So, I came back to my first idea : keeping the calculation of duration with delta_days method (with this one the duration value is set only in day units and so subtract method applies correctly), then checking for late and if not, make the delta number negative. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
