X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=92943f25cb16a59adbc4236ad46d7e3071af14e9;hp=709e137f373f92f092f6136cb4fd923a2e883431;hb=fe25108857542f5d7c460ab831bc782f608179fa;hpb=c91974c5178828304d723d15f0b6405d173fa707 diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 709e137f3..92943f25c 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -773,8 +773,12 @@ sub check { =item check_options For a passed I<$options> hashref, validates any options that -have 'validate' subroutines defined (I<$options> values might -be altered.) Returns error message, or empty string if valid. +have 'validate' subroutines defined in the info hash, +then validates the entire hashref if the price plan has +its own 'validate' subroutine defined in the info hash +(I<$options> values might be altered.) + +Returns error message, or empty string if valid. Invoked by L and L via the equivalent methods in L. @@ -793,6 +797,10 @@ sub check_options { } } # else "option does not exist" error? } + if (exists($plans{$self->plan}->{'validate'})) { + my $error = &{$plans{$self->plan}->{'validate'}}($options); + return $error if $error; + } return ''; }