[freeside-commits] branch FREESIDE_4_BRANCH updated. cf630a513689c8a176a6a552fcbcba844a0d5b76

Mark Wells mark at 420.am
Fri Jun 3 17:48:35 PDT 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  cf630a513689c8a176a6a552fcbcba844a0d5b76 (commit)
      from  1ceeee1c6b8c46805c103fbcfc1bbee768b12609 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cf630a513689c8a176a6a552fcbcba844a0d5b76
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jun 3 17:45:04 2016 -0700

    calculate unitrecur on sql_external packages with quantity details, #40558

diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index 47a3dc2..d953767 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -1172,6 +1172,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 6760634..9bf107b 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+$/ ) {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main/Billing.pm     |    1 +
 FS/FS/part_pkg/sql_external.pm |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list