diff options
author | Mark Wells <mark@freeside.biz> | 2016-04-22 10:21:22 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-04-27 13:07:36 -0700 |
commit | 849cb8f812e4e45548c91fbae53997e40dd7b40a (patch) | |
tree | d0622ec1660f4a1e5053a11c2b9987ad31d88a8d | |
parent | 013fc5e649cabbcb39e13397a57961c90d2e539b (diff) |
fix apportionment of flat fees on zero-charge invoices, #39816
-rw-r--r-- | FS/FS/part_fee.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/FS/FS/part_fee.pm b/FS/FS/part_fee.pm index 954f70b34..e86d68f08 100644 --- a/FS/FS/part_fee.pm +++ b/FS/FS/part_fee.pm @@ -406,7 +406,8 @@ sub lineitem { # if this is a percentage fee and has line item fractions, # adjust them to be proportional and to add up correctly. - if ( @item_base ) { + # don't try this if we're charging on a zero-amount set of line items. + if ( scalar(@item_base) > 0 and $total_base > 0 ) { my $cents = $amount * 100; # not necessarily the same as percent my $multiplier = $amount / $total_base; |