From: rangi Date: Thu, 22 Sep 2005 23:30:37 +0000 (+0000) Subject: Marks the item borrowed now on the items table X-Git-Tag: dev_week~1159 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=2dbb13abd4f7f3bd2a1c29effc6788f84b73c783;p=koha_fer Marks the item borrowed now on the items table --- diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index 657a0c6286..6e1feb17ad 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -86,6 +86,22 @@ sub itemseen { return; } +=head2 itemborrowed + +&itemseen($itemnum) +Mark item as borrowed. Is called when an item is issued. +C<$itemnum> is the item number + +=cut + +sub itemborrowed { + my ($itemnum) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("update items set itemlost=0, datelastborrowed = now() where items.itemnumber = ?"); + $sth->execute($itemnum); + return; +} + sub listitemsforinventory { my ($minlocation,$maxlocation,$datelastseen,$offset,$size) = @_; my $dbh = C4::Context->dbh; @@ -890,6 +906,7 @@ sub issuebook { $sth->execute($iteminformation->{'issues'},$iteminformation->{'itemnumber'}); $sth->finish; &itemseen($iteminformation->{'itemnumber'}); + itemborrowed($iteminformation->{'itemnumber'}); # If it costs to borrow this book, charge it to the patron's account. my ($charge,$itemtype)=calc_charges($env, $iteminformation->{'itemnumber'}, $borrower->{'borrowernumber'}); if ($charge > 0) {