Browse Source

Fixes to returns

master
olwen 21 years ago
parent
commit
b9fec7ca1d
2 changed files with 25 additions and 12 deletions
  1. +16
    -10
      C4/Circulation/Returns.pm
  2. +9
    -2
      C4/InterfaceCDK.pm

+ 16
- 10
C4/Circulation/Returns.pm View File

@@ -73,15 +73,16 @@ sub Returns {
my $amt_owing;
my $odues;
my $issues;
my $resp;
# until (($reason eq "Circ") || ($reason eq "Quit")) {
until ($reason ne "") {
($reason,$item) =
returnwindow($env,"Enter Returns",
$item,\@items,$borrower,$amt_owing,$odues,$dbh); #C4::Circulation
$item,\@items,$borrower,$amt_owing,$odues,$dbh,$resp); #C4::Circulation
#debug_msg($env,"item = $item");
#if (($reason ne "Circ") && ($reason ne "Quit")) {
if ($reason eq "") {
my $resp;
$resp = "";
($resp,$bornum,$borrower,$itemno,$itemrec,$amt_owing) =
checkissue($env,$dbh,$item);
if ($bornum ne "") {
@@ -93,17 +94,21 @@ sub Returns {
}
if ($resp ne "") {
#if ($resp eq "Returned") {
my $item = itemnodata($env,$dbh,$itemno);
my $fmtitem = C4::Circulation::Issues::formatitem($env,$item,"",$amt_owing);
unshift @items,$fmtitem;
if ($itemno ne "" ) {
my $item = itemnodata($env,$dbh,$itemno);
my $fmtitem = C4::Circulation::Issues::formatitem($env,$item,"",$amt_owing);
unshift @items,$fmtitem;
if ($items[20] > "") {
pop @items;
}
}
#} elsif ($resp ne "") {
# error_msg($env,"$resp");
#}
if ($resp ne "Returned") {
error_msg($env,"$resp");
$bornum = "";
}
#if ($resp ne "Returned") {
# error_msg($env,"$resp");
# $bornum = "";
#}
}
}
}
@@ -128,6 +133,7 @@ sub checkissue {
$sth->execute;
if ($itemrec=$sth->fetchrow_hashref) {
$sth->finish;
$itemno = $itemrec->{'itemnumber'};
$query = "select * from issues
where (itemnumber='$itemrec->{'itemnumber'}')
and (returndate is null)";


+ 9
- 2
C4/InterfaceCDK.pm View File

@@ -466,7 +466,7 @@ sub borrowerbox {
}

sub returnwindow {
my ($env,$title,$item,$items,$borrower,$amountowing,$odues,$dbh)=@_;
my ($env,$title,$item,$items,$borrower,$amountowing,$odues,$dbh,$resp)=@_;
#debug_msg($env,$borrower);
my $titlepanel = titlepanel($env,"Returns","Scan Item");
my @functs=("Payments","Renewal");
@@ -480,7 +480,14 @@ sub returnwindow {
if ($borrower->{'cardnumber'} ne "") {
$borrbox = borrowerbox($env,$borrower,$amountowing);
$borrbox->draw();
}
} else {
if ($resp ne "") {
my @text;
@text[0] = $resp;
$borrbox = new Cdk::Label ('Message' =>\@text, 'Ypos'=>3, 'Xpos'=>"RIGHT");
$borrbox->draw();
}
}
my $bookentry = new Cdk::Entry('Label'=>" ",
'Max'=>"11",'Width'=>"11",
'Xpos'=>"2",'Ypos'=>"3",'Title'=>"Item Barcode",


Loading…
Cancel
Save