[Koha-cvs] koha/circ circulation.pl [dev_week]

Kyle Hall kyle.m.hall at gmail.com
Fri Jan 5 16:47:24 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Kyle Hall <kylemhall>	07/01/05 15:47:24

Modified files:
	circ           : circulation.pl 

Log message:
	

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/circ/circulation.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.81.2.14.2.11&r2=1.81.2.14.2.12

Patches:
Index: circulation.pl
===================================================================
RCS file: /sources/koha/koha/circ/circulation.pl,v
retrieving revision 1.81.2.14.2.11
retrieving revision 1.81.2.14.2.12
diff -u -b -r1.81.2.14.2.11 -r1.81.2.14.2.12
--- circulation.pl	14 Oct 2006 00:43:49 -0000	1.81.2.14.2.11
+++ circulation.pl	5 Jan 2007 15:47:24 -0000	1.81.2.14.2.12
@@ -24,6 +24,7 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use warnings; no warnings 'uninitialized';
 use CGI;
 use C4::Circulation::Circ2;
 use C4::Search;
@@ -189,6 +190,25 @@
 # reload the borrower info for the sake of reseting the flags.....
 if ($borrowernumber) {
 	$borrower = getpatroninformation(\%env,$borrowernumber,0);
+	my ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber);
+	# Warningdate is the date that the warning starts appearing
+	my ($today_year,$today_month,$today_day) = Today();
+	my ($warning_year,$warning_month,$warning_day) = split /-/, $borrower->{'expiry'};
+
+	# Renew day is calculated by adding the enrolment period to today
+	my ($renew_year,$renew_month,$renew_day) = Add_Delta_YM($today_year,$today_month,$today_day, $borrower->{'enrolmentperiod'},0); 
+	
+	# if the expiry date is before today
+	if (Date_to_Days($today_year,$today_month,$today_day) > Date_to_Days($warning_year,$warning_month,$warning_day)) {
+
+		#borrowercard expired or nearly expired, warn the librarian
+		$template->param(	flagged=>"1",
+							warndeparture=>"1",
+							renewaldate=>"$renew_year-$renew_month-$renew_day");
+	}
+	$template->param(		overduecount => $od,
+							issuecount => $issue,
+							finetotal => $fines);
 }
 
 
@@ -213,10 +233,16 @@
 # get each issue of the borrower & separate them in todayissues & previous issues
 	my @todaysissues;
 	my @previousissues;
+	#warn "before getissues";
+	#warn Dumper($borrower);
 	my $issueslist = getissues($borrower);
+	use Data::Dumper;
+	warn "ISSUESLIST";
+	warn Dumper($issueslist);
 	# split in 2 arrays for today & previous
 	foreach my $it (keys %$issueslist) {
 		my $issuedate = $issueslist->{$it}->{'timestamp'};
+		warn "ISSUEDATE".$issuedate;
 		$issuedate =~ s/-//g;
 		$issuedate = substr($issuedate, 0, 8);
 		# to let perl sort this correctly





More information about the Koha-cvs mailing list