diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 6ceccba..2733a60 100755 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -6,6 +6,7 @@ use strict; require Exporter; use DBI; use C4::Database; +use C4::Accounts; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -56,13 +57,39 @@ sub Issue { $sth->execute; my @borrower=$sth->fetchrow_array; $sth->finish; - $sth=$bh->prepare("Select * from items where itemnumber = $itemnum); + #process borrower traps (could be function) + #check first GNA trap (no address this is the 22nd item in the table) + if ($borrower[21] == 1){ + #got to membership update and update member info + print "Whoop whoop no address\n"; + } + #check if member has a card reported as lost + if ($borrower[22] ==1){ + #updae member info + print "Whoop whoop lost card\n"; + } + #check the notes field if notes exist display them + if ($borrower[26] ne ''){ + #display notes + #deal with notes as issue_process.doc + print "$borrower[26]\n"; + } + #check if borrower has overdue items + #call overdue checker + &checkoverdues($borrnum); + #check amountowing + &checkaccount($borrnum) + $sth=$dbh->prepare("Select * from items where itemnumber = $itemnum"); + $sth->execute; my @item=$sth->fetchrow_array; $sth->finish; $dbh->disconnect; - return (@data); + return (@borrower); } +sub checkoverdues{ + #pop up list of overdue books if some are overdue +} END { } # module clean-up code here (global destructor)