Lines 33-38
use List::MoreUtils qw/any/;
Link Here
|
33 |
use DateTime::Format::MySQL; |
33 |
use DateTime::Format::MySQL; |
34 |
use Data::Dumper; # used as part of logging item record changes, not just for |
34 |
use Data::Dumper; # used as part of logging item record changes, not just for |
35 |
# debugging; so please don't remove this |
35 |
# debugging; so please don't remove this |
|
|
36 |
use Koha::DateUtils qw/dt_from_string/; |
36 |
|
37 |
|
37 |
use vars qw($VERSION @ISA @EXPORT); |
38 |
use vars qw($VERSION @ISA @EXPORT); |
38 |
|
39 |
|
Lines 536-551
sub ModItem {
Link Here
|
536 |
|
537 |
|
537 |
$item->{onloan} = undef if $item->{itemlost}; |
538 |
$item->{onloan} = undef if $item->{itemlost}; |
538 |
|
539 |
|
539 |
for my $field ( qw( itemlost wthdrawn ) ) { |
540 |
if ( $item->{itemlost} || $item->{wthdrawn} ) { |
540 |
if ( defined( $item->{$field} ) ) { |
541 |
my $pre_mod_item = GetItem( $item->{'itemnumber'} ); |
541 |
my $pre_mod_item = GetItem($item->{'itemnumber'}); |
542 |
for my $field (qw( itemlost wthdrawn )) { |
542 |
unless ( $pre_mod_item->{$field} ) { |
543 |
if ( defined( $item->{$field} ) ) { |
543 |
if ( $item->{$field} ) { |
544 |
unless ( $pre_mod_item->{$field} ) { |
544 |
$item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() ); |
545 |
if ( $item->{$field} ) { |
545 |
} |
546 |
$item->{ $field . '_on' } = |
|
|
547 |
DateTime::Format::MySQL->format_datetime( dt_from_string() ); |
548 |
} |
549 |
} |
550 |
} |
551 |
else { |
552 |
$item->{ $field . '_on' } = undef; |
546 |
} |
553 |
} |
547 |
} else { |
|
|
548 |
$item->{$field . '_on'} = undef; |
549 |
} |
554 |
} |
550 |
} |
555 |
} |
551 |
|
556 |
|
552 |
- |
|
|