X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=3480964d0d5d2775c43dc0896029103e0845108a;hb=c545a57d21341c49674defed65a4243f07b5ebaf;hp=92e72cf8a7190b0f2a8770ad57c3078cca31e91f;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 92e72cf8a..3480964d0 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -10,6 +10,7 @@ use FS::part_pkg; %info = ( 'name' => 'Flat rate (anniversary billing)', + 'shortname' => 'Anniversary', 'fields' => { 'setup_fee' => { 'name' => 'Setup fee for this package', 'default' => 0, @@ -98,6 +99,14 @@ sub calc_setup { push @$details, $self->option( 'additional_info' . $i++ ); } + my $quantity = $cust_pkg->quantity || 1; + + sprintf("%.2f", $quantity * $self->unit_setup($cust_pkg, $sdate, $details) ); +} + +sub unit_setup { + my($self, $cust_pkg, $sdate, $details ) = @_; + $self->option('setup_fee'); } @@ -154,7 +163,8 @@ sub is_prepaid { } sub reset_usage { - my($self, $cust_pkg) = @_; + my($self, $cust_pkg, %opt) = @_; + warn " resetting usage counters" if $opt{debug} > 1; my %values = map { $_, $self->option($_) } grep { $self->option($_, 'hush') } qw(seconds upbytes downbytes totalbytes);