Revision a8e00ed3
Von Sven Schöling vor fast 2 Jahren hinzugefügt
SL/DB/CustomVariable.pm | ||
---|---|---|
40 | 40 |
|
41 | 41 |
if ($type =~ m{^(?:customer|vendor|part|number)}) { |
42 | 42 |
return $self->number_value(!defined($unparsed) ? undef |
43 |
: (any { ref($unparsed) eq $_ } qw(SL::DB::Customer SL::DB::Vendor SL::DB::Part)) ? $unparsed->id * 1
|
|
43 |
: (any { ref($unparsed) eq $_ } qw(SL::DB::Customer SL::DB::Vendor SL::DB::Part)) ? $unparsed->id |
|
44 | 44 |
: $unparsed * 1); |
45 | 45 |
} |
46 | 46 |
|
... | ... | |
76 | 76 |
if ( $type eq 'customer' ) { |
77 | 77 |
require SL::DB::Customer; |
78 | 78 |
|
79 |
my $id = int($self->number_value);
|
|
79 |
my $id = defined($self->number_value) ? int($self->number_value) : undef;
|
|
80 | 80 |
return $id ? SL::DB::Customer->new(id => $id)->load() : undef; |
81 | 81 |
} elsif ( $type eq 'vendor' ) { |
82 | 82 |
require SL::DB::Vendor; |
83 | 83 |
|
84 |
my $id = int($self->number_value);
|
|
84 |
my $id = defined($self->number_value) ? int($self->number_value) : undef;
|
|
85 | 85 |
return $id ? SL::DB::Vendor->new(id => $id)->load() : undef; |
86 | 86 |
} elsif ( $type eq 'part' ) { |
87 | 87 |
require SL::DB::Part; |
88 | 88 |
|
89 |
my $id = int($self->number_value);
|
|
89 |
my $id = defined($self->number_value) ? int($self->number_value) : undef;
|
|
90 | 90 |
return $id ? SL::DB::Part->new(id => $id)->load() : undef; |
91 | 91 |
} elsif ( $type eq 'date' ) { |
92 | 92 |
return $self->timestamp_value ? $self->timestamp_value->clone->truncate(to => 'day') : undef; |
Auch abrufbar als: Unified diff
PriceRule: Warnings und Test-Folgefehler