discounts, RT#6679
[freeside.git] / FS / FS / part_pkg / subscription.pm
index c9c472c..825f5ca 100644 (file)
@@ -10,6 +10,7 @@ use FS::part_pkg::flat;
 
 %info = (
   'name' => 'First partial month full charge, then flat-rate (selectable billing day)',
+  'shortname' => 'Subscription (Nth of month, full charge for first)',
   'fields' => {
     'setup_fee' => { 'name' => 'Setup fee for this package',
                      'default' => 0,
@@ -102,7 +103,11 @@ sub calc_recur {
 
   $$sdate = timelocal(0,0,0,$cutoff_day,$mon,$year);
 
-  $self->option('recur_fee');
+  my $br = $self->base_recur(@_);
+
+  my $discount = $self->calc_discount(@_);
+
+  sprintf('%.2f', $br - $discount);
 }
 
 1;