[freeside-commits] branch FREESIDE_3_BRANCH updated. 75d07cc54b2e54e50bff80203c6065b215ee5d1c
Mark Wells
mark at 420.am
Wed Sep 9 00:19:10 PDT 2015
The branch, FREESIDE_3_BRANCH has been updated
via 75d07cc54b2e54e50bff80203c6065b215ee5d1c (commit)
from 1d8cf0f25e468b871d18962bda022c94d2934f02 (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 75d07cc54b2e54e50bff80203c6065b215ee5d1c
Author: Mark Wells <mark at freeside.biz>
Date: Wed Sep 9 00:18:16 2015 -0700
fix weird behavior with bundles where base package has zero recur, #32460
diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index ec780e6..014d715 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -810,6 +810,7 @@ sub bill {
}
#discard bundled packages of 0 value
+# XXX we should reconsider whether we even need this
sub _omit_zero_value_bundles {
my @in = @_;
@@ -818,11 +819,20 @@ sub _omit_zero_value_bundles {
my $discount_show_always = $conf->exists('discount-show-always');
my $show_this = 0;
+ # Sort @in the same way we do during invoice rendering, so we can identify
+ # bundles. See FS::Template_Mixin::_items_nontax.
+ @in = sort { $a->pkgnum <=> $b->pkgnum or
+ $a->sdate <=> $b->sdate or
+ ($a->pkgpart_override ? 0 : -1) or
+ ($b->pkgpart_override ? 0 : 1) or
+ $b->hidden cmp $a->hidden or
+ $a->pkgpart_override <=> $b->pkgpart_override
+ } @in;
+
# this is a pack-and-deliver pattern. every time there's a cust_bill_pkg
# _without_ pkgpart_override, that's the start of the new bundle. if there's
# an existing bundle, and it contains a nonzero amount (or a zero amount
# that's displayable anyway), push all line items in the bundle.
-
foreach my $cust_bill_pkg ( @in ) {
if (scalar(@bundle) and !$cust_bill_pkg->pkgpart_override) {
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_main/Billing.pm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
More information about the freeside-commits
mailing list