my $previousnote = "";
foreach my $subs (@{$lines}) {
- for my $datefield ( qw(publisheddate planneddate) ) {
- # handle 0000-00-00 dates
- if (defined $subs->{$datefield} and $subs->{$datefield} =~ m/^00/) {
- $subs->{$datefield} = undef;
- }
- }
$subs->{ "status" . $subs->{'status'} } = 1;
if ( grep { $_ == $subs->{status} } ( EXPECTED, LATE, MISSING_STATUSES, CLAIMED ) ) {
$subs->{"checked"} = 1;
$nextissue = $sth->fetchrow_hashref;
}
foreach(qw/planneddate publisheddate/) {
- if ( !defined $nextissue->{$_} ) {
- # or should this default to 1st Jan ???
- $nextissue->{$_} = strftime( '%Y-%m-%d', localtime );
- }
- $nextissue->{$_} = ($nextissue->{$_} ne '0000-00-00')
- ? $nextissue->{$_}
- : undef;
+ # or should this default to 1st Jan ???
+ $nextissue->{$_} //= strftime( '%Y-%m-%d', localtime );
}
return $nextissue;
mana_id => $mana_id,
}
)->store;
+ # FIXME Must be $subscription->serials
+ # FIXME We shouldn't need serial.subscription (instead use serial->subscription->biblionumber)
+ Koha::Serials->search({ subscriptionid => $subscriptionid })->update({ biblionumber => $biblionumber });
logaction( "SERIAL", "MODIFY", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog");