X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=008ba8a86831288fe11e7a268617f6925bf28101;hb=6a509099343ed155525c4304f1ad742cc6e4ce59;hp=709e137f373f92f092f6136cb4fd923a2e883431;hpb=5c3409b2a987a9a6fc6ca77bcaceb4b7cefa03de;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 709e137f3..008ba8a86 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 ''; } @@ -2007,6 +2015,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