diff options
author | Mark Wells <mark@freeside.biz> | 2016-06-03 17:45:04 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-06-03 17:45:04 -0700 |
commit | 64427efc6ccc314e525b310c02b39a6f776b99f4 (patch) | |
tree | 2442ce7a8cc8c438aa599980927306a0fe88d97b | |
parent | 79129a414248ce263a8810ba7966bfdc82680674 (diff) |
calculate unitrecur on sql_external packages with quantity details, #40558
-rw-r--r-- | FS/FS/cust_main/Billing.pm | 1 | ||||
-rw-r--r-- | FS/FS/part_pkg/sql_external.pm | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index 77529562f..7cb3837f1 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -1361,6 +1361,7 @@ sub _make_lines { if ( $param{'override_quantity'} ) { $override_quantity = $param{'override_quantity'}; + $unitrecur = $recur / $override_quantity; } if ( $increment_next_bill ) { diff --git a/FS/FS/part_pkg/sql_external.pm b/FS/FS/part_pkg/sql_external.pm index 48d89a0e3..38bd8d77c 100644 --- a/FS/FS/part_pkg/sql_external.pm +++ b/FS/FS/part_pkg/sql_external.pm @@ -96,8 +96,7 @@ sub calc_recur { die "sql_external query returned non-numeric amount: $row->{amount}"; } } - if (exists $row->{quantity}) { - $quantity ||= 0; + if (defined $row->{quantity}) { if ( $row->{quantity} eq '' ) { # treat as zero } elsif ( $row->{quantity} =~ /^\d+$/ ) { |