koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/C4 Accounts2.pm,1.13,1.13.2.1


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/C4 Accounts2.pm,1.13,1.13.2.1
Date: Thu, 03 Oct 2002 19:22:14 -0700

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

Modified Files:
      Tag: arensb-context
        Accounts2.pm 
Log Message:
Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
C4Connect.


Index: Accounts2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Accounts2.pm,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -C2 -r1.13 -r1.13.2.1
*** Accounts2.pm        28 Sep 2002 04:56:26 -0000      1.13
--- Accounts2.pm        4 Oct 2002 02:22:12 -0000       1.13.2.1
***************
*** 22,26 ****
  require Exporter;
  use DBI;
! use C4::Database;
  use C4::Stats;
  use C4::Search;
--- 22,26 ----
  require Exporter;
  use DBI;
! use C4::Context;
  use C4::Stats;
  use C4::Search;
***************
*** 81,85 ****
    #here we update both the accountoffsets and the account lines
    my ($env,$bornumber,$data)address@hidden;
!   my $dbh=C4Connect;
    my $updquery = "";
    my $newamtos = 0;
--- 81,85 ----
    #here we update both the accountoffsets and the account lines
    my ($env,$bornumber,$data)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $updquery = "";
    my $newamtos = 0;
***************
*** 127,131 ****
    UpdateStats($env,$branch,'payment',$data,'','','',$bornumber);
    $sth->finish;
-   $dbh->disconnect;
  }
  
--- 127,130 ----
***************
*** 153,157 ****
    my ($bornumber,$accountno,$amount,$user)address@hidden;
    my $env;
!   my $dbh=C4Connect;
    # begin transaction
    my $nextaccntno = getnextacctno($env,$bornumber,$dbh);
--- 152,156 ----
    my ($bornumber,$accountno,$amount,$user)address@hidden;
    my $env;
!   my $dbh = C4::Context->dbh;
    # begin transaction
    my $nextaccntno = getnextacctno($env,$bornumber,$dbh);
***************
*** 189,193 ****
    UpdateStats($env,$user,'payment',$amount,'','','',$bornumber);
    $sth->finish;
-   $dbh->disconnect;
    #check to see what accounttype
    if ($data->{'accounttype'} eq 'Rep' || $data->{'accounttype'} eq 'L'){
--- 188,191 ----
***************
*** 234,238 ****
  sub fixaccounts {
    my ($borrowernumber,$accountno,$amount)address@hidden;
!   my $dbh=C4Connect;
    my $query="Select * from accountlines where borrowernumber=$borrowernumber
       and accountno=$accountno";
--- 232,236 ----
  sub fixaccounts {
    my ($borrowernumber,$accountno,$amount)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $query="Select * from accountlines where borrowernumber=$borrowernumber
       and accountno=$accountno";
***************
*** 244,247 ****
--- 242,246 ----
    my $outstanding=$data->{'amountoutstanding'}+$diff;
    $sth->finish;
+   # FIXME - Use $dbh->do();
    $query="Update accountlines set 
amount='$amount',amountoutstanding='$outstanding' where
            borrowernumber=$borrowernumber and accountno=$accountno";
***************
*** 250,254 ****
     $sth->execute;
     $sth->finish;
-    $dbh->disconnect;
   }
  
--- 249,252 ----
***************
*** 256,260 ****
  sub returnlost{
    my ($borrnum,$itemnum)address@hidden;
!   my $dbh=C4Connect;
    my $borrower=borrdata('',$borrnum); #from C4::Search;
    my $upiss="Update issues set returndate=now() where
--- 254,258 ----
  sub returnlost{
    my ($borrnum,$itemnum)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $borrower=borrdata('',$borrnum); #from C4::Search;
    my $upiss="Update issues set returndate=now() where
***************
*** 266,274 ****
    my $date = (1900+$datearr[5])."-".($datearr[4]+1)."-".$datearr[3];
    my $bor="$borrower->{'firstname'} $borrower->{'surname'} 
$borrower->{'cardnumber'}";
    my $upitem="Update items set paidfor='Paid for by $bor $date' where 
itemnumber='$itemnum'";
    $sth=$dbh->prepare($upitem);
    $sth->execute;
    $sth->finish;
-   $dbh->disconnect;
  }
  
--- 264,272 ----
    my $date = (1900+$datearr[5])."-".($datearr[4]+1)."-".$datearr[3];
    my $bor="$borrower->{'firstname'} $borrower->{'surname'} 
$borrower->{'cardnumber'}";
+   # FIXME - Use $dbh->do();
    my $upitem="Update items set paidfor='Paid for by $bor $date' where 
itemnumber='$itemnum'";
    $sth=$dbh->prepare($upitem);
    $sth->execute;
    $sth->finish;
  }
  
***************
*** 290,294 ****
  sub manualinvoice{
    my ($bornum,$itemnum,$desc,$type,$amount,$user)address@hidden;
!   my $dbh=C4Connect;
    my $insert;
    $itemnum=~ s/ //g;
--- 288,292 ----
  sub manualinvoice{
    my ($bornum,$itemnum,$desc,$type,$amount,$user)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $insert;
    $itemnum=~ s/ //g;
***************
*** 318,325 ****
--- 316,325 ----
      $desc.=" ".$itemnum;
      $desc=$dbh->quote($desc);
+     # FIXME - Use $dbh->do();
      $insert="insert into accountlines 
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding,itemnumber)
      values 
($bornum,$accountno,now(),'$amount',$desc,'$type','$amountleft','$data->{'itemnumber'}')";
    } else {
        $desc=$dbh->quote($desc);
+     # FIXME - Use $dbh->do();
      $insert="insert into accountlines 
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding)
      values ($bornum,$accountno,now(),'$amount',$desc,'$type','$amountleft')";
***************
*** 329,334 ****
    $sth->execute;
    $sth->finish;
- 
-   $dbh->disconnect;
  }
  
--- 329,332 ----
***************
*** 341,345 ****
    #here we update both the accountoffsets and the account lines
    my ($env,$bornumber,$data,$barcode,$type,$user)address@hidden;
!   my $dbh=C4Connect;
    my $updquery = "";
    my $newamtos = 0;
--- 339,343 ----
    #here we update both the accountoffsets and the account lines
    my ($env,$bornumber,$data,$barcode,$type,$user)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $updquery = "";
    my $newamtos = 0;
***************
*** 416,420 ****
    }
    $sth->finish;
-   $dbh->disconnect;
    $env->{'branch'}=$user;
    $type="Credit ".$type;
--- 414,417 ----
***************
*** 429,433 ****
    #here we update both the accountoffsets and the account lines
    my ($env,$bornumber,$data)address@hidden;
!   my $dbh=C4Connect;
    my $updquery = "";
    my $newamtos = 0;
--- 426,430 ----
    #here we update both the accountoffsets and the account lines
    my ($env,$bornumber,$data)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $updquery = "";
    my $newamtos = 0;
***************
*** 470,474 ****
    }
    $sth->finish;
-   $dbh->disconnect;
    return($amountleft);
  }
--- 467,470 ----




reply via email to

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