X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=deba655c56988a1ec0ded0c21c89fbc32d036d33;hb=719acce16404ce63773159842f75cce230f34486;hp=e872232a851fec3ed96ee777c68b683a82340abe;hpb=439d00a59c67a7d9d53b5d89c14ab332be16e38b;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index e872232a8..deba655c5 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -839,6 +839,16 @@ sub pkg_comment { $pre. $self->pkg. ( $custom_comment ? " - $custom_comment" : '' ); } +#without price info (so without hitting the DB again) +sub pkg_comment_only { + my $self = shift; + my %opt = @_; + + my $pre = $opt{nopkgpart} ? '' : $self->pkgpart. ': '; + my $comment = $self->comment; + $pre. $self->pkg. ( $comment ? " - $comment" : '' ); +} + sub price_info { # safety, in case a part_pkg hasn't defined price_info ''; } @@ -1241,6 +1251,8 @@ will be suppressed. sub option { my( $self, $opt, $ornull ) = @_; + cluck "$self -> option: searching for $opt" + if $DEBUG; my $part_pkg_option = qsearchs('part_pkg_option', { pkgpart => $self->pkgpart, @@ -1598,6 +1610,28 @@ sub unit_setup { $self->option('setup_fee') || 0; } +=item setup_margin + +unit_setup minus setup_cost + +=cut + +sub setup_margin { + my $self = shift; + $self->unit_setup(@_) - $self->setup_cost; +} + +=item recur_margin_permonth + +base_recur_permonth minus recur_cost_permonth + +=cut + +sub recur_margin_permonth { + my $self = shift; + $self->base_recur_permonth(@_) - $self->recur_cost_permonth(@_); +} + =item format OPTION DATA Returns data formatted according to the function 'format' described