[Koha-patches] [PATCH] adjust dropboxdate to allow for holidays calendar.
Ryan Higgins
rch at balrog.liblime.com
Mon May 12 12:29:33 CEST 2008
---
circ/returns.pl | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/circ/returns.pl b/circ/returns.pl
index fe1cfa5..9228674 100755
--- a/circ/returns.pl
+++ b/circ/returns.pl
@@ -33,6 +33,7 @@ use C4::Output;
use C4::Circulation;
use C4::Dates qw/format_date/;
use Date::Calc qw/Add_Delta_Days/;
+use C4::Calendar;
use C4::Print;
use C4::Reserves;
use C4::Biblio;
@@ -171,9 +172,9 @@ my $barcode = $query->param('barcode');
# $barcode =~ s/\s*//g; - use barcodedecode for this; whitespace is not invalid.
my $exemptfine = $query->param('exemptfine');
my $dropboxmode= $query->param('dropboxmode');
-my @datearr = localtime( time() );
-my @yesterdayarr = Add_Delta_Days( $datearr[5] + 1900 , $datearr[4] + 1, $datearr[3] , -1 );
-my $yesterday= C4::Dates->new( sprintf("%0.4d-%0.2d-%0.2d", at yesterdayarr),'iso');
+my $calendar = C4::Calendar->new( branchcode => C4::Context->userenv->{'branch'} );
+ #dropbox: get last open day (today - 1)
+my $dropboxdate = $calendar->addDate(C4::Dates->new(), -1 );
my $dotransfer = $query->param('dotransfer');
if ($dotransfer){
# An item has been returned to a branch other than the homebranch, and the librarian has choosen to initiate a transfer
@@ -530,7 +531,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) {
$ri{month} = $tempdate[1];
$ri{day} = $tempdate[2];
my $duedatenz = "$tempdate[2]/$tempdate[1]/$tempdate[0]";
- # my @datearr = localtime( time() );
+ my @datearr = localtime( time() );
my $todaysdate =
$datearr[5] . '-'
. sprintf( "%0.2d", ( $datearr[4] + 1 ) ) . '-'
@@ -576,7 +577,7 @@ $template->param(
errmsgloop => \@errmsgloop,
exemptfine => $exemptfine,
dropboxmode => $dropboxmode,
- yesterdaysdate => $yesterday->output(),
+ dropboxdate => $dropboxdate->output(),
overduecharges => $overduecharges,
);
--
1.5.4.2
More information about the Koha-patches
mailing list