koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Auth.pm Biblio.pm BookShelves.pm Breedi...


From: Tumer Garip
Subject: [Koha-cvs] koha/C4 Auth.pm Biblio.pm BookShelves.pm Breedi...
Date: Mon, 06 Nov 2006 21:01:44 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     Tumer Garip <tgarip1957>        06/11/06 21:01:43

Modified files:
        C4             : Auth.pm Biblio.pm BookShelves.pm Breeding.pm 
                         Context.pm Koha.pm Members.pm Serials.pm 
        C4/Calendar    : Calendar.pm 
        C4/Circulation : Circ2.pm 

Log message:
        Bug fixing and complete removal of Date::Manip

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Auth.pm?cvsroot=koha&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&r1=1.185&r2=1.186
http://cvs.savannah.gnu.org/viewcvs/koha/C4/BookShelves.pm?cvsroot=koha&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Breeding.pm?cvsroot=koha&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Context.pm?cvsroot=koha&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Members.pm?cvsroot=koha&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Serials.pm?cvsroot=koha&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Calendar/Calendar.pm?cvsroot=koha&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Circ2.pm?cvsroot=koha&r1=1.121&r2=1.122

Patches:
Index: Auth.pm
===================================================================
RCS file: /sources/koha/koha/C4/Auth.pm,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- Auth.pm     20 Sep 2006 21:48:44 -0000      1.56
+++ Auth.pm     6 Nov 2006 21:01:43 -0000       1.57
@@ -36,7 +36,11 @@
 
 # set the version for version checking
 $VERSION = 0.01;
address@hidden = qw(Exporter);
 
address@hidden = qw(
+&checkpw
+);
 =head1 NAME
 
 C4::Auth - Authenticates Koha users

Index: Biblio.pm
===================================================================
RCS file: /sources/koha/koha/C4/Biblio.pm,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -b -r1.185 -r1.186
--- Biblio.pm   20 Oct 2006 01:20:56 -0000      1.185
+++ Biblio.pm   6 Nov 2006 21:01:43 -0000       1.186
@@ -21,7 +21,6 @@
 use C4::Context;
 use XML::Simple;
 use Encode;
-use utf8;
 
 use vars qw($VERSION @ISA @EXPORT);
 
@@ -1204,9 +1203,20 @@
 my ($dbh,$biblionumber,$op,$server)address@hidden;
 if (!$biblionumber){
 warn "Zebra received no biblionumber";
+}elsif (C4::Context->preference('onlineZEBRA')){
+my $marcxml;
+       if ($server eq "biblioserver"){
+       ($marcxml) =ZEBRA_readyXML($dbh,$biblionumber);
+       }elsif($server eq "authorityserver"){
+       $marcxml =C4::AuthoritiesMarc::XMLgetauthority($dbh,$biblionumber);
+       } 
+ZEBRAopserver($marcxml,$op,$server,$biblionumber);
+ZEBRAopcommit($server);
 }else{
 my $sth=$dbh->prepare("insert into zebraqueue  (biblio_auth_number 
,server,operation) values(?,?,?)");
 $sth->execute($biblionumber,$server,$op);
+$sth->finish;
+
 }
 }
 
@@ -1265,7 +1275,7 @@
 
 sub ZEBRAopcommit {
 my $server=shift;
-
+return unless C4::Context->config($server."shadow");
 my $Zconnbiblio=C4::Context->Zconnauth($server);
 
 my $Zpackage = $Zconnbiblio->package();

Index: BookShelves.pm
===================================================================
RCS file: /sources/koha/koha/C4/BookShelves.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- BookShelves.pm      6 Sep 2006 16:21:03 -0000       1.18
+++ BookShelves.pm      6 Nov 2006 21:01:43 -0000       1.19
@@ -3,7 +3,7 @@
 
 package C4::BookShelves;
 
-# $Id: BookShelves.pm,v 1.18 2006/09/06 16:21:03 tgarip1957 Exp $
+# $Id: BookShelves.pm,v 1.19 2006/11/06 21:01:43 tgarip1957 Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -465,9 +465,10 @@
        my $even = 0;
     while (my ($biblionumber) = $sth->fetchrow) {
        my $biblio=ZEBRA_readyXML_noheader($dbh,$biblionumber);
-       push @biblios,$biblio;
+       my  $xmlrecord=XML_xml2hash($biblio);
+       push @biblios,$xmlrecord;
      } 
-my (@results)=parsefields($dbh,"opac",@biblios);
+my ($facets,@results)=parsefields($dbh,"opac",@biblios);
     
     return (address@hidden);
 }
@@ -605,6 +606,9 @@
 
 #
 # $Log: BookShelves.pm,v $
+# Revision 1.19  2006/11/06 21:01:43  tgarip1957
+# Bug fixing and complete removal of Date::Manip
+#
 # Revision 1.18  2006/09/06 16:21:03  tgarip1957
 # Clean up before final commits
 #

Index: Breeding.pm
===================================================================
RCS file: /sources/koha/koha/C4/Breeding.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Breeding.pm 1 Oct 2006 21:48:54 -0000       1.12
+++ Breeding.pm 6 Nov 2006 21:01:43 -0000       1.13
@@ -67,8 +67,6 @@
 my @results;
 my $count;
        my $searchbreeding = $dbh->prepare("select id from marc_breeding where 
isbn=? and title=?");
-my $findbreedingid = $dbh->prepare("select max(id) from marc_breeding");
-
        my $insertsql = $dbh->prepare("insert into marc_breeding 
(file,isbn,title,author,marc,encoding,z3950random,classification,subclass) 
values(?,?,?,?,?,?,?,?,?)");
        my $replacesql = $dbh->prepare("update marc_breeding set 
file=?,isbn=?,title=?,author=?,marc=?,encoding=?,z3950random=?,classification=?,subclass=?
 where id=?");
        $encoding = C4::Context->preference("marcflavour") unless $encoding;
@@ -136,8 +134,8 @@
                                                $replacesql 
->execute($filename,substr($oldbiblio->{isbn}.$oldbiblio->{issn},0,10),$oldbiblio->{title},$oldbiblio->{author},$recoded->as_usmarc,$encoding,$z3950random,$oldbiblio->{classification},$oldbiblio->{subclass},$breedingid);
                                        } else {
                                                $insertsql 
->execute($filename,substr($oldbiblio->{isbn}.$oldbiblio->{issn},0,10),$oldbiblio->{title},$oldbiblio->{author},$recoded->as_usmarc,$encoding,$z3950random,$oldbiblio->{classification},$oldbiblio->{subclass});
-                                       $findbreedingid->execute;
-                                       $breedingid=$findbreedingid->fetchrow;
+                                       
+                                       $breedingid=$dbh->{'mysql_insertid'};
                                        }
                                        $imported++;
                                }

Index: Context.pm
===================================================================
RCS file: /sources/koha/koha/C4/Context.pm,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- Context.pm  20 Oct 2006 01:20:56 -0000      1.49
+++ Context.pm  6 Nov 2006 21:01:43 -0000       1.50
@@ -15,7 +15,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Context.pm,v 1.49 2006/10/20 01:20:56 tgarip1957 Exp $
+# $Id: Context.pm,v 1.50 2006/11/06 21:01:43 tgarip1957 Exp $
 package C4::Context;
 use strict;
 use DBI;
@@ -25,7 +25,7 @@
        qw($context),
        qw(@context_stack);
 
-$VERSION = do { my @v = '$Revision: 1.49 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.50 $' =~ /\d+/g;
                shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -487,9 +487,10 @@
        my $dbh= DBI->connect("DBI:$db_driver:$db_name:$db_host",
                            $db_user, $db_passwd);
        # Koha 3.0 is utf-8, so force utf8 communication between mySQL and 
koha, whatever the mysql default config.
-       # this is better than modifying my.cnf (and forcing all communications 
to be in utf8)
-       $dbh->do("set NAMES 'utf8'");
-       $dbh->{mysql_auto_reconnect} =  1 ;
+       ###DBD::Mysql 3.0.7 has an intermittent bug for dbh->do so change to 
dbh->prepare
+       my $sth=$dbh->prepare("set NAMES 'utf8'");
+       $sth->execute();
+       $sth->finish;
 
        return $dbh;
 }
@@ -834,6 +835,9 @@
 
 =cut
 # $Log: Context.pm,v $
+# Revision 1.50  2006/11/06 21:01:43  tgarip1957
+# Bug fixing and complete removal of Date::Manip
+#
 # Revision 1.49  2006/10/20 01:20:56  tgarip1957
 # A new Date.pm to use for all date calculations. Mysql date calculations 
removed from Circ2.pm, all modules free of DateManip, a new get_today function 
to call in allscripts, and some bug cleaning in authorities.pm
 #

Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- Koha.pm     2 Oct 2006 19:15:20 -0000       1.46
+++ Koha.pm     6 Nov 2006 21:01:43 -0000       1.47
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Koha.pm,v 1.46 2006/10/02 19:15:20 tgarip1957 Exp $
+# $Id: Koha.pm,v 1.47 2006/11/06 21:01:43 tgarip1957 Exp $
 
 use strict;
 require Exporter;
@@ -26,7 +26,7 @@
 use CGI;
 use vars qw($VERSION @ISA @EXPORT);
 
-$VERSION = do { my @v = '$Revision: 1.46 $' =~ /\d+/g; shift(@v) . "." . 
join("_", map {sprintf "%03d", $_ } @v); };
+$VERSION = do { my @v = '$Revision: 1.47 $' =~ /\d+/g; shift(@v) . "." . 
join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
 
@@ -942,6 +942,7 @@
 }
 
 
+
 1;
 __END__
 

Index: Members.pm
===================================================================
RCS file: /sources/koha/koha/C4/Members.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- Members.pm  20 Oct 2006 01:20:56 -0000      1.38
+++ Members.pm  6 Nov 2006 21:01:43 -0000       1.39
@@ -19,7 +19,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Members.pm,v 1.38 2006/10/20 01:20:56 tgarip1957 Exp $
+# $Id: Members.pm,v 1.39 2006/11/06 21:01:43 tgarip1957 Exp $
 
 use strict;
 require Exporter;
@@ -35,7 +35,7 @@
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
 
-$VERSION = do { my @v = '$Revision: 1.38 $' =~ /\d+/g; shift(@v) . "." . join( 
"_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.39 $' =~ /\d+/g; shift(@v) . "." . join( 
"_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -691,12 +691,7 @@
        $data{'expiry'}=format_date_in_iso($data{'expiry'});
        }else{
        
-               my $sth = $dbh->prepare("select enrolmentperiod from categories 
where categorycode=?");
-               $sth->execute($data{'categorycode'});
-               my ($enrolmentperiod) = $sth->fetchrow;
-               $enrolmentperiod = 1 unless ($enrolmentperiod);#enrolmentperiod 
in years
-               my $duration=get_duration($enrolmentperiod." years");
-               $data{'expiry'} = &DATE_Add_Duration($data{'joining'},$duration 
);
+               $data{'expiry'} = 
calcexpirydate($data{'categorycode'},$data{'joining'} );
                
        }
        
@@ -760,12 +755,8 @@
        if ($data{'expiry'}) {
        $data{'expiry'}=format_date_in_iso($data{'expiry'});
        }else{
-               my $sth = $dbh->prepare("select enrolmentperiod from categories 
where categorycode=?");
-               $sth->execute($data{'categorycode'});
-               my ($enrolmentperiod) = $sth->fetchrow;
-               $enrolmentperiod = 1 unless ($enrolmentperiod);#enrolmentperiod 
in years
-               my $duration=get_duration($enrolmentperiod." years");
-               $data{'expiry'} = 
&DATE_Add_Duration($data{'joining'},$duration);
+               
+               $data{'expiry'} = 
calcexpirydate($data{'categorycode'},$data{'joining'});
        }
        
        my $query= "INSERT INTO borrowers (
@@ -846,9 +837,10 @@
         "select enrolmentperiod from categories where categorycode=?");
     $sth->execute($categorycode);
     my ($enrolmentperiod) = $sth->fetchrow;
-    $enrolmentperiod = 12 unless ($enrolmentperiod);
-    return format_date_in_iso(
-        &DateCalc( $dateenrolled, "$enrolmentperiod months" ) );
+$enrolmentperiod = 1 unless ($enrolmentperiod);#enrolmentperiod in years
+               my $duration=get_duration($enrolmentperiod." years");
+       return  DATE_Add_Duration($dateenrolled,$duration);
+    
 }
 
 =head2 checkuserpassword (OUEST-PROVENCE)
@@ -991,7 +983,7 @@
     # Defaults to "0", which is interpreted as "no".
 my $dbh = C4::Context->dbh;
 my $sth;
-    if (! $cardnumber  && $autonumber_members && $categorycode) {
+    if (!$cardnumber  && $autonumber_members && $categorycode) {
        if ($categorycode eq "A" || $categorycode eq "W" ){
         $sth=$dbh->prepare("select max(borrowers.cardnumber) from borrowers 
where borrowers.cardnumber like '5%' ");
        }elsif ($categorycode eq "L"){  
@@ -1022,6 +1014,7 @@
         elsif ($categorycode eq "L"){   $cardnumber = 1000000;}
         elsif ($categorycode  eq "F"){   $cardnumber = 3000000;}
        elsif ($categorycode  eq "C"){   $cardnumber = 8000000;}
+       elsif ($categorycode  eq "N"){   $cardnumber = 4000000;}
        else{$cardnumber = 6000000;}    
        # start at 1000000 or 3000000 or 5000000
        } else {
@@ -1224,6 +1217,9 @@
                $sth->execute($uid, $digest, $member);
                return 1;
        }
+
+}
+
 =head2 checkuniquemember (OUEST-PROVENCE)
 
   $result = 
&checkuniquemember($collectivity,$surname,$categorycode,$firstname,$dateofbirth);
@@ -1238,7 +1234,6 @@
 C<&dateofbirth> is the date of birth (only if collectivity=0)
 
 =cut
-
 sub checkuniquemember {
     my ( $collectivity, $surname, $firstname, $dateofbirth ) = @_;
     my $dbh = C4::Context->dbh;
@@ -1345,7 +1340,7 @@
     my ( $category_type, $description ) = $sth->fetchrow;
     return $category_type, $description;
 }
-}
+
 
 
 

Index: Serials.pm
===================================================================
RCS file: /sources/koha/koha/C4/Serials.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- Serials.pm  20 Oct 2006 01:20:56 -0000      1.9
+++ Serials.pm  6 Nov 2006 21:01:43 -0000       1.10
@@ -17,11 +17,10 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Serials.pm,v 1.9 2006/10/20 01:20:56 tgarip1957 Exp $
+# $Id: Serials.pm,v 1.10 2006/11/06 21:01:43 tgarip1957 Exp $
 
 use strict;
 use C4::Date;
-use C4::Date;
 use C4::Suggestions;
 use C4::Biblio;
 use C4::Search;
@@ -31,7 +30,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.9 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.10 $' =~ /\d+/g;
         shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 

Index: Calendar/Calendar.pm
===================================================================
RCS file: /sources/koha/koha/C4/Calendar/Calendar.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- Calendar/Calendar.pm        20 Oct 2006 01:20:57 -0000      1.3
+++ Calendar/Calendar.pm        6 Nov 2006 21:01:43 -0000       1.4
@@ -548,14 +548,14 @@
 
 sub Date_DayOfWeek{
 my ($month, $day, $year)address@hidden;
-my $date=Date_obj($year."-".$month."-".$day);
+my $date=DATE_obj($year."-".$month."-".$day);
 
 return $date->day_of_week;
 }
 
 sub Add_Delta_Days{
 my ($year, $month, $day, $offset)address@hidden;
-my $date=Date_obj($year."-".$month."-".$day);
+my $date=DATE_obj($year."-".$month."-".$day);
 my $duration=get_duration($offset." days");
 
  $date->add_duration($duration);

Index: Circulation/Circ2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -b -r1.121 -r1.122
--- Circulation/Circ2.pm        20 Oct 2006 01:20:57 -0000      1.121
+++ Circulation/Circ2.pm        6 Nov 2006 21:01:43 -0000       1.122
@@ -3,7 +3,7 @@
 
 package C4::Circulation::Circ2;
 
-# $Id: Circ2.pm,v 1.121 2006/10/20 01:20:57 tgarip1957 Exp $
+# $Id: Circ2.pm,v 1.122 2006/11/06 21:01:43 tgarip1957 Exp $
 
 #package to deal with circulation
 #written 3/11/99 by address@hidden
@@ -1145,17 +1145,19 @@
        die '$branch not defined' unless defined $branch; # just in case (bug 
170)
        # get information on item
        my $itemrecord=XMLgetitemhash($dbh,"",$barcode);
-       my $iteminformation=XMLmarc2koha_onerecord($dbh,$itemrecord,"holdings");
-              
$iteminformation->{'itemtype'}=MARCfind_itemtype($dbh,$iteminformation->{biblionumber});
-       if (not $iteminformation) {
+       if (not $itemrecord) {
                $messages->{'BadBarcode'} = $barcode;
                $doreturn = 0;
+       return ($doreturn, $messages, "", "");
        }
+       my $iteminformation=XMLmarc2koha_onerecord($dbh,$itemrecord,"holdings");
+              
$iteminformation->{'itemtype'}=MARCfind_itemtype($dbh,$iteminformation->{biblionumber});
+       
        # find the borrower
        my ($currentborrower) = 
currentborrower($iteminformation->{'itemnumber'});
        if ((not $currentborrower) && $doreturn) {
                $messages->{'NotIssued'} = $barcode;
-       #       $doreturn = 0;
+               $doreturn = 0;
        }
        # check if the book is in a permanent collection....
        my $hbr = $iteminformation->{'homebranch'};
@@ -1166,7 +1168,7 @@
        # check that the book has been cancelled
        if ($iteminformation->{'wthdrawn'}) {
                $messages->{'wthdrawn'} = 1;
-       #       $doreturn = 0;
+               $doreturn = 0;
        }
        # update issues, thereby returning book (should push this out into 
another subroutine
        my ($borrower) = getpatroninformation(\%env, $currentborrower, 0);
@@ -1717,13 +1719,7 @@
        # Look in the issues table for this item, lent to this borrower,
        # and not yet returned.
 my $borrower=C4::Members::getpatroninformation($dbh,$bornum,undef);
-       if (C4::Context->preference("LibraryName") eq "NEU Grand Library"){
-               ## faculty members and privileged get renewal whatever the case 
may be
-               if ($borrower->{'categorycode'} eq 'F' 
||$borrower->{'categorycode'} eq 'P'){
-               $renewokay = 1;
-               return $renewokay;
-               }
-       }
+       
        # FIXME - I think this function could be redone to use only one SQL 
call.
        my $sth1 = $dbh->prepare("select * from issues,items,biblio
                                                                where 
(borrowernumber = ?)
@@ -1734,7 +1730,13 @@
        $sth1->execute($bornum,$itemnumber);
        if (my $data1 = $sth1->fetchrow_hashref) {
                # Found a matching item
-       
+       if (C4::Context->preference("LibraryName") eq "NEU Grand Library"){
+               ##privileged get renewal whatever the case may be
+               if ($borrower->{'categorycode'} eq 'P'){
+               $renewokay = 1;
+               return $renewokay;
+               }
+       }
                # See if this item may be renewed. 
                my $sth2 = $dbh->prepare("select renewalsallowed from itemtypes 
where itemtypes.itemtype=?");
                $sth2->execute($data1->{itemtype});
@@ -1820,33 +1822,15 @@
 
        my $loanlength;
 my $dbh=C4::Context->dbh;
+my $sth;
 my  $iteminformation = getiteminformation($env, $itemnumber,0);
-       my $sth=$dbh->prepare("select date_due  from issues where itemnumber=? 
and returndate is null ");
-       $sth->execute($itemnumber);
-       my $issuedata=$sth->fetchrow;
-       $sth->finish;
                
 
-## We find a new datedue either from today or from the due_date of the book- 
if "strictrenewals" is in effect
 
 if ($datedue eq "" ) {
 
-               my  $borrower = getpatroninformation($env,$bornum,0);
+               my  $borrower = 
C4::Members::getpatroninformation($env,$bornum,0);
                 $loanlength = 
getLoanLength($borrower->{'categorycode'},$iteminformation->{'itemtype'},$borrower->{'branchcode'});
-       if (C4::Context->preference("strictrenewals")){
-       my @nowarr = localtime(time);
-       my $now = (1900+$nowarr[5])."-".($nowarr[4]+1)."-".$nowarr[3]; 
-               if ($issuedata<=$now){
-       
-               $datedue=$issuedata;
-               my $calendar = C4::Calendar::Calendar->new(branchcode => 
$borrower->{'branchcode'});
-               my ($yeardue, $monthdue, $daydue) = split /-/, $datedue;
-               ($daydue, $monthdue, $yeardue) = $calendar->addDate($daydue, 
$monthdue, $yeardue, $loanlength);
-               $datedue = "$yeardue-".sprintf ("%0.2d", $monthdue)."-". 
sprintf("%0.2d",$daydue);
-               }
-       }## stricrenewals       
-               
-       if ($datedue eq "" ){## incase $datedue chnaged above
                
                my $datedue=get_today();
                my $calendar = C4::Calendar::Calendar->new(branchcode => 
$borrower->{'branchcode'});
@@ -1854,11 +1838,6 @@
                ($daydue, $monthdue, $yeardue) = $calendar->addDate($daydue, 
$monthdue, $yeardue, $loanlength);
                $datedue = "$yeardue-".sprintf ("%0.2d", $monthdue)."-". 
sprintf("%0.2d",$daydue);
                
-       }
-
-
-
-
        # Update the issues record to have the new due date, and a new count
        # of how many times it has been renewed.
        
@@ -1868,7 +1847,6 @@
        $sth->finish;
 
        ## Update items and marc record with new date -T.G
-       my $iteminformation = getiteminformation($env, $itemnumber,0);
        
&XMLmoditemonefield($dbh,$iteminformation->{'biblionumber'},$iteminformation->{'itemnumber'},'date_due',$datedue);
                
        # Log the renewal
@@ -1885,7 +1863,7 @@
        #     print $account;
        }# end of rental charge
        
-
+       return format_date($datedue);
        }
 
  




reply via email to

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