Due Date Calculated From Now in Checkout and Renew unless Due Date passed as argument

Bug #1222240 reported by Jason Stephenson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

EG Version: Master (and probably all prior)
OpenSRF Version: N/A
PostgreSQL Version: N/A

I am presently running a script to create circulations from a CSV file as part of a new member's migration from their old ILS to Evergreen. I create the circulations with arguments like the following:

$args = {
          'permit_override' => 1,
          'patron_barcode' => '27003000276520',
          'checkout_time' => '20130605 13:25:18',
          'barcode' => '37003700608350'
};

I have already created circ_matrix_matchpoint entries for the org_unit in question, so I do get the proper duration, fine, and other rules selected. However, I've noticed that when run today the above returns the following in the circ member of the response payload:

$circ = bless( [
                 undef,
                 undef,
                 undef,
                 89,
                 957019,
                 'f',
                 '2013-09-28T23:59:59-0400',
                 '21 days',
                 '21_day_2_renew',
                 '1 day',
                 14644353,
                 '3.00',
                 '3_dollars',
                 'f',
                 'f',
                 '0.10',
                 '10_cents',
                 2,
                 '1 day',
                 undef,
                 undef,
                 10742807,
                 967868,
                 undef,
                 '2013-06-05T13:25:18-0400',
                 '2013-09-07T15:04:56-0400',
                 1045,
                 undef,
                 undef,
                 undef,
                 undef,
                 undef,
                 undef,
                 undef,
                 undef,
                 undef,
                 undef,
                 1
               ], 'Fieldmapper::action::circulation' );

This shows the due date is being set from the time that the transaction is actually created and not from the checkout_time. I was expecting the due date to be calculated from the checkout time if provided.

In some cases, I have a due date to provide. However, the file I am given has a renewal and checkout in a single line and only 1 due date is provided. I am also concerned that in some cases the due dates in the original file may not correspond to the rules indicated in the circ_matrix_matchpoint, particularly in the case of older circulations, from 2005 and earlier.

In short, I'd like for the due date to be calculated from the checkout time and not from now, if a checkout time is provided.

A branch will likely follow in a day or two.

Revision history for this message
Jason Stephenson (jstephenson) wrote :
Revision history for this message
Jason Stephenson (jstephenson) wrote :

Seems to be working for us and is about to go into production on our system.

tags: added: pullrequest
Revision history for this message
Jason Stephenson (jstephenson) wrote :

I rebased and signed off on the branch in comment #1. It is the HEAD commit. I added to the commit message to explain some of the reasoning behind the change. The commit message is longer than the commit itself at this point.

I figure it can wait until after the beta is released and the 2.5 branches are created before it goes into master. It's arguably a bug fix, but I'm inclined to see it as a feature change more than anything.

I'll give everyone a chance to comment on it, but it does have the requisite two sign offs and both from committers.

Revision history for this message
Ben Shum (bshum) wrote :

Pulling this out of the void and assigning a target for review. May need backporting to other series? Leaving those targets alone for the moment.

Changed in evergreen:
milestone: none → 2.6.0-rc1
status: New → Triaged
importance: Undecided → Medium
Changed in evergreen:
milestone: 2.6.0-rc1 → 2.next
Dan Wells (dbw2)
Changed in evergreen:
assignee: nobody → Dan Wells (dbw2)
Revision history for this message
Dan Wells (dbw2) wrote :

This looks perfectly sensible to me. I'd tend to agree that it's a feature, so pushed to master, with thanks!

Changed in evergreen:
status: Triaged → Fix Committed
assignee: Dan Wells (dbw2) → nobody
Revision history for this message
Ben Shum (bshum) wrote :

Changing milestone to reflect real target of 2.8 series - 2.8 beta, here we come!

Changed in evergreen:
milestone: 2.next → 2.8-beta
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.