Revision ec817966
Von Thomas Heck vor etwa 11 Jahren hinzugefügt
SL/DB/CustomVariable.pm | ||
---|---|---|
18 | 18 |
goto &bool_value if $type eq 'boolean'; |
19 | 19 |
goto ×tamp_value if $type eq 'timestamp'; |
20 | 20 |
goto &number_value if $type eq 'number'; |
21 |
|
|
22 |
if ( $_[1] && ($type eq 'customer' || $type eq 'vendor' || $type eq 'part') ) { |
|
23 |
$self->number_value($_[1]); |
|
24 |
} |
|
25 |
|
|
21 | 26 |
if ( $type eq 'customer' ) { |
22 |
if ( defined($_[1]) && $_[1] ) { |
|
23 |
goto &number_value; |
|
24 |
} |
|
25 |
else { |
|
26 |
require SL::DB::Customer; |
|
27 |
|
|
28 |
my $id = int($self->number_value); |
|
29 |
return $id ? SL::DB::Customer->new(id => $id)->load() : 0; |
|
30 |
} |
|
27 |
require SL::DB::Customer; |
|
28 |
|
|
29 |
my $id = int($self->number_value); |
|
30 |
return $id ? SL::DB::Customer->new(id => $id)->load() : 0; |
|
31 |
} elsif ( $type eq 'vendor' ) { |
|
32 |
require SL::DB::Vendor; |
|
33 |
|
|
34 |
my $id = int($self->number_value); |
|
35 |
return $id ? SL::DB::Vendor->new(id => $id)->load() : 0; |
|
36 |
} elsif ( $type eq 'part' ) { |
|
37 |
require SL::DB::Part; |
|
38 |
|
|
39 |
my $id = int($self->number_value); |
|
40 |
return $id ? SL::DB::Part->new(id => $id)->load() : 0; |
|
31 | 41 |
} |
32 |
goto &text_value; # text and select |
|
42 |
|
|
43 |
goto &text_value; # text, textfield, date and select |
|
33 | 44 |
} |
34 | 45 |
|
35 | 46 |
sub is_valid { |
Auch abrufbar als: Unified diff
Waren- und Lieferanten-CVars richtig speichern
fixt #2374