[freeside-commits] freeside/FS/FS/cust_main Billing.pm,1.34,1.35
Ivan,,,
ivan at wavetail.420.am
Thu Jun 9 20:33:46 PDT 2011
- Previous message: [freeside-commits] freeside/FS/FS part_pkg.pm, 1.119, 1.120 Schema.pm, 1.304, 1.305 cust_bill.pm, 1.341, 1.342 cust_bill_pkg.pm, 1.54, 1.55
- Next message: [freeside-commits] freeside/httemplate/browse part_pkg.cgi, 1.60, 1.61
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS/cust_main
In directory wavetail.420.am:/tmp/cvs-serv15864/FS/FS/cust_main
Modified Files:
Billing.pm
Log Message:
add package def option to show $0 recurring on invoices, RT#9777
Index: Billing.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Billing.pm,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -d -r1.34 -r1.35
--- Billing.pm 9 May 2011 20:31:10 -0000 1.34
+++ Billing.pm 10 Jun 2011 03:33:43 -0000 1.35
@@ -603,27 +603,47 @@
#discard bundled packages of 0 value
sub _omit_zero_value_bundles {
+ my @in = @_;
my @cust_bill_pkg = ();
my @cust_bill_pkg_bundle = ();
my $sum = 0;
my $discount_show_always = 0;
- foreach my $cust_bill_pkg ( @_ ) {
+ foreach my $cust_bill_pkg ( @in ) {
+
$discount_show_always = ($cust_bill_pkg->get('discounts')
&& scalar(@{$cust_bill_pkg->get('discounts')})
&& $conf->exists('discount-show-always'));
+
+ warn " pkgnum ". $cust_bill_pkg->pkgnum.
+ " sum $sum, recur_show_zero ". $cust_bill_pkg->recur_show_zero. "\n"
+ if $DEBUG > 0;
+
if (scalar(@cust_bill_pkg_bundle) && !$cust_bill_pkg->pkgpart_override) {
push @cust_bill_pkg, @cust_bill_pkg_bundle
- if ($sum > 0 || ($sum == 0 && $discount_show_always));
+ if $sum > 0
+ || ($sum == 0 && ( $discount_show_always
+ || grep $_->recur_show_zero, @cust_bill_pkg_bundle )
+ );
@cust_bill_pkg_bundle = ();
$sum = 0;
}
+
$sum += $cust_bill_pkg->setup + $cust_bill_pkg->recur;
push @cust_bill_pkg_bundle, $cust_bill_pkg;
+
}
+
push @cust_bill_pkg, @cust_bill_pkg_bundle
- if ($sum > 0 || ($sum == 0 && $discount_show_always));
+ if $sum > 0
+ || ($sum == 0 && ( $discount_show_always
+ || grep $_->recur_show_zero, @cust_bill_pkg_bundle )
+ );
+
+ warn " _omit_zero_value_bundles: ". scalar(@in).
+ '->'. scalar(@cust_bill_pkg). "\n" #. Dumper(@cust_bill_pkg). "\n"
+ if $DEBUG > 2;
(@cust_bill_pkg);
@@ -1024,10 +1044,12 @@
my $discount_show_always = ($recur == 0 && scalar(@discounts)
&& $conf->exists('discount-show-always'));
- if ( $setup != 0 ||
- $recur != 0 ||
- (!$part_pkg->hidden && $options{has_hidden}) || #include some $0 lines
- $discount_show_always )
+ if ( $setup != 0
+ || $recur != 0
+ || (!$part_pkg->hidden && $options{has_hidden}) #include some $0 lines
+ || $discount_show_always
+ || ($recur == 0 && $part_pkg->recur_show_zero)
+ )
{
warn " charges (setup=$setup, recur=$recur); adding line items\n"
- Previous message: [freeside-commits] freeside/FS/FS part_pkg.pm, 1.119, 1.120 Schema.pm, 1.304, 1.305 cust_bill.pm, 1.341, 1.342 cust_bill_pkg.pm, 1.54, 1.55
- Next message: [freeside-commits] freeside/httemplate/browse part_pkg.cgi, 1.60, 1.61
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list