From 1700d04352bb363dba8eb9d1fcd265001e6e22a5 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 21 Mar 2013 07:18:34 -0700 Subject: [PATCH] Bug 9673 - Track when items are marked as lost or withdrawn - QA Followup --- C4/Items.pm | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 43ea2c1..b90b976 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -30,6 +30,7 @@ use MARC::Record; use C4::ClassSource; use C4::Log; use List::MoreUtils qw/any/; +use DateTime::Format::MySQL; use Data::Dumper; # used as part of logging item record changes, not just for # debugging; so please don't remove this @@ -537,11 +538,14 @@ sub ModItem { for my $field ( qw( itemlost wthdrawn ) ) { if ( defined( $item->{$field} ) ) { - if ( $item->{$field} ) { - $item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() ); - } else { - $item->{$field . '_on'} = undef; + my $pre_mod_item = GetItem($item->{'itemnumber'}); + unless ( $pre_mod_item->{$field} ) { + if ( $item->{$field} ) { + $item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() ); + } } + } else { + $item->{$field . '_on'} = undef; } } -- 1.7.2.5