summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-01-09 12:32:26 -0800
committerIvan Kohler <ivan@freeside.biz>2014-01-09 12:32:26 -0800
commit7f2d0815adb38e78ed46661e3e09d499fbcbe989 (patch)
treead269a5d511a7d12b791a57793e9968b96b1d6b1 /FS/FS/part_pkg.pm
parent26746825705e313c9aa265e406192787a34ce260 (diff)
no reason for part_pkg.comment to be required, we've had price_info for ages
Diffstat (limited to 'FS/FS/part_pkg.pm')
-rw-r--r--FS/FS/part_pkg.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 4755528..3c4c127 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -660,7 +660,7 @@ sub check {
my $error = $self->ut_numbern('pkgpart')
|| $self->ut_text('pkg')
- || $self->ut_text('comment')
+ || $self->ut_textn('comment')
|| $self->ut_textn('promo_code')
|| $self->ut_alphan('plan')
|| $self->ut_enum('setuptax', [ '', 'Y' ] )
@@ -824,7 +824,8 @@ sub pkg_comment {
#$self->pkg. ' - '. $self->comment;
#$self->pkg. ' ('. $self->comment. ')';
my $pre = $opt{nopkgpart} ? '' : $self->pkgpart. ': ';
- $pre. $self->pkg. ' - '. $self->custom_comment;
+ my $custom_comment = $self->custom_comment(%opt);
+ $pre. $self->pkg. ( $custom_comment ? " - $custom_comment" : '' );
}
sub price_info { # safety, in case a part_pkg hasn't defined price_info
@@ -833,7 +834,11 @@ sub price_info { # safety, in case a part_pkg hasn't defined price_info
sub custom_comment {
my $self = shift;
- ( $self->custom ? '(CUSTOM) ' : '' ). $self->comment . ' ' . $self->price_info;
+ my $price_info = $self->price_info(@_);
+ ( $self->custom ? '(CUSTOM) ' : '' ).
+ $self->comment.
+ ( ( ($self->custom || $self->comment) && $price_info ) ? ' - ' : '' ).
+ $price_info;
}
=item pkg_class