From 82c456be9d4e3ea43dc5fbc1f6d63f15fbe8ca6d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 7 Jun 2022 08:27:25 +0100 Subject: [PATCH] Bug 29963: Restore original intention of bug 29815 This patch restores the original intended behaviour of bug 29815; To pre-populate the dateaccessioned field on item creations only. --- C4/Items.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/C4/Items.pm b/C4/Items.pm index 9808fadd1f..6d17567282 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1707,6 +1707,15 @@ sub PrepareItemrecordDisplay { $defaultvalue = $defaultvalues->{ccode}; } } + if ( ( $subfield->{kohafield} eq 'items.dateaccessioned' ) + && !$itemrecord + && $defaultvalues + && $defaultvalues->{'dateaccessioned'} ) + { + my $date = dt_from_string(); + $date = $date->ymd; + $defaultvalue = $date; + } if ( $subfield->{authorised_value} ) { my @authorised_values; my %authorised_lib; -- 2.20.1