[Koha-cvs] koha/C4/Circulation Circ2.pm [rel_2_2]

Mason James szrj1m at yahoo.com
Tue Jan 16 02:52:01 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	Mason James <sushi>	07/01/16 01:52:01

Modified files:
	C4/Circulation : Circ2.pm 

Log message:
	issuebook() now calling addDate() from Calendar.pm (Tumer's holiday module).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Circulation/Circ2.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.87.2.16&r2=1.87.2.17

Patches:
Index: Circ2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.87.2.16
retrieving revision 1.87.2.17
diff -u -b -r1.87.2.16 -r1.87.2.17
--- Circ2.pm	14 Sep 2006 14:31:33 -0000	1.87.2.16
+++ Circ2.pm	16 Jan 2007 01:52:01 -0000	1.87.2.17
@@ -3,7 +3,7 @@
 
 package C4::Circulation::Circ2;
 
-# $Id: Circ2.pm,v 1.87.2.16 2006/09/14 14:31:33 oleonard Exp $
+# $Id: Circ2.pm,v 1.87.2.17 2007/01/16 01:52:01 sushi Exp $
 
 #package to deal with Returns
 #written 3/11/99 by olwen at katipo.co.nz
@@ -36,6 +36,7 @@
 use C4::Koha;
 use C4::Biblio;
 use C4::Accounts;
+use C4::Calendar::Calendar;
 use Date::Manip;
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
@@ -899,9 +900,17 @@
 		my $datedue=time+($loanlength)*86400;
 		my @datearr = localtime($datedue);
 		my $dateduef = (1900+$datearr[5])."-".($datearr[4]+1)."-".$datearr[3];
+
+		# now calling addDate() from Calendar.pm (Tumer's holiday module).
+        my $calendar = C4::Calendar::Calendar->new(branchcode => $borrower->{'branchcode'});
+        my ($yeardue, $monthdue, $daydue) = split /-/, $dateduef;
+        ($daydue, $monthdue, $yeardue) = $calendar->addDate($daydue, $monthdue, $yeardue, $loanlength);
+        $dateduef = "$yeardue-".sprintf ("%0.2d", $monthdue)."-". sprintf("%0.2d",$daydue);
+
 		if ($date) {
 			$dateduef=$date;
 		}
+		
 		# if ReturnBeforeExpiry ON the datedue can't be after borrower expirydate
 		if (C4::Context->preference('ReturnBeforeExpiry') && $dateduef gt $borrower->{expiry}) {
 			$dateduef=$borrower->{expiry};





More information about the Koha-cvs mailing list