X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_svc_column.pm;h=fb08eaa0dd16a1ecd79fd3b9cee5f8a205e0010a;hb=9608be1f5c73517fc348f1ab458892b34ed7facb;hp=885155be3ef88bb0426f0b857ec1849ab5254f8e;hpb=2041a9143fac20b79ead4a1ae01224dedf5b27c2;p=freeside.git diff --git a/FS/FS/part_svc_column.pm b/FS/FS/part_svc_column.pm index 885155be3..fb08eaa0d 100644 --- a/FS/FS/part_svc_column.pm +++ b/FS/FS/part_svc_column.pm @@ -41,7 +41,7 @@ fields are currently supported: =item columnvalue - default or fixed value for the column -=item columnflag - null, D, F, X (virtual fields) +=item columnflag - null or empty (no default), `D' for default, `F' for fixed (unchangeable), `M' for manual selection from inventory, or `A' for automatic selection from inventory. For virtual fields, can also be 'X' for excluded. =back @@ -91,19 +91,21 @@ sub check { ; return $error if $error; - $self->columnflag =~ /^([DFX])$/ + $self->columnflag =~ /^([DFMAX])$/ or return "illegal columnflag ". $self->columnflag; $self->columnflag(uc($1)); + if ( $self->columnflag =~ /^[MA]$/ ) { + $error = + $self->ut_foreign_key( 'columnvalue', 'inventory_class', 'classnum' ); + return $error if $error; + } + $self->SUPER::check; } =back -=head1 VERSION - -$Id: part_svc_column.pm,v 1.2 2003-08-05 00:20:44 khoff Exp $ - =head1 BUGS =head1 SEE ALSO