X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=offline_circ%2Fservice.pl;h=a23e2b819997cfa95fc2fee0e059c76794c20ac5;hb=7ed66a6c8ae1c3c824e496c2d312e23db1dd8e41;hp=e8acb9054fa797416d6d9818e6b7ec6f2ed230df;hpb=a6c9bd0eb55c32d5632625144775271f20aa15f7;p=koha.git diff --git a/offline_circ/service.pl b/offline_circ/service.pl index e8acb9054f..a23e2b8199 100755 --- a/offline_circ/service.pl +++ b/offline_circ/service.pl @@ -24,6 +24,8 @@ use warnings; use CGI qw ( -utf8 ); use C4::Auth; use C4::Circulation; +use Koha::DateUtils; +use DateTime::TimeZone; my $cgi = CGI->new; @@ -47,6 +49,11 @@ if ($status eq 'ok') { # if authentication is ok $cardnumber =~ s/^\s+//; $cardnumber =~ s/\s+$//; + # KOCT send UTC timestamp, it should be converted to local timezone + my $dt = dt_from_string($timestamp, 'iso', DateTime::TimeZone->new(name => 'UTC')); + $dt->set_time_zone(C4::Context->tz); + $timestamp = $dt->ymd('-') . ' ' . $dt->hms(':'); + if ( $cgi->param('pending') eq 'true' ) { # if the 'pending' flag is true, we store the operation in the db instead of directly processing them $result = AddOfflineOperation( $userid,