Browse Source

lots of work cirv 1.3 done

master
chris 22 years ago
parent
commit
c4f7870310
  1. 4
      C4/Circulation/Returns.pm
  2. 2
      C4/Database.pm
  3. 15
      circ.pl
  4. 16
      doreturns.pl
  5. 2
      issuewrapper.pl
  6. 4
      returnswrapper.pl
  7. 25
      testissue.pl

4
C4/Circulation/Returns.pm

@ -165,7 +165,7 @@ sub checkissue {
my $resborrower = $btsh->fetchrow_hashref;
#printreserve($env,$resrec,$resborrower,$itemrec);
my $mess = "Reserved for collection at branch $resrec->{'branchcode'}";
error_msg($env,$mess);
C4::InterfaceCDK::error_msg($env,$mess);
$btsh->finish;
}
} else {
@ -238,7 +238,7 @@ sub returnrecord {
my $usth = $dbh->prepare($uquery);
$usth->execute();
$usth->finish;
my $nextaccntno = getnextacctno($env,$bornum,$dbh);
my $nextaccntno = C4::Accounts::getnextacctno($env,$bornum,$dbh);
$uquery = "insert into accountlines
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding)
values ($bornum,$nextaccntno,now(),0-$amount,'Book Returned',

2
C4/Database.pm

@ -53,7 +53,7 @@ my $priv_func = sub {
sub C4Connect {
my $dbname="c4";
# my $dbh = DBI->connect("dbi:Pg:dbname=$dbname", "chris", "");
my $database='koha2';
my $database='c4test';
my $hostname='localhost';
my $user='hdl';
my $pass='testing';

15
circ.pl

@ -0,0 +1,15 @@
#!/usr/bin/perl
#my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}");
$done = "Issues";
my $i=0;
while ($done eq "Issues") {
my @args=('./testissue.pl',@ARGV);
eval{system(@args)};
$exit_value = $? >> 8;
if ($exit_value){
$done=$exit_value;
}
}

16
doreturns.pl

@ -10,9 +10,17 @@ use C4::Scan;
use C4::Stats;
use C4::Search;
use C4::Print;
use C4::Circulation::Returns;
my %env = (
branchcode => $ARGV[0], usercode => $ARGV[1], proccode => "lgon", borrowernumber => "",
logintime => "", lasttime => "", tempuser => "", debug => "9",
telnet => $ARGV[2], queue => $ARGV[3], printtype => $ARGV[4], brdata => $ARGV[5]
);
my ($env)=%env;
my ($env)=@_;
my $dbh=&C4Connect;
my @items;
@items[0]=" "x50;
@ -27,12 +35,12 @@ my $amt_owing;
my $odues;
my $issues;
my $resp;
startint();
until ($reason ne "") {
($reason,$item) = returnwindow($env,"Enter Returns",$item,\@items,$borrower,$amt_owing,$odues,$dbh,$resp); #C4::Circulation
if ($reason eq "") {
$resp = "";
($resp,$bornum,$borrower,$itemno,$itemrec,$amt_owing) = checkissue($env,$dbh,$item);
($resp,$bornum,$borrower,$itemno,$itemrec,$amt_owing) = C4::Circulation::Returns::checkissue($env,$dbh,$item);
if ($bornum ne "") {
($issues,$odues,$amt_owing) = borrdata2($env,$bornum);
} else {
@ -52,7 +60,7 @@ until ($reason ne "") {
}
}
}
die;
$dbh->disconnect;

2
issuewrapper.pl

@ -5,7 +5,7 @@
$done = "Issues";
my $i=0;
while ($done eq "Issues") {
my @args=('borrwraper.pl',@ARGV);
my @args=('./borrwraper.pl',@ARGV);
eval{system(@args)};
$exit_value = $? >> 8;
if ($exit_value){

4
returnswrapper.pl

@ -1,11 +1,9 @@
#!/usr/bin/perl
#my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}");
$done = "returns";
my $i=0;
while ($done eq "returns") {
my @args=('doreturns.pl',@ARGV);
my @args=('./doreturns.pl',@ARGV);
eval{system(@args)};
$exit_value = $? >> 8;
if ($exit_value){

25
testissue.pl

@ -1,14 +1,14 @@
#!/usr/bin/perl
use strict;
use C4::Security;
use C4::Database;
#use C4::Security;
#use C4::Database;
use C4::Circulation::Main;
#use C4::Circulation::Issues;
#use C4::Circulation::Returns;
use C4::Circulation::Renewals;
#use C4::Circulation::Renewals;
#use C4::Circulation::Borrower;
use C4::Reserves;
#use C4::Reserves;
use C4::InterfaceCDK;
#use C4::Security;
@ -46,22 +46,25 @@ while ($donext ne 'Quit') {
$data = $donext;
}
if ($data eq 'Issues') {
my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}","$env{'brdata'}");
my @args=('./issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}","$env{'brdata'}");
system(@args);
} elsif ($data eq 'Returns') {
my @args=('returnswrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}","$env{'brdata'}");
my @args=('./returnswrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}","$env{'brdata'}");
system(@args);
# $donext=Returns(\%env); #C4::Circulation::Returns
} elsif ($data eq 'Select Branch') {
getbranch(\%env);
} elsif ($data eq 'Select Printer') {
getprinter(\%env);
} elsif ($data eq 'Borrower Enquiries') {
# } elsif ($data eq 'Borrower Enquiries') {
# $donext=Borenq($env); #C4::Circulation::Borrower - conversion
} elsif ($data eq 'Reserves'){
$donext=EnterReserves(\%env); #C4::Reserves
# } elsif ($data eq 'Reserves'){
# $donext=EnterReserves(\%env); #C4::Reserves
} elsif ($data eq 'Quit') {
$donext = $data;
&endint(\%env);
die;
}
}
&endint(\%env)
}
&endint(\%env);
die;
Loading…
Cancel
Save