Browse Source

Menu changed

master
olwen 22 years ago
parent
commit
607d332681
  1. 2
      C4/Circulation.pm
  2. 12
      C4/Circulation/Issues.pm
  3. 1
      C4/Circulation/Renewals.pm
  4. 19
      C4/Circulation/Returns.pm
  5. 28
      C4/Interface.pm

2
C4/Circulation.pm

@ -132,7 +132,7 @@ sub previousissue {
my $text="Issued to $borrower->{'firstname'} $borrower->{'surname'} ($borrower->{'cardnumber'})";
my $resp = &msg_yn($text,"Mark as returned?");
if ($resp == "y") {
&returnrecord($env,$dbh,$bornum,$itemnum);
&returnrecord($env,$dbh,$borrower->{'borrowernumber'},$itemnum);
# can issue
} else {
# can't issue

12
C4/Circulation/Issues.pm

@ -121,7 +121,7 @@ sub issueitem{
my $canissue = 1;
## my ($itemnum,$reason)=&scanbook();
my $query="Select * from items,biblio where (barcode='$itemnum') and
(items.biblionumber=biblio.biblionumber)";
(items.biblionumber=biblio.biblionumber)";
my $item;
my $sth=$dbh->prepare($query);
$sth->execute;
@ -144,6 +144,9 @@ sub issueitem{
my $resbor = &checkreserve($env,$dbh,$item->{'itemnumber'});
#if charge deal with it
}
if ($canissue == 1) {
my $charge = calc_charges($env,$dbh,$itemnum,$bornum);
}
if ($canissue == 1) {
#now mark as issued
&updateissues($env,$item->{'itemnumber'},$item->{'biblioitemnumber'},$dbh,$bornum)
@ -179,4 +182,11 @@ sub updateissues{
$sth->finish;
}
sub calc_charges {
# calculate charges due
my ($env, $dbh, $itemno, $bornum)=@_;
my $charge;
return ($charge);
}
END { } # module clean-up code here (global destructor)

1
C4/Circulation/Renewals.pm

@ -62,6 +62,7 @@ sub Return {
sub renewstatus {
# check renewal status
my ($env,$dbh,$bornum,$itemno)=@_;
my $amt_owing = calc_odues($env,$dbh,$bornum,$itemno);
return();
}

19
C4/Circulation/Returns.pm

@ -18,7 +18,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&returnrecord);
@EXPORT = qw(&returnrecord &calc_odues);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
@ -54,24 +54,27 @@ my $priv_func = sub {
# make all your functions, whether exported or not;
sub Return {
}
sub returnrecord {
# mark items as returned
my ($env,$dbh,$bornum,$itemno)=@_;
my $amt_owing = calc_odues($env,$dbh,$bornum,$itemno);
my @datearr = localtime(time);
my $dateret = (1900+$datearr[5])."-".$datearr[4]."-".$datearr[3];
my $query = "update issues
set returndate = $dateret, branchcode = $env->{'branchcode'}
set returndate = '$dateret', branchcode = '$env->{'branchcode'}'
where (borrowernumber = '$bornum') and (itemnumber = '$itemno')
and (returndate is null)";
my $sth = $dbh->prepare($query);
$sth->execute;
return();
return($amt_owing);
}
sub calc_odues {
# calculate overdue fees
my ($env,$dbh,$bornum,$itemno)=@_;
my $amt_owing;
return($amt_owing);
}
END { } # module clean-up code here (global destructor)

28
C4/Interface.pm

@ -72,11 +72,32 @@ sub startint {
sub menu {
my ($type,$title,@items)=@_;
if ($type eq 'console'){
my ($reason,$data)=list($title,@items);
return($reason,$data);
# my ($reason,$data)=list($title,@items);
my ($reason,$data)=menu2($title,@items);
return($reason,$data);
}
}
sub menu2 {
my ($title,@items)=@_;
my $numitems=@items;
my $panel = Newt::Panel(1, 4, $title);
my $radio = Newt::VRadiogroup(@items);
my $okay = Newt::Button("Okay");
$panel->Add(0,0,$radio,NEWT_ANCHOR_LEFT);
$panel->Add(0,1,$okay);
$panel->AddHotKey(NEWT_KEY_F11);
my ($reason,$data)=$panel->Run();
$stuff = @items[$radio->Get()];
if ($reason eq NEWT_EXIT_HOTKEY) {
if ($data eq NEWT_KEY_F11) {
$stuff="Quit";
}
}
return($reason,$stuff);
}
sub clearscreen{
Newt::Cls();
}
@ -118,8 +139,7 @@ sub list {
# if ($reason eq NEWT_EXIT_HOTKEY) {
# if ($data eq NEWT_KEY_F11) {
# $reason="Quit";
# }
# }
# } my $numitems=@items;
my @stuff=$li->Get();
$data=$stuff[0];
return($reason,$data);

Loading…
Cancel
Save