Browse Source

Changes to issues

master
olwen 22 years ago
parent
commit
b93a15c4b7
  1. 32
      C4/Circulation/Borrower.pm
  2. 7
      C4/Circulation/Main.pm
  3. 2
      C4/Search.pm

32
C4/Circulation/Borrower.pm

@ -182,17 +182,49 @@ sub checktraps {
#check if borrower has overdue items
#call overdue checker
my $odues = &C4::Circulation::Main::checkoverdues($env,$bornum,$dbh);
if ($odues > 0) {
push (@traps_set,"ODUES");
}
#check amountowing
my $amount=checkaccount($env,$bornum,$dbh); #from C4::Accounts
if ($amount > 0) {
push (@traps_set,"FINES");
}
#check if borrower has any items waiting
my $itemswaiting = &C4::Circulation::Main::checkwaiting($env,$dbh,$bornum);
if (@traps_set[0] ne "" ) {
$issuesallowed =
process_traps($env,$dbh,$bornum,$borrower,$amount,$odues,\@traps_set);
}
#deal with any money still owing
if ($amount > 0){
&reconcileaccount($env,$dbh,$bornum,$amount,$borrower,$odues);
}
return ($issuesallowed, $odues);
}
sub process_traps {
my ($env,$dbh,$bornum,$borrower,$amount,$odues,$traps_set) = @_;
my $issuesallowed = 0;
my $x = 0;
my %traps;
debug_msg($env,"In traps");
while (@$traps_set[$x] ne "") {
$traps{'@$traps_set[$x]'} = 1;
}
my $trapact;
while ($trapact ne "NONE") {
$trapact = &trapscreen($env,$bornum,$borrower,$amount,$traps_set);
if ($trapact eq "FINES") {
&reconcileaccount($env,$dbh,$bornum,$amount,$borrower,$odues);
}
}
return ($issuesallowed);
}
sub Borenq {
my ($env)=@_;
my $dbh=C4Connect;

7
C4/Circulation/Main.pm

@ -11,6 +11,7 @@ use C4::Circulation::Returns;
use C4::Circulation::Renewals;
use C4::Circulation::Borrower;
use C4::Reserves;
use C4::Search;
use C4::InterfaceCDK;
use C4::Security;
use C4::Format;
@ -61,8 +62,8 @@ my $priv_func = sub {
sub pastitems{
#Get list of all items borrower has currently on issue
my ($env,$bornum,$dbh)=@_;
my $query1 = "select * from issues where (borrowernumber=$bornum
and returndate is null) order by date_due";
my $query1 = "select * from issues where (borrowernumber=$bornum)
and (returndate is null) order by date_due";
my $sth=$dbh->prepare($query1);
$sth->execute;
#my $sth=$dbh->prepare("Select * from issues,items,biblio,biblioitems
@ -81,7 +82,7 @@ sub pastitems{
$items[0]=" "x72;
$items2[0]=" "x72;
while (my $data1=$sth->fetchrow_hashref) {
my $data = itemnodata($env,$dbh,$data1->{'itemnumber'});
my $data = itemnodata($env,$dbh,$data1->{'itemnumber'}); #C4::Search
my $line = C4::Circulation::Issues::formatitem($env,$data,$data1->{'date_due'},"");
$items[$i]=$line;
$i++;

2
C4/Search.pm

@ -315,7 +315,7 @@ sub itemnodata {
my $query="Select * from biblio,items,biblioitems
where itemnumber = '$itemnumber'
and biblio.biblionumber = items.itemnumber
and biblioitems.biblio = items.biblionumber";
and biblioitems.biblionumber = items.biblionumber";
my $sth=$dbh->prepare($query);
$sth->execute;
my $data=$sth->fetchrow_hashref;

Loading…
Cancel
Save