koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Members.pm [rel_3_0]


From: Bruno Toumi
Subject: [Koha-cvs] koha/C4 Members.pm [rel_3_0]
Date: Fri, 20 Oct 2006 12:38:39 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Bruno Toumi <btoumi>    06/10/20 12:38:38

Modified files:
        C4             : Members.pm 

Log message:
        add sub for automatic calcul of date expiry

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Members.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.32.2.8&r2=1.32.2.9

Patches:
Index: Members.pm
===================================================================
RCS file: /sources/koha/koha/C4/Members.pm,v
retrieving revision 1.32.2.8
retrieving revision 1.32.2.9
diff -u -b -r1.32.2.8 -r1.32.2.9
--- Members.pm  13 Oct 2006 08:45:24 -0000      1.32.2.8
+++ Members.pm  20 Oct 2006 12:38:38 -0000      1.32.2.9
@@ -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.32.2.8 2006/10/13 08:45:24 btoumi Exp $
+# $Id: Members.pm,v 1.32.2.9 2006/10/20 12:38:38 btoumi Exp $
 
 use strict;
 require Exporter;
@@ -31,7 +31,7 @@
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
 
-$VERSION = do { my @v = '$Revision: 1.32.2.8 $' =~ /\d+/g; shift(@v) . "." . 
join( "_", map { sprintf "%03d", $_ } @v ); };
+$VERSION = do { my @v = '$Revision: 1.32.2.9 $' =~ /\d+/g; shift(@v) . "." . 
join( "_", map { sprintf "%03d", $_ } @v ); };
 
 =head1 NAME
 
@@ -66,6 +66,8 @@
   &get_age &GetBorrowersFromSurname &GetBranchCodeFromBorrowers
   &GetFlagsAndBranchFromBorrower
  &GetCities &GetRoadTypes &GetBorNotifyAcctRecord
+ &GetMembeReregistration
+               
 );
 
 
@@ -1473,6 +1475,37 @@
        }
 }
 
+=head2 member_reregistration (OUEST-PROVENCE)
+
+automatic reregistration in borrowers table 
+with dateexpiry .
+
+=cut
+
+sub GetMembeReregistration {
+       my ($categorycode,$borrowerid) = @_;
+       my $dbh = C4::Context->dbh;
+       my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) 
=localtime(time);
+       $mon++;
+       $year=$year+1900;
+       warn"year : = $year ";
+       if ($mon < '10'  ){
+       $mon="0".$mon;
+       }
+       if ($mday < '10'  ){
+       $mday="0".$mday;
+       }
+       my $today=format_date("$year-$mon-$mday");
+       $today=format_date_in_iso($today);
+       my $dateexpiry=calcexpirydate($categorycode,$today);
+       my $query=qq|   UPDATE borrowers 
+                       SET  dateexpiry='$dateexpiry' 
+                       WHERE borrowernumber='$borrowerid'|;
+       my $sth=$dbh->prepare($query);
+       $sth->execute;
+       $sth->finish;
+       return $dateexpiry;
+}
 
 =head2 roadtypecaracteristic (OUEST-PROVENCE)
 




reply via email to

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