Acquisition.pm - BEGIN block VERSION and vars related to export.
[koha.git] / C4 / Accounts.pm
old mode 100755 (executable)
new mode 100644 (file)
index d47c438..a8db930
@@ -17,21 +17,26 @@ package C4::Accounts;
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id$
 
 use strict;
-require Exporter;
 use C4::Context;
 use C4::Stats;
 use C4::Members;
+use C4::Items;
 
 #use C4::Circulation;
 use vars qw($VERSION @ISA @EXPORT);
 
-# set the version for version checking
-$VERSION = do { my @v = '$Revision$' =~ /\d+/g;
-    shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
-};
+BEGIN {
+       # set the version for version checking
+       $VERSION = 3.01;
+       require Exporter;
+       @ISA    = qw(Exporter);
+       @EXPORT = qw(
+               &recordpayment &fixaccounts &makepayment &manualinvoice
+               &getnextacctno &reconcileaccount
+       );
+}
 
 =head1 NAME
 
@@ -49,12 +54,6 @@ patron.
 
 =head1 FUNCTIONS
 
-=cut
-
-@ISA    = qw(Exporter);
-@EXPORT = qw(&recordpayment &fixaccounts &makepayment &manualinvoice
-  &getnextacctno &reconcileaccount);
-
 =head2 recordpayment
 
   &recordpayment($borrowernumber, $payment);
@@ -270,7 +269,7 @@ EOT
 sub returnlost {
     my ( $borrowernumber, $itemnum ) = @_;
     my $dbh      = C4::Context->dbh;
-    my $borrower = GetMember( $borrowernumber, 'borrowernumber' );
+    my $borrower = C4::Members::GetMember( $borrowernumber, 'borrowernumber' );
     my $sth      = $dbh->prepare(
         "UPDATE issues SET returndate=now() WHERE
   borrowernumber=? AND itemnumber=? AND returndate IS NULL"
@@ -282,9 +281,7 @@ sub returnlost {
       ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3];
     my $bor =
 "$borrower->{'firstname'} $borrower->{'surname'} $borrower->{'cardnumber'}";
-    $sth = $dbh->prepare("UPDATE items SET paidfor=? WHERE itemnumber=?");
-    $sth->execute( "Paid for by $bor $date", $itemnum );
-    $sth->finish;
+    ModItem({ paidfor =>  "Paid for by $bor $date" }, undef, $itemnum);
 }
 
 =head2 manualinvoice
@@ -367,6 +364,7 @@ sub manualinvoice {
         $sth->execute( $borrowernumber, $accountno, $amount, $desc, $type,
             $amountleft, $notifyid );
     }
+    return 0;
 }
 
 =head2 fixcredit
@@ -542,7 +540,6 @@ END { }    # module clean-up code here (global destructor)
 1;
 __END__
 
-
 =head1 SEE ALSO
 
 DBI(3)