# 2006 SAN-OP
# 2007-2010 BibLibre, Paul POULAIN
# 2010 Catalyst IT
+# 2011 PTFS-Europe Ltd.
#
# This file is part of Koha.
#
=cut
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
use CGI;
+use DateTime;
use C4::Context;
use C4::Auth qw/:DEFAULT get_session/;
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;
use C4::Branch; # GetBranches GetBranchName
use C4::Koha; # FIXME : is it still useful ?
use C4::RotatingCollections;
+use Koha::DateUtils;
+use Koha::Calendar;
my $query = new CGI;
my $calendar = Koha::Calendar->new( branchcode => $userenv_branch );
#dropbox: get last open day (today - 1)
my $today = DateTime->now( time_zone => C4::Context->tz());
-#my $today_iso = $today->output('iso');
my $dropboxdate = $calendar->addDate($today, -1);
if ($dotransfer){
# An item has been returned to a branch other than the homebranch, and the librarian has chosen to initiate a transfer
}
}
- if ( C4::Context->preference("ReturnToShelvingCart") ) {
- my $item = GetItem( $itemnumber );
- $item->{'location'} = 'CART';
- ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
- }
-
#
# save the return
#
( $returned, $messages, $issueinformation, $borrower ) =
AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode); # do the return
- my $homeorholdingbranchreturn = C4::Context->preference('HomeOrHoldingBranchReturn') or 'homebranch';
+ my $homeorholdingbranchreturn = C4::Context->preference('HomeOrHoldingBranchReturn');
+ $homeorholdingbranchreturn ||= 'homebranch';
# get biblio description
my $biblio = GetBiblioFromItemNumber($itemnumber);
);
if ($returned) {
- my $time_now = DateTime->now( time_zone => C4::Context->tz )->truncate( to => 'minutes');
+ my $time_now = DateTime->now( time_zone => C4::Context->tz )->truncate( to => 'minute');
my $duedate = $issueinformation->{date_due}->strftime('%Y-%m-%d %H:%M');
$returneditems{0} = $barcode;
$riborrowernumber{0} = $borrower->{'borrowernumber'};
# case of wrong transfert, if the document wasn't transfered to the right library (according to branchtransfer (tobranch) BDD)
if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
- $messages->{'WrongTransfer'} = GetBranchName( $messages->{'WrongTransfer'} );
$template->param(
WrongTransfer => 1,
TransferWaitingAt => $messages->{'WrongTransfer'},
elsif ( $code eq 'Wrongbranch' ) {
}
elsif ( $code eq 'Debarred' ) {
- $err{debarred} = format_date( $messages->{'Debarred'} );
+ $err{debarred} = $messages->{'Debarred'};
$err{debarcardnumber} = $borrower->{cardnumber};
$err{debarborrowernumber} = $borrower->{borrowernumber};
$err{debarname} = "$borrower->{firstname} $borrower->{surname}";
{
my $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'});
push @itemloop, {
- duedate => output_pref($item->{'date_due'}),
+ duedate => format_sqldatetime($item->{date_due}),
biblionum => $biblio->{'biblionumber'},
barcode => $biblio->{'barcode'},
title => $biblio->{'title'},
riborfirstname => $borrower->{'firstname'}
);
}
-
#set up so only the last 8 returned items display (make for faster loading pages)
my $returned_counter = ( C4::Context->preference('numReturnedItemsToShow') ) ? C4::Context->preference('numReturnedItemsToShow') : 8;
my $count = 0;
if ( $count++ < $returned_counter ) {
my $bar_code = $returneditems{$_};
if ($riduedate{$_}) {
- my $duedate = DateTime::Format::DateParse::MySQL( $riduedate{$_}, C4::Context->tz()->name());
+ my $duedate = dt_from_string( $riduedate{$_}, 'sql');
$ri{year} = $duedate->year();
$ri{month} = $duedate->month();
$ri{day} = $duedate->day();
}
push @riloop, \%ri;
}
-
$template->param(
riloop => \@riloop,
genbrname => $branches->{$userenv_branch}->{'branchname'},