summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-04-22 10:21:22 -0700
committerMark Wells <mark@freeside.biz>2016-04-26 12:19:28 -0700
commit9b6a030dbbf8be7f23f1795f3164da0a5a42b08b (patch)
tree7af05729e364bf1a01539209d8f09a593b0e63cf /FS
parentb512e6226efab47518cea426147fd52cee207148 (diff)
fix apportionment of flat fees on zero-charge invoices, #39816
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_fee.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/FS/FS/part_fee.pm b/FS/FS/part_fee.pm
index 0ca52a096..1d4682c1e 100644
--- a/FS/FS/part_fee.pm
+++ b/FS/FS/part_fee.pm
@@ -402,7 +402,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;