Browse Source

Debugging circulation

master
olwen 22 years ago
parent
commit
d15eb43d4b
  1. 2
      C4/Circulation/Issues.pm
  2. 5
      C4/Circulation/Renewals.pm
  3. 3
      C4/Circulation/Returns.pm

2
C4/Circulation/Issues.pm

@ -169,6 +169,7 @@ sub updateissues{
# issue the book
my ($env,$itemno,$bitno,$dbh,$bornum)=@_;
my $loanlength=21;
debug_msg($env,"loan length");
my $query="Select loanlength from biblioitems,itemtypes
where (biblioitems.biblioitemnumber='$bitno')
and (biblioitems.itemtype = itemtypes.itemtype)";
@ -178,6 +179,7 @@ sub updateissues{
$loanlength = $data->{'loanlength'}
}
$sth->finish;
debug_msg($env,"issue");
my $datedue = time + $loanlength;
my @datearr = localtime($datedue);
my $dateduef = (1900+$datearr[5])."-".$datearr[4]."-".$datearr[3];

5
C4/Circulation/Renewals.pm

@ -74,10 +74,11 @@ sub renewstatus {
if (my $data1 = $sth1->fetchrow_hashref) {
my $q2 = "select renewalsallowed from items,biblioitems,itemtypes
where (items.itemnumber = '$itemno')
and (items.biblioitemnuber = biblioitem.biblioitemnumber)
and (items.biblioitemnuber = biblioitems.biblioitemnumber)
and (biblioitems.itemtype = itemtype.itemtype)";
my $sth2 = $dbh->prepare($q2);
print $q2
print $q2;
$sth2->execute;
if (my $data2=$sth2->fetchrow_hashref) {
$renews = $data2->{'renewalsallowed'};

3
C4/Circulation/Returns.pm

@ -61,12 +61,15 @@ sub returnrecord {
my $amt_owing = calc_odues($env,$dbh,$bornum,$itemno);
my @datearr = localtime(time);
my $dateret = (1900+$datearr[5])."-".$datearr[4]."-".$datearr[3];
debug_msg($env,"before return");
my $query = "update issues
set returndate = '$dateret', branchcode = '$env->{'branchcode'}'
where (borrowernumber = '$bornum') and (itemnumber = '$itemno')
and (returndate is null)";
print $query;
my $sth = $dbh->prepare($query);
$sth->execute;
return($amt_owing);
}

Loading…
Cancel
Save