diff options
author | Mark Wells <mark@freeside.biz> | 2014-12-30 23:28:57 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-12-30 23:28:57 -0800 |
commit | a51b71cdea80993d815ecd9c79132df0a68b78b6 (patch) | |
tree | a9b216a989d541ad3470ce0cba40d583ccbaa11e /FS/FS/part_pkg.pm | |
parent | 4e0dfb0cb472d5fa4ab0581c43b4bab72ed50847 (diff) |
sales commission on invoices: allow commission based on cost, #25847
Diffstat (limited to 'FS/FS/part_pkg.pm')
-rw-r--r-- | FS/FS/part_pkg.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index e4927a3..d2f2f86 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 |