X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=498daf6497e7227aa19b6351952bc6d3b06d3bfe;hb=7f6f94356b0a252da15d70f29693f015e2c1fb81;hp=915634b948f7b1188a25fe946c1226fb614086ab;hpb=9ceca59afe85c259399f77df6f07003f6966b9b9;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 915634b94..498daf649 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -672,8 +672,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. @@ -692,6 +696,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 ''; } @@ -1717,6 +1725,18 @@ sub recur_margin_permonth { $self->base_recur_permonth(@_) - $self->recur_cost_permonth(@_); } +=item intro_end PACKAGE + +Takes an L object. If this plan has an introductory rate, +returns the expected date the intro period will end. If there is no intro +rate, returns zero. + +=cut + +sub intro_end { + 0; +} + =item format OPTION DATA Returns data formatted according to the function 'format' described