}
# case of a return of document (deal with issues and holdingbranch)
- my $today = DateTime->now( time_zone => C4::Context->tz() );
+ my $today = dt_from_string( $return_date, 'iso' );
+
if ($doreturn) {
my $datedue = $issue->{date_due};
$borrower or warn "AddReturn without current borrower";
use C4::Reserves qw( ModReserveAffect );
use C4::Items qw( ModItemTransfer );
use C4::Debug;
+use Koha::DateUtils;
use parent qw(ILS::Transaction);
sub do_checkin {
my $self = shift;
my $branch = shift;
+ my $return_date = shift;
if (!$branch) {
$branch = 'SIP2';
}
my $barcode = $self->{item}->id;
+
+ $return_date = substr( $return_date, 0, 4 )
+ . '-'
+ . substr( $return_date, 4, 2 )
+ . '-'
+ . substr( $return_date, 6, 2 )
+ . q{ }
+ . substr( $return_date, 12, 2 )
+ . ':'
+ . substr( $return_date, 14, 2 )
+ . ':'
+ . substr( $return_date, 16, 2 );
+
$debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
- my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch);
+ my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date);
$self->alert(!$return);
# ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered