No subject


Wed Jan 4 10:30:06 CET 2012


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.


More information about the Koha-bugs mailing list