X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=d2f2f86fadb2c1ebc5abf7d814ae8f20dff69d4c;hb=b7cf1606a66cca95e3540f803ffa66d223f23a40;hp=e4927a3895d2d761a53acf7ac0213ef55b39d54d;hpb=03728b5a1f7e30faebc170389c4d91481ade685e;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index e4927a389..d2f2f86fa 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -1665,7 +1665,7 @@ recur_cost divided by freq (only supported for monthly and longer frequencies) sub recur_cost_permonth { my($self, $cust_pkg) = @_; return 0 unless $self->freq =~ /^\d+$/ && $self->freq > 0; - sprintf('%.2f', $self->recur_cost / $self->freq ); + sprintf('%.2f', ($self->recur_cost || 0) / $self->freq ); } =item cust_bill_pkg_recur CUST_PKG @@ -1710,7 +1710,7 @@ unit_setup minus setup_cost sub setup_margin { my $self = shift; - $self->unit_setup(@_) - $self->setup_cost; + $self->unit_setup(@_) - ($self->setup_cost || 0); } =item recur_margin_permonth