The date last seen field (952 $r) and replacement price date (952 $w) were being
ignored on import, being replaced with NOW() as a hardcoded value. This patch will
allow a value to be imported, but if none is, it will use the ISO date of import
as a default.
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
homebranch = ?,
price = ?,
replacementprice = ?,
- replacementpricedate = NOW(),
+ replacementpricedate = ?,
datelastborrowed = ?,
- datelastseen = NOW(),
+ datelastseen = ?,
stack = ?,
notforloan = ?,
damaged = ?,
stocknumber = ?
";
my $sth = $dbh->prepare($query);
+ my $today = C4::Dates->today('iso');
$sth->execute(
$item->{'biblionumber'},
$item->{'biblioitemnumber'},
$item->{'homebranch'},
$item->{'price'},
$item->{'replacementprice'},
+ $item->{'replacementpricedate'} || $today,
$item->{datelastborrowed},
+ $item->{datelastseen} || $today,
$item->{stack},
$item->{'notforloan'},
$item->{'damaged'},