X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=ef7f557807abe5f6e31c8617cdeaee2664dbd84c;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=0aadd5a784e35ffb945fb6c05f9bf3bcb8558490;hpb=63a268637b2d51a8766412617724b9436439deb6;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 0aadd5a78..ef7f55780 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -98,6 +98,8 @@ inherits from FS::Record. The following fields are currently supported: =item agentnum - Optional agentnum (see L) +=item fcc_ds0s - Optional DS0 equivalency number for FCC form 477 + =back =head1 METHODS @@ -462,6 +464,7 @@ sub check { || $self->ut_textn('taxclass') || $self->ut_enum('disabled', [ '', 'Y' ] ) || $self->ut_enum('custom', [ '', 'Y' ] ) + || $self->ut_enum('no_auto', [ '', 'Y' ]) #|| $self->ut_moneyn('setup_cost') #|| $self->ut_moneyn('recur_cost') || $self->ut_floatn('setup_cost') @@ -479,6 +482,7 @@ sub check { ? $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum' ) : $self->ut_agentnum_acl('agentnum', \@null_agentnum_right) ) + || $self->ut_numbern('fcc_ds0s') || $self->SUPER::check ; return $error if $error; @@ -767,6 +771,7 @@ sub is_free { } } +sub can_discount { 0; } sub freqs_href { #method, class method or sub? #my $self = shift; @@ -907,9 +912,11 @@ sub options { map { $_->optionname => $_->optionvalue } $self->part_pkg_option; } -=item option OPTIONNAME +=item option OPTIONNAME [ QUIET ] -Returns the option value for the given name, or the empty string. +Returns the option value for the given name, or the empty string. If a true +value is passed as the second argument, warnings about missing the option +will be suppressed. =cut @@ -1205,6 +1212,18 @@ sub calc_units { 0; } #fallback for everything except bulk.pm sub hide_svc_detail { 0; } +=item recur_cost_permonth CUST_PKG + +recur_cost divided by freq (only supported for monthly and longer frequencies) + +=cut + +sub recur_cost_permonth { + my($self, $cust_pkg) = @_; + return 0 unless $self->freq =~ /^\d+$/ && $self->freq > 0; + sprintf('%.2f', $self->recur_cost / $self->freq ); +} + =item format OPTION DATA Returns data formatted according to the function 'format' described