From c6947f2f7a0959649882383d6a61a9925bb67d98 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 13 Dec 2021 17:46:56 +0000 Subject: [PATCH] Bug 29815: Pre-fill 952$d (Date acquired) when receiving serial items Test plan: 1. Create a subscription - Select the 'Create an item record when receiving this serial' 2. Receive the serial 3. After changing the status from 'Expected' to 'Arrived' notice that the 'd - Date acquired' is not set until you click on that field 4. Apply patch and restart services 5. Receive the serial again and notice this time today's date is pre-populated in 'd - Date acquired' Sponsored-By: Brimbank Library, Australia --- C4/Items.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Items.pm b/C4/Items.pm index 3fb78840ee..9b5792b89c 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1685,6 +1685,11 @@ sub PrepareItemrecordDisplay { $defaultvalue = $defaultvalues->{ccode}; } } + if ( $subfield->{kohafield} eq 'items.dateaccessioned' ) { + my $date = DateTime->now; + $date = $date->ymd; + $defaultvalue = $date; + } if ( $subfield->{authorised_value} ) { my @authorised_values; my %authorised_lib; -- 2.11.0