diff --git a/C4/Letters.pm b/C4/Letters.pm index 4acc931992..519c0f6a8c 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -652,7 +652,10 @@ sub _parseletter { $val = GetAuthorisedValueByCode ('ROADTYPE', $val, 0) if $table=~/^borrowers$/ && $field=~/^streettype$/; my $replacedby = defined ($val) ? $val : ''; - if ( $replacedby and $replacedby =~ m|^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$| ) { + if ( $replacedby + and not $replacedby =~ m|0000-00-00| + and $replacedby =~ m|^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$| ) + { # If the value is XXXX-YY-ZZ[ AA:BB:CC] we assume it is a date my $dateonly = defined $1 ? 0 : 1; #$1 refers to the capture group wrapped in parentheses. In this case, that's the hours, minutes, seconds. eval {