From e6099545ccc7531aa14c2d02675d453333a92101 Mon Sep 17 00:00:00 2001 From: finlayt Date: Thu, 30 May 2002 01:32:29 +0000 Subject: [PATCH] Most everything is fixed now in returns, including the way it displays (a little). --- circ/returns.pl | 180 ++++++++++++++++++++++++++---------------------- 1 file changed, 96 insertions(+), 84 deletions(-) diff --git a/circ/returns.pl b/circ/returns.pl index 8aaa740e85..77d942fb03 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -96,7 +96,7 @@ my $borrower; my $returned = 0; my $messages; my $barcode = $query->param('barcode'); -# actually return book (SQL CALL) and prepare item table..... +# actually return book and prepare item table..... if ($barcode) { # decode cuecat $barcode = cuecatbarcodedecode($barcode); @@ -115,24 +115,25 @@ if ($barcode) { # HTML code.... # title.... my $title = <<"EOF"; -

- - -
Circulation: Returns
+Circulation: Returns
Branch: $branches->{$branch}->{'branchname'}   Printer: $printers->{$printer}->{'printername'}
Change Settings -
- -Next Borrower || -Returns || -Transfers

-

-

+

EOF +my $links = <<"EOF"; +
+ +Issues +Issues +
+EOF + + my $itemtable; if ($iteminformation) { $itemtable = <<"EOF"; @@ -149,21 +150,19 @@ Barcode: {'biblionumber'} Date Due: $iteminformation->{'date_due'}--> -

EOF } # Barcode entry box, with hidden inputs attached.... my $barcodeentrytext = << "EOF";

- +
Enter Book Barcode
Item Barcode:
$ritext - EOF @@ -179,7 +178,7 @@ if ($messages->{'ResFound'}) { $reservetext = <<"EOF"; Item marked Waiting:
Item is marked waiting at $branchname for $name ($number).
- +
Cancel reservation:
@@ -203,8 +202,8 @@ EOF } if ($res->{'ResFound'} eq "Reserved") { $reservetext = <<"EOF"; -Reserved: reserve found for $name ($number). - +Reserved found: for $name ($number). +
EOF my $flags = $borrower->{'flags'}; my $flaginfotext=''; - my $flag; my $color = ''; - foreach $flag (sort keys %$flags) { + foreach my $flag (sort keys %$flags) { + warn "$flag : $flags->{$flag} \n "; + ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); - $flags->{$flag}->{'message'}=~s/\n/
/g; if ($flags->{$flag}->{'noissues'}) { - if ($flag eq 'CHARGES') { - $flaginfotext.= <<"EOF"; - + $flag = "$flag"; + } + if ($flag eq 'CHARGES') { + $flaginfotext.= <<"EOF"; + -EOF - } else { - $flaginfotext.= <<"EOF"; - - -EOF - } - } else { - if ($flag eq 'CHARGES') { - $flaginfotext .= << "EOF"; - - +onClick="openWindow(this, 'Payment', 480,640)">Payment EOF - } elsif ($flag eq 'WAITING') { - my $itemswaiting=''; - my $items = $flags->{$flag}->{'itemlist'}; - foreach my $item (@$items) { - my ($iteminformation) = getiteminformation(\%env, $item->{'itemnumber'}, 0); - $itemswaiting .= <<"EOF"; + } elsif ($flag eq 'WAITING') { + my $itemswaiting=''; + my $items = $flags->{$flag}->{'itemlist'}; + foreach my $item (@$items) { + my ($iteminformation) = getiteminformation(\%env, $item->{'itemnumber'}, 0); + $itemswaiting .= <<"EOF"; {'biblionumber'}&type=intra -onClick=\"openWindow(this, 'Item', 480, 640)\">$iteminformation->{'barcode'} -$iteminformation->{'title'} ($branches->{$iteminformation->{'holdingbranch'}}->{'branchname'})
+onClick="openWindow(this, 'Item', 480, 640)">$iteminformation->{'barcode'} +$iteminformation->{'title'} +($branches->{$iteminformation->{'holdingbranch'}}->{'branchname'})
EOF - } - $flaginfotext.="\n"; - } elsif ($flag eq 'ODUES') { - my $items = $flags->{$flag}->{'itemlist'}; - $flaginfotext .= <<"EOF"; - - + } + $flaginfotext.="\n"; + } elsif ($flag eq 'ODUES') { + my $itemsoverdue = ''; + my $items = $flags->{$flag}->{'itemlist'}; + foreach my $item (sort {$a->{'date_due'} cmp $b->{'date_due'}} @$items) { + $itemsoverdue .= <<"EOF"; +$item->{'date_due'} +{'biblionumber'}&type=intra +onClick="openWindow(this, 'Item', 480, 640)">$iteminformation->{'barcode'} +$iteminformation->{'title'} +
EOF - } else { - $flaginfotext .= "\n"; } + $flaginfotext .= "\n"; + } else { + $flaginfotext.= <<"EOF"; + + +EOF } } if ($flaginfotext) { - $flaginfotext = << "EOF"; -
Set reserve to waiting and transfer book to $branchname : @@ -240,7 +239,6 @@ EOF
Reserve Found
$reservetext
- EOF } @@ -276,89 +274,81 @@ EOF # patrontable .... my $borrowertable; +my $flaginfotable; if ($borrower) { - my $patrontable = << "EOF"; - + $borrowertable = << "EOF"; +
+Borrower Information
-Patron Information
{'borrowernumber'} onClick="openWindow(this,'Member', 480, 640)">$borrower->{'cardnumber'} $borrower->{'surname'}, $borrower->{'title'} $borrower->{'firstname'}
-
+
$flag
$flag $flags->{$flag}->{'message'} {'borrowernumber'} -onClick=\"openWindow(this, 'Payment', 480,640)\">Payment
$flag$flags->{$flag}->{'message'}
$flag $flags->{$flag}->{'message'} {'borrowernumber'} -onClick=\"openWindow(this, 'Payment', 480,640)\">Payment
$flag$itemswaiting
$flagPatron has Overdue books
$flag$itemswaiting
$flag$flags->{$flag}->{'message'}
$flag$itemsoverdue
$flag$flags->{$flag}->{'message'}
+ $borrowertable .= << "EOF"; + $flaginfotext
Flags
+Flags
EOF } - $borrowertable = << "EOF"; - - - - - -
$patrontable$flaginfotext
-EOF } # the returned items..... my $returneditemstable = << "EOF"; -

- +
@@ -376,13 +366,13 @@ foreach (sort {$a <=> $b} keys %returneditems) { ### # convert to nz date format my @tempdate = split(/-/,$duedate); - $duedate = "$tempdate[2]/$tempdate[1]/$tempdate[0]"; + my $duedatenz = "$tempdate[2]/$tempdate[1]/$tempdate[0]"; #### my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); - my $overduetext = "$duedate"; + my $overduetext = "$duedatenz"; ($overduetext="$duedate") if ($duedate lt $todaysdate); - ($duedate) || ($overduetext = ""); + ($duedatenz) || ($overduetext = ""); my $borrowernumber = $riborrowernumber{$_}; my ($borrower) = getpatroninformation(\%env,$borrowernumber,0); my ($iteminformation) = getiteminformation(\%env, 0, $barcode);; @@ -409,21 +399,43 @@ print $query->header(); print startpage(); print startmenu('circulation'); -print $title; +print <<"EOF"; +$links +$title +
Returned Items
Due DateBar CodeTitleAuthorTypeBorrower
+EOF if ($reservefoundtext) { - print $reservefoundtext; + print <<"EOF"; + + + + + + + +EOF } else { - print $barcodeentrytext; + print <<"EOF"; + + + + +EOF } - -print $messagetable; - if ($returned) { - print $itemtable; - print $borrowertable; + print <<"EOF"; + + + + +EOF +} +if (%returneditems) { + print ""; } -(print $returneditemstable) if (%returneditems); + +print "
$reservefoundtext
$messagetable
$barcodeentrytext$messagetable
$itemtable$borrowertable
$returneditemstable
"; print endmenu('circulation'); print endpage(); -- 2.39.5