[Koha-devel] Due Date check in C4::Circulation::CanBookBeIssued?

Michael Hafen mdhafen at tech.washk12.org
Thu Apr 30 16:40:58 CEST 2009


Ok, given that offline circ will call CanBookBeIssued, we need to
proceed carefully with error handling.

The next question I think is will offline circ call GetIssueLength and
do it's own due date calculation while processing a file.  If it doesn't
then some step needs to be taken.  If it does then we will have to take
the first version of this patch with only calculated due dates being
checked.

We could also take the stance that a librarian must know when a due
date, whether entered or calculated, is invalid.  In this case I think
the best solution would be to code process_koc.pl to ignore the
INVALID_DATE error.

On the other hand, if the librarian doesn't need to know whether the
entered or calculated due date is invalid, then we have to take the
third option of leaving the code as it is.  Which is without checking
the validity of the due date.

It's likely that different possibilities will be better for different
people, so there is the fourth option of having a syspref control where
in the code due date checking is done.

I'm partial to having the due date checked, as that will fix the bug
report.  So either option of having process_koc.pl ignore INVALID_DATE
or having CanBookBeIssued only check calculated dates is good for me.

I think I'd go more for the former, having process_koc.pl ignore the
INVALID_DATE error, so librarians can't punk people with overdue fines
as Galen pointed out.

That in mind I think it's a matter of decided between having
process_koc.pl ignore the INVALID_DATE error and coding in a sys pref to
control where the due date check is.

On Wed, 2009-04-29 at 19:23 -0400, Joe Atzberger wrote:
> On Wed, Apr 29, 2009 at 5:05 PM, Michael Hafen
> <mdhafen at tech.washk12.org> wrote:
>         
>         So the question is: should librarians be able to enter an
>         issue date in the past?
> 
> Effectively, I think they already can, if they upload offline circ.
> For example, you circulate items for 5 days, but don't upload your
> offline circ until a week later.  The due date should rightly fall in
> the past.  Note that the question was about due date, not issue date,
> but this example demonstrates that *both* could be in the past.
> 
> 
> And unless there is something else "internal" to the logic, this isn't
> a question for this C4::* function to decide.  Validation of the
> librarian's duedate input must happen at the script level.   
> 
> 
>         I checked offline circulation, and process_koc.pl doesn't call
>         CanBookBeIssued.  It goes staight to AddIssue.
> 
> Yes, this is because of a serious bug: process_koc.pl has no error
> handling.  That needs to change.  Offline circ *should* call
> CanBookBeIssued, and for that to happen it has to allow at least some
> mechanism for incorporating past dates.  If it cannot call
> CanBookBeIssued, it will need a nearly identical copy to perform the
> same action.
> 
> --Joe
-- 
Michael Hafen
Systems Analyst and Programmer
Washington County School District
Utah, USA

for Koha checkout
http://development.washk12.org/gitweb/
or
git://development.washk12.org/koha




More information about the Koha-devel mailing list