+sub item_discount {
+ my ($self, $cust_pkg) = @_;
+ return unless $self->option('show_as_discount',1);
+ my $intro_end = $self->intro_end($cust_pkg);
+ my $amount = sprintf('%.2f',
+ $self->option('intro_fee') - $self->option('recur_fee')
+ );
+ return unless $amount < 0;
+ # otherwise it's an "introductory surcharge"? not the intended use of
+ # the feature.
+
+ { '_is_discount' => 1,
+ 'description' => $cust_pkg->mt('Introductory discount until') . ' ' .
+ $cust_pkg->time2str_local('short', $intro_end),
+ 'setup_amount' => 0,
+ 'recur_amount' => $amount,
+ 'ext_description' => [],
+ 'pkgpart' => $self->pkgpart,
+ 'feepart' => '',
+ }
+}