koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/C4/Circulation Borrower.pm,1.4,1.5


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/C4/Circulation Borrower.pm,1.4,1.5
Date: Sun, 13 Oct 2002 01:31:08 -0700

Update of /cvsroot/koha/koha/C4/Circulation
In directory usw-pr-cvs1:/tmp/cvs-serv15113

Modified Files:
        Borrower.pm 
Log Message:
Deleted unused variables.
Removed trailing whitespace.


Index: Borrower.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Borrower.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Borrower.pm 11 Oct 2002 12:37:58 -0000      1.4
--- Borrower.pm 13 Oct 2002 08:31:06 -0000      1.5
***************
*** 1,3 ****
! package C4::Circulation::Borrower; #assumes C4/Circulation/Borrower
  
  #package to deal with Issues
--- 1,5 ----
! package C4::Circulation::Borrower;
! 
! # $Id$
  
  #package to deal with Issues
***************
*** 42,88 ****
  use C4::Stats;
  use C4::Format;
! use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
!   
  # set the version for version checking
  $VERSION = 0.01;
!     
  @ISA = qw(Exporter);
  @EXPORT = qw(&findborrower &Borenq &findoneborrower &NewBorrowerNumber
  &findguarantees);
- %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
-                 
- # your exported package globals go here,
- # as well as any optionally exported functions
- 
- @EXPORT_OK   = qw($Var1 %Hashit);
- 
- 
- # non-exported package globals go here
- use vars qw(@more $stuff);
-       
- # initalize package globals, first exported ones
- 
- my $Var1   = '';
- my %Hashit = ();
-                   
- # then the others (which are still accessible as $Some::Module::stuff)
- my $stuff  = '';
- my @more   = ();
-       
- # all file-scoped lexicals must be created before
- # the functions below that use them.
-               
- # file-private lexicals go here
- my $priv_var    = '';
- my %secret_hash = ();
-                           
- # here's a file-private function as a closure,
- # callable as &$priv_func;  it cannot be prototyped.
- my $priv_func = sub {
-   # stuff goes here.
- };
-                                                   
- # make all your functions, whether exported or not;
- 
  
  sub findborrower  {
--- 44,55 ----
  use C4::Stats;
  use C4::Format;
! use vars qw($VERSION @ISA @EXPORT);
! 
  # set the version for version checking
  $VERSION = 0.01;
! 
  @ISA = qw(Exporter);
  @EXPORT = qw(&findborrower &Borenq &findoneborrower &NewBorrowerNumber
  &findguarantees);
  
  sub findborrower  {
***************
*** 100,110 ****
      my $title = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Borrower 
Entry");
      if ($env->{'newborrower'} eq "") {
!       ($borcode,$reason,$book)=&C4::Circulation::Main::scanborrower($env); 
!     } else { 
        $borcode = $env->{'newborrower'};
        $reason = "";
        $book = "";
        $env->{'newborrower'}= "";
!     }  
      #C4::Circulation::Main
      if ($reason eq "") {
--- 67,77 ----
      my $title = C4::InterfaceCDK::titlepanel($env,$env->{'sysarea'},"Borrower 
Entry");
      if ($env->{'newborrower'} eq "") {
!       ($borcode,$reason,$book)=&C4::Circulation::Main::scanborrower($env);
!     } else {
        $borcode = $env->{'newborrower'};
        $reason = "";
        $book = "";
        $env->{'newborrower'}= "";
!     }
      #C4::Circulation::Main
      if ($reason eq "") {
***************
*** 113,118 ****
          $env->{'IssuesAllowed'} = 1;
        } elsif ($book ne "") {
!         my $query = "select * from issues,items where (barcode = '$book') 
!           and (items.itemnumber = issues.itemnumber) 
            and (issues.returndate is null)";
          my $iss_sth=$dbh->prepare($query);
--- 80,85 ----
          $env->{'IssuesAllowed'} = 1;
        } elsif ($book ne "") {
!         my $query = "select * from issues,items where (barcode = '$book')
!           and (items.itemnumber = issues.itemnumber)
            and (issues.returndate is null)";
          my $iss_sth=$dbh->prepare($query);
***************
*** 120,135 ****
          if (my $issdata  = $iss_sth->fetchrow_hashref) {
             $bornum=$issdata->{'borrowernumber'};
!          $sth = $dbh->prepare("Select * from borrowers 
             where borrowernumber =  '$bornum'");
           $sth->execute;
           $borrower=$sth->fetchrow_hashref;
!          $sth->finish;  
           } else {
             error_msg($env,"Item $book not found");
!          } 
         $iss_sth->finish;
        }
!     } 
!   } 
    my ($issuesallowed,$owing);
    if ($reason eq "") {
--- 87,102 ----
          if (my $issdata  = $iss_sth->fetchrow_hashref) {
             $bornum=$issdata->{'borrowernumber'};
!          $sth = $dbh->prepare("Select * from borrowers
             where borrowernumber =  '$bornum'");
           $sth->execute;
           $borrower=$sth->fetchrow_hashref;
!          $sth->finish;
           } else {
             error_msg($env,"Item $book not found");
!          }
         $iss_sth->finish;
        }
!     }
!   }
    my ($issuesallowed,$owing);
    if ($reason eq "") {
***************
*** 162,167 ****
      # my $borquery = "Select * from borrowers
      # where surname ~* '$borcode' order by surname";
!             
!     my $borquery = "Select * from borrowers 
        where lower(surname) like \"$lcborcode%\" order by surname,firstname";
      my $sthb =$dbh->prepare($borquery);
--- 129,134 ----
      # my $borquery = "Select * from borrowers
      # where surname ~* '$borcode' order by surname";
! 
!     my $borquery = "Select * from borrowers
        where lower(surname) like \"$lcborcode%\" order by surname,firstname";
      my $sthb =$dbh->prepare($borquery);
***************
*** 178,192 ****
      }
      if ($cntbor == 1)  {
!       $bornum = $bornums[0];       
!       my $query = "select * from borrowers where borrowernumber = '$bornum'"; 
   
        $sth = $dbh->prepare($query);
        $sth->execute;
        $borrower =$sth->fetchrow_hashref;
!       $sth->finish;                                            
      } elsif ($cntbor > 0) {
        my ($cardnum) = 
C4::InterfaceCDK::selborrower($env,$dbh,address@hidden,address@hidden);
!       my $query = "select * from borrowers where cardnumber = '$cardnum'";   
!       $sth = $dbh->prepare($query);                          
!       $sth->execute;                          
        $borrower =$sth->fetchrow_hashref;
        $sth->finish;
--- 145,159 ----
      }
      if ($cntbor == 1)  {
!       $bornum = $bornums[0];
!       my $query = "select * from borrowers where borrowernumber = '$bornum'";
        $sth = $dbh->prepare($query);
        $sth->execute;
        $borrower =$sth->fetchrow_hashref;
!       $sth->finish;
      } elsif ($cntbor > 0) {
        my ($cardnum) = 
C4::InterfaceCDK::selborrower($env,$dbh,address@hidden,address@hidden);
!       my $query = "select * from borrowers where cardnumber = '$cardnum'";
!       $sth = $dbh->prepare($query);
!       $sth->execute;
        $borrower =$sth->fetchrow_hashref;
        $sth->finish;
***************
*** 196,202 ****
          error_msg($env,"Borrower not found");
        }
!     }  
    }
!   return ($bornum,$borrower); 
  }
  sub checktraps {
--- 163,169 ----
          error_msg($env,"Borrower not found");
        }
!     }
    }
!   return ($bornum,$borrower);
  }
  sub checktraps {
***************
*** 205,209 ****
    #my @traps_set;
    #check amountowing
!   my $traps_done; 
    my $odues;
    my $amount;
--- 172,176 ----
    #my @traps_set;
    #check amountowing
!   my $traps_done;
    my $odues;
    my $amount;
***************
*** 211,215 ****
      my @traps_set;
      $amount=C4::Accounts::checkaccount($env,$bornum,$dbh);    #from 
C4::Accounts
!     if ($amount > 0) { push (@traps_set,"CHARGES");}  
      if ($borrower->{'gonenoaddress'} == 1){ push (@traps_set,"GNA");}
      #check if member has a card reported as lost
--- 178,182 ----
      my @traps_set;
      $amount=C4::Accounts::checkaccount($env,$bornum,$dbh);    #from 
C4::Accounts
!     if ($amount > 0) { push (@traps_set,"CHARGES");}
      if ($borrower->{'gonenoaddress'} == 1){ push (@traps_set,"GNA");}
      #check if member has a card reported as lost
***************
*** 220,235 ****
      #call overdue checker
      my $odues = &C4::Circulation::Main::checkoverdues($env,$bornum,$dbh);
!     if ($odues > 0) {push (@traps_set,"ODUES");}  
      #check if borrower has any items waiting
      my ($nowaiting,$itemswaiting) = 
&C4::Circulation::Main::checkwaiting($env,$dbh,$bornum);
!     if ($nowaiting > 0) { push (@traps_set,"WAITING"); } 
      # FIXME - This should be $traps_set[0], right?
      if (@traps_set[0] ne "" ) {
!       ($issuesallowed,$traps_done,$amount,$odues) = 
           process_traps($env,$dbh,$bornum,$borrower,
         $amount,$odues,address@hidden,$itemswaiting);
      } else {
        $traps_done = "DONE";
!     }   
    }
    return ($issuesallowed, $odues,$amount);
--- 187,202 ----
      #call overdue checker
      my $odues = &C4::Circulation::Main::checkoverdues($env,$bornum,$dbh);
!     if ($odues > 0) {push (@traps_set,"ODUES");}
      #check if borrower has any items waiting
      my ($nowaiting,$itemswaiting) = 
&C4::Circulation::Main::checkwaiting($env,$dbh,$bornum);
!     if ($nowaiting > 0) { push (@traps_set,"WAITING"); }
      # FIXME - This should be $traps_set[0], right?
      if (@traps_set[0] ne "" ) {
!       ($issuesallowed,$traps_done,$amount,$odues) =
           process_traps($env,$dbh,$bornum,$borrower,
         $amount,$odues,address@hidden,$itemswaiting);
      } else {
        $traps_done = "DONE";
!     }
    }
    return ($issuesallowed, $odues,$amount);
***************
*** 242,246 ****
    my %traps;
    while (@$traps_set[$x] ne "") {
!     address@hidden = 1; 
      $x++;
    }
--- 209,213 ----
    my %traps;
    while (@$traps_set[$x] ne "") {
!     address@hidden = 1;
      $x++;
    }
***************
*** 252,256 ****
      if ($trapact eq "CHARGES") {
        
C4::Accounts::reconcileaccount($env,$dbh,$bornum,$amount,$borrower,$odues);
!       ($odues,$issues,$amount)=borrdata2($env,$bornum);          
        if ($amount <= 0) {
          $traps{'CHARGES'} = 0;
--- 219,223 ----
      if ($trapact eq "CHARGES") {
        
C4::Accounts::reconcileaccount($env,$dbh,$bornum,$amount,$borrower,$odues);
!       ($odues,$issues,$amount)=borrdata2($env,$bornum);
        if ($amount <= 0) {
          $traps{'CHARGES'} = 0;
***************
*** 284,289 ****
      } elsif  ($trapact eq "NOTES") {
        my $notes = trapsnotes($env,$bornum,$borrower,$amount);
!       if ($notes ne $borrower->{'borrowernotes'}) { 
!         my $query = "update borrowers set borrowernotes = '$notes' 
           where borrowernumber = $bornum";
          my $sth = $dbh->prepare($query);
--- 251,256 ----
      } elsif  ($trapact eq "NOTES") {
        my $notes = trapsnotes($env,$bornum,$borrower,$amount);
!       if ($notes ne $borrower->{'borrowernotes'}) {
!         my $query = "update borrowers set borrowernotes = '$notes'
           where borrowernumber = $bornum";
          my $sth = $dbh->prepare($query);
***************
*** 301,306 ****
          }
          $x++;
!         }                 
!         $traps_set = address@hidden;                                          
           
        }
      }
--- 268,273 ----
          }
          $x++;
!         }
!         $traps_set = address@hidden;
        }
      }
***************
*** 347,351 ****
    }
    return $reason;
! }  
  
  sub modifyuser {
--- 314,318 ----
    }
    return $reason;
! }
  
  sub modifyuser {
***************
*** 384,388 ****
  #'
  # FIXME - This is identical to C4::Search::NewBorrowerNumber.
! # Pick one (preferably this one) and stick with it.  
  
  # FIXME - Race condition: this function just says what the next unused
--- 351,355 ----
  #'
  # FIXME - This is identical to C4::Search::NewBorrowerNumber.
! # Pick one (preferably this one) and stick with it.
  
  # FIXME - Race condition: this function just says what the next unused
***************
*** 409,413 ****
    my ($bornum)address@hidden;
    my $dbh = C4::Context->dbh;
!   my $query="select cardnumber,borrowernumber from borrowers where 
    guarantor='$bornum'";
    my $sth=$dbh->prepare($query);
--- 376,380 ----
    my ($bornum)address@hidden;
    my $dbh = C4::Context->dbh;
!   my $query="select cardnumber,borrowernumber from borrowers where
    guarantor='$bornum'";
    my $sth=$dbh->prepare($query);
***************
*** 422,424 ****
    return($i,address@hidden);
  }
- END { }       # module clean-up code here (global destructor)
--- 389,390 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]