#!/usr/bin/perl

#use utf8;
use strict;
use CGI;

use Opals::Context;
use Opals::Constant;
use POSIX qw(
    floor
);
use Time::localtime;
use Opals::Template qw(
    tmpl_read
    tmpl_write
    tmpl_preference
);
use Opals::Circulation qw(
    circ_getItemStatus
    circ_getItemInfo
);
use Opals::Date qw(
    date_parse
    date_today
    date_text
    date_validateWorkday
    date_deltaWorkDay
    date_addDeltaWorkday
);
use Opals::User qw(
    user_getInformation
    user_getInformationById
    user_balance
);

my $dbh = Opals::Context->dbh();
END { $dbh->disconnect(); }

my $cgi = CGI->new;
my $input = $cgi->Vars();
my ($permission, $cookie, $template) = tmpl_read(
        {
            dbh             => $dbh,
            cgi             => $cgi,
            tmplFile        => 'record/tempItems.tmpl',
            reqPermission   => 'circ_return',
        }
);

my $barcode = $input->{'bc'};
$barcode    =~ s/^\s+|\s+$//g;

        
unless ($permission && $permission->{'circ_return'})
{
    $template->param(
        input => [
                    {name => 'bc', value => $barcode,},
                 ],
    );
    goto __END_OF_FILE;
}
 
my $tm = localtime;
my $todayStr = sprintf("%04d-%02d-%02d", $tm->year+1900, ($tm->mon)+1, $tm->mday);
my $syspref = tmpl_preference($dbh);
if($barcode){
}

$template->param(circulation=>1);

__END_OF_FILE:

tmpl_write($dbh, $cgi, $cookie, $template);


