style sheet to hide styles from Netscape 4.7
[koha.git] / telnet / doreturns.pl
1 #!/usr/bin/perl
2
3
4 # Copyright 2000-2002 Katipo Communications
5 #
6 # This file is part of Koha.
7 #
8 # Koha is free software; you can redistribute it and/or modify it under the
9 # terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any later
11 # version.
12 #
13 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License along with
18 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
19 # Suite 330, Boston, MA  02111-1307 USA
20
21 use DBI;
22 use C4::Context;
23 use C4::Accounts;
24 use C4::InterfaceCDK;
25 use C4::Circulation::Main;
26 use C4::Format;
27 use C4::Scan;
28 use C4::Stats;
29 use C4::Search;
30 use C4::Print;
31 use C4::Circulation::Returns;
32
33
34 my %env = (
35 branchcode => $ARGV[0], usercode => $ARGV[1], proccode => "lgon", borrowernumber => "",
36 logintime  => "", lasttime => "", tempuser => "", debug => "9",
37 telnet => $ARGV[2], queue => $ARGV[3], printtype => $ARGV[4], brdata => $ARGV[5]
38 );
39 my $env=\%env;
40
41
42 my $dbh = C4::Context->dbh;
43 my @items;
44 @items[0]=" "x50;
45 my $reason;
46 my $item;
47 my $reason;
48 my $borrower;
49 my $itemno;
50 my $itemrec;
51 my $bornum;
52 my $amt_owing;
53 my $odues;
54 my $issues;
55 my $resp;
56 startint();
57 until ($reason ne "") {
58   ($reason,$item) = returnwindow($env,"Enter Returns",$item,\@items,$borrower,$amt_owing,$odues,$dbh,$resp); #C4::Circulation
59   if ($reason eq "")  {
60     $resp = "";
61     ($resp,$bornum,$borrower,$itemno,$itemrec,$amt_owing) = C4::Circulation::Returns::checkissue($env,$dbh,$item);
62     if ($bornum ne "") {
63       ($issues,$odues,$amt_owing) = borrdata2($env,$bornum);
64     } else {
65       $issues = "";
66       $odues = "";
67       $amt_owing = "";
68     }
69     if ($resp ne "") {
70       if ($itemno ne "" ) {
71         my $item = itemnodata($env,$dbh,$itemno);
72         my $fmtitem = C4::Circulation::Issues::formatitem($env,$item,"",$amt_owing);
73         unshift @items,$fmtitem;
74         if ($items[20] > "") {
75           pop @items;
76         }
77       }
78     }
79   }
80 }
81 die;
82
83