Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 52 lines (48 sloc) 3.088 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#!/usr/bin/perl

use DBI;
use C4::Database;
use C4::Circulation::Issues;
use C4::Circulation::Main;
use C4::InterfaceCDK;
use C4::Circulation::Borrower;

# my @args=('issuewrapper.pl',"$env{'branchcode'}","$env{'usercode'}","$env{'telnet'}","$env{'queue'}","$env{'printtype'}");
my %env = (
  branchcode => $ARGV[0], usercode => $ARGV[1], proccode => "lgon", borrowernumber => "",
  logintime => "", lasttime => $ARGV[6], tempuser => "", debug => "9",
  telnet => $ARGV[2], queue => $ARGV[3], printtype => $ARGV[4], brdata => $ARGV[5], bcard=>$ARGV[7]
      );
my ($env) = \%env;

startint();
  helptext('');
my $done;
my ($items,$items2,$amountdue);
my $itemsdet;
$env->{'sysarea'} = "Issues";
$done = "Issues";
my $i=0;
my $dbh=&C4Connect;
  my ($bornum,$issuesallowed,$borrower,$reason,$amountdue) = C4::Circulation::Borrower::findborrower($env,$dbh);
# my $time=localtime(time);
# open (FILE,">>/tmp/$<_$ARGV[6]");
# print FILE "borrower found $bornum";
# close FILE;
  $env->{'loanlength'}="";
  if ($reason ne "") {
    $done = $reason;
  } elsif ($env->{'IssuesAllowed'} eq '0') {
    error_msg($env,"No Issues Allowed =$env->{'IssuesAllowed'}");
  } else {
    $env->{'bornum'} = $bornum;
    $env->{'bcard'} = $borrower->{'cardnumber'};
    ($items,$items2)=C4::Circulation::Main::pastitems($env,$bornum,$dbh); #from Circulation.pm
    $done = "No";
    my $it2p=0;
    while ($done eq 'No'){
      ($done,$items2,$it2p,$amountdue,$itemsdet) = C4::Circulation::Issues::processitems($env,$bornum,$borrower,$items,$items2,$it2p,$amountdue,$itemsdet);
    }
    
  }
  if ($done ne 'Issues'){
      $dbh->disconnect;
      die "test";
  }
$dbh->disconnect;
Something went wrong with that request. Please try again.