RE: [Koha-devel] Re: [Koha] Due dates
Chris,
I'm curious how you would choose to approach this issue, strategically. Would you go at it this by adding a separate alternate routine for calculating due-times as opposed to due-dates? Or replace all due dates with hourly durations, then divide out the majority by whole days? I suppose the
Something else to think about ... What if the due date falls on a holiday? It's all very well saying "you've got two weeks" or whatever it is, but especially over the New Year period the due date could be the last day of a five-day break so the borrower is almost a week short of their allotted time. I was going to say "you should add ten working days", but for a library that's probably irrelevant. What you probably need to do is add an "extend a holiday to the next working day" module. Cheers, Wol -----Original Message----- From: Chris Cormack [mailto:chris@katipo.co.nz] Sent: 16 February 2003 00:07 To: Erik Stainsby Cc: koha-devel@lists.sourceforge.net; scraig@deepthought.org Subject: [Koha-devel] Re: [Koha] Due dates On Fri, Feb 14, 2003 at 09:00:57PM -0800, Erik Stainsby said: third
choice might be to make hourly calcs the product of days divided by hourly
period currently in effect ...
Choices, choices ... Love to hear your thoughts.
Hi Erik Ive shifted this over to the devel list as it seems to fit better there :) My initial thought was, currently due dates are calculated by taking the current date and adding an offset. This currently is just a number of days. But using the Date::Manip module it shouldnt be too hard to make this days and minutes/hours eg $date=&DateCalc("today","+ 3hours 12minutes 6 seconds",\$err); For items that have a today + some number of days offset due date, we just set to be the closing time of the library that day. The trick then becomes setting the rules for overdues etc. Currently its set like this | categorycode | itemtype | restrictedtype | rentaldiscount | reservecharge | fine | firstremind | chargeperiod | accountsent | chargename | A | ART | NULL | NULL | 1.000000 | 1.000000 | 7 | 7 | 28 | Fine | Where the firstremind tells us that after 7 days we apply our first charge. This will need to be changed so it handles minutes/hours as well as days. Im still just mulling it over at this stage, It wont be making it into the 2.0 release (Paul has called for a feature freeze). But I think we could get it into one of the 2.1.x releses Any other suggestions gratefully accepted Chris -- Chris Cormack Programmer 025 500 789 Katipo Communications Ltd chris@katipo.co.nz www.katipo.co.nz ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Koha-devel mailing list Koha-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/koha-devel This transmission is intended for the named recipient only. It may contain private and confidential information. If this has come to you in error you must not act on anything disclosed in it, nor must you copy it, modify it, disseminate it in any way, or show it to anyone. Please e-mail the sender to inform us of the transmission error or telephone ECA International immediately and delete the e-mail from your information system. Telephone numbers for ECA International offices are: Sydney +61 (0)2 9911 7799, Hong Kong + 852 2121 2388, London +44 (0)20 7351 5000 and New York +1 212 582 2333.
On Mon, Feb 17, 2003 at 08:54:59AM -0000, Anthony W. Youngman said:
Something else to think about ...
What if the due date falls on a holiday? It's all very well saying "you've got two weeks" or whatever it is, but especially over the New Year period the due date could be the last day of a five-day break so the borrower is almost a week short of their allotted time.
I was going to say "you should add ten working days", but for a library that's probably irrelevant. What you probably need to do is add an "extend a holiday to the next working day" module.
Hiya Yep thats the beauty of the Date::Manip module, you can do just that :) Things like $date=&Date_NextWorkDay($date,$off [,$time]); or $name=&Date_IsHoliday($date); You can then define your holidays in the config file. The holiday section of the config file is used to define holidays. Each line is of the form: DATE = HOLIDAY HOLIDAY is the name of the holiday (or it can be blank in which case the day will still be treated as a holiday... for example the day after Thanksgiving or Christmas is often a work holiday though neither are named). Its really rather neat. Have a look at the Date::Manip man pages if you are interested. Chris -- Chris Cormack Programmer 025 500 789 Katipo Communications Ltd chris@katipo.co.nz www.katipo.co.nz
participants (2)
-
Anthony W. Youngman -
Chris Cormack