X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=bf607849bc530aa6508e1bafc7b18192c1cf9bce;hb=103dfde149eec5034696d073253255f508a1be78;hp=fb0570647abff1c76b7bcbbc69c8ced26c801af4;hpb=3117b156cf3d118ae6a76c823311bfd941fbdf86;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index fb0570647..bf607849b 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -693,6 +693,25 @@ sub replace { ''; } +sub validate_number { + my ($option, $valref) = @_; + + $$valref = 0 unless $$valref; + return "Invalid $option" + unless ($$valref) = ($$valref =~ /^\s*(\d+)\s*$/); + return ''; +} + +sub validate_number_blank { + my ($option, $valref) = @_; + + if ($$valref) { + return "Invalid $option" + unless ($$valref) = ($$valref =~ /^\s*(\d+)\s*$/); + } + return ''; +} + =item check Checks all fields to make sure this is a valid package definition. If @@ -1861,7 +1880,7 @@ sub _rebless { =item calc_setup CUST_PKG START_DATE DETAILS_ARRAYREF OPTIONS_HASHREF -=item calc_recur CUST_PKG START_DATE DETAILS_ARRAYREF OPTIONS_HASHREF +=item calc_recur CUST_PKG START_DATE_SCALARREF DETAILS_ARRAYREF OPTIONS_HASHREF Calculates and returns the setup or recurring fees, respectively, for this package. Implementation is in the FS::part_pkg:* module specific to this price @@ -1881,11 +1900,11 @@ Frequency override (for calc_recur) This option is filled in by the method rather than controlling its operation. It is an arrayref. Applicable discounts will be added to the arrayref, as -L. +L records. =item real_pkgpart -For package add-ons, is the base L, otherwise +For package add-ons, is the base L package definition, otherwise no different than pkgpart. =item precommit_hooks @@ -1909,7 +1928,7 @@ plan option prorate_defer_bill). =back Note: Don't calculate prices when not actually billing the package. For that, -see the L and L methods. +see the L and L methods. =cut