|
Lines 30-35
use MARC::Record;
Link Here
|
| 30 |
use C4::ClassSource; |
30 |
use C4::ClassSource; |
| 31 |
use C4::Log; |
31 |
use C4::Log; |
| 32 |
use List::MoreUtils qw/any/; |
32 |
use List::MoreUtils qw/any/; |
|
|
33 |
use DateTime::Format::MySQ; |
| 33 |
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 |
| 34 |
# debugging; so please don't remove this |
35 |
# debugging; so please don't remove this |
| 35 |
|
36 |
|
|
Lines 535-546
sub ModItem {
Link Here
|
| 535 |
|
536 |
|
| 536 |
$item->{onloan} = undef if $item->{itemlost}; |
537 |
$item->{onloan} = undef if $item->{itemlost}; |
| 537 |
|
538 |
|
|
|
539 |
my $pre_mod_item = GetItem($item->{'itemnumber'}); |
| 538 |
for my $field ( qw( itemlost wthdrawn ) ) { |
540 |
for my $field ( qw( itemlost wthdrawn ) ) { |
| 539 |
if ( defined( $item->{$field} ) ) { |
541 |
unless ( $pre_mod_item->{$field} ) { |
| 540 |
if ( $item->{$field} ) { |
542 |
if ( defined( $item->{$field} ) ) { |
| 541 |
$item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() ); |
543 |
if ( $item->{$field} ) { |
| 542 |
} else { |
544 |
$item->{$field . '_on'} = DateTime::Format::MySQL->format_datetime( DateTime->now() ); |
| 543 |
$item->{$field . '_on'} = undef; |
545 |
} else { |
|
|
546 |
$item->{$field . '_on'} = undef; |
| 547 |
} |
| 544 |
} |
548 |
} |
| 545 |
} |
549 |
} |
| 546 |
} |
550 |
} |
| 547 |
- |
|
|