Bug 4326 - Items marked as returned yesterday, even if checked out today
Summary: Items marked as returned yesterday, even if checked out today
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: PC All
: P4 normal (vote)
Assignee: Ian Walls
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-19 09:09 UTC by Ian Walls
Modified: 2012-10-25 22:53 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Patch for bug 4326 (1.42 KB, patch)
2010-03-31 12:52 UTC, Chris Cormack
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:25:52 UTC


---- Reported by ian.walls@bywatersolutions.com 2010-03-19 21:09:08 ----

Items returned today as being marked as returned yesterday, even if DropboxMode is not set.  This is true even if the item was returned the same day it was issued (making the return date BEFORE the issue date).

The problem occurs in Circulation.pm, in the AddReserve subroutine.  Code:
------------
if ($doreturn) {
        $borrower or warn "AddReturn without current borrower";
		my $circControlBranch = _GetCircControlBranch($item,$borrower);
        if ($dropbox) {
            # don't allow dropbox mode to create an invalid entry in issues (issuedate > returndate) FIXME: actually checks eq, not gt
            undef($dropbox) if ( $item->{'issuedate'} eq C4::Dates->today('iso') );
        }

        if ($borrowernumber) {
            MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch);
            $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?  This could be the borrower hash.
        }

        ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'});
    }
------------

$circControlBranch should not be defined unless $dropbox is true, and even then only if issuedate < today.



---- Additional Comments From ian.walls@bywatersolutions.com 2010-03-22 18:19:25 ----

Patch submitted



---- Additional Comments From ian.walls@bywatersolutions.com 2010-03-31 12:52:19 ----

Created an attachment
Patch for http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4326





---- Additional Comments From gmcharlt@gmail.com 2010-04-30 03:17:38 ----

Patch pushed.  Please test and close.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:25 UTC  ---

This bug was previously known as _bug_ 4326 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4326
Imported an attachment (id=2012)

Actual time not defined. Setting to 0.0
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
The original submitter of attachment 2012 [details] [review] is unknown.
   Reassigning to the person who moved it here: chris@bigballofwax.co.nz.

Comment 1 Ian Walls 2010-09-17 18:18:23 UTC
Tested over the last several months, no recurrences found.  Closing.