X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=4516816129416ee56f8a266205f9110b226e40ae;hb=67c6b2d956295e851335567da679230d818e73ab;hp=3dd99aca98640f04abe2c45bb30407a376ea3562;hpb=53195d41237e1541515f62cbab5a6b2c1c63a5dd;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 3dd99aca9..451681612 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -537,9 +537,13 @@ sub pkg_comment { $pre. $self->pkg. ' - '. $self->custom_comment; } +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->custom ? '(CUSTOM) ' : '' ). $self->comment . ' ' . $self->price_info; } =item pkg_class @@ -1368,6 +1372,25 @@ sub _upgrade_data { # class method die $error if $error; } + my @part_pkg_option = qsearch('part_pkg_option', + { 'optionname' => 'unused_credit', + 'optionvalue' => 1, + }); + foreach my $old_opt (@part_pkg_option) { + my $pkgpart = $old_opt->pkgpart; + my $error = $old_opt->delete; + die $error if $error; + + foreach (qw(unused_credit_cancel unused_credit_change)) { + my $new_opt = new FS::part_pkg_option { + 'pkgpart' => $pkgpart, + 'optionname' => $_, + 'optionvalue' => 1, + }; + $error = $new_opt->insert; + die $error if $error; + } + } } =item curuser_pkgs_sql