[Koha-patches] [PATCH] bug: itemlost message doesn't get shown when item returned

Michael Hafen mdhafen at tech.washk12.org
Tue Dec 23 22:10:15 CET 2008


This patch causes another bug, which is that the item is never set
lost=0.  I'll make another patch and resubmit.
I'm thinking of moving the lost=0 set to FixAccountForLostAndReturned.
That already mods paidfor.

On Fri, 2008-12-19 at 12:42 -0700, Michael Hafen wrote:
> There are two reasons the message doesn't get shown.  First is that
> itemlost isn't checked because the item is returned when it's marked
> lost.  The second reason is that ModDateLastSeen sets itemlost to 0.
> This patch fixes these two spots.
> ---
>  C4/Circulation.pm |    2 ++
>  C4/Items.pm       |    2 +-
>  2 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/C4/Circulation.pm b/C4/Circulation.pm
> index d48d4f7..70ebd07 100644
> --- a/C4/Circulation.pm
> +++ b/C4/Circulation.pm
> @@ -1388,6 +1388,8 @@ sub AddReturn {
>  			  ($borrower) = C4::Members::GetMemberDetails( $iteminformation->{borrowernumber}, 0 );
>          }       
>          # fix up the accounts.....
> +	# Lost items are returned, so itemlost won't be set here unless...
> +	$iteminformation->{'itemlost'} = GetItem( $iteminformation->{'itemnumber'} )->{'itemlost'};
>          if ( $iteminformation->{'itemlost'} ) {
>              $messages->{'WasLost'} = 1;
>          }
> diff --git a/C4/Items.pm b/C4/Items.pm
> index 3aef697..227bd61 100644
> --- a/C4/Items.pm
> +++ b/C4/Items.pm
> @@ -536,7 +536,7 @@ sub ModDateLastSeen {
>      my ($itemnumber) = @_;
>      
>      my $today = C4::Dates->new();    
> -    ModItem({ itemlost => 0, datelastseen => $today->output("iso") }, undef, $itemnumber);
> +    ModItem({ datelastseen => $today->output("iso") }, undef, $itemnumber);
>  }
>  
>  =head2 DelItem
-- 
Michael Hafen
Systems Analyst and Programmer
Washington County School District
Utah, USA

for Koha checkout
http://koha-dev.washk12.org
or
git://koha-dev.washk12.org/koha




More information about the Koha-patches mailing list