[freeside-commits] freeside/FS/FS Conf.pm, 1.397.2.24, 1.397.2.25 cust_bill.pm, 1.299.2.5, 1.299.2.6

Erik Levinson levinse at wavetail.420.am
Sun Jan 30 22:23:36 PST 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv30547/FS/FS

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	Conf.pm cust_bill.pm 
Log Message:
add missing commits as part of backporting of RT10481 to 2.1 branch

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.397.2.24
retrieving revision 1.397.2.25
diff -u -w -d -r1.397.2.24 -r1.397.2.25
--- Conf.pm	28 Jan 2011 21:55:16 -0000	1.397.2.24
+++ Conf.pm	31 Jan 2011 06:23:33 -0000	1.397.2.25
@@ -655,6 +655,13 @@
   },
 
   {
+    'key'         => 'discount-show-always',
+    'section'     => 'billing',
+    'description' => 'Generate a line item on an invoice even when a package is discounted 100%',
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'encryption',
     'section'     => 'billing',
     'description' => 'Enable encryption of credit cards.',

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.299.2.5
retrieving revision 1.299.2.6
diff -u -w -d -r1.299.2.5 -r1.299.2.6
--- cust_bill.pm	19 Jan 2011 19:12:26 -0000	1.299.2.5
+++ cust_bill.pm	31 Jan 2011 06:23:33 -0000	1.299.2.6
@@ -4133,19 +4133,23 @@
   my $summary_page = $opt{summary_page} || '';
   my $multilocation = $opt{multilocation} || '';
   my $multisection = $opt{multisection} || '';
+  my $discount_show_always = 0;
 
   my @b = ();
   my ($s, $r, $u) = ( undef, undef, undef );
   foreach my $cust_bill_pkg ( @$cust_bill_pkg )
   {
 
+    $discount_show_always = ($cust_bill_pkg->cust_bill_pkg_discount
+				&& $conf->exists('discount-show-always'));
+
     foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) {
       if ( $_ && !$cust_bill_pkg->hidden ) {
         $_->{amount}      = sprintf( "%.2f", $_->{amount} ),
         $_->{amount}      =~ s/^\-0\.00$/0.00/;
         $_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ),
         push @b, { %$_ }
-          unless $_->{amount} == 0;
+	  unless ( $_->{amount} == 0 && !$discount_show_always );
         $_ = undef;
       }
     }
@@ -4219,7 +4223,8 @@
 
         }
 
-        if ( ( $cust_bill_pkg->recur != 0  || $cust_bill_pkg->setup == 0 ) &&
+        if ( ( $cust_bill_pkg->recur != 0  || $cust_bill_pkg->setup == 0 || 
+		($discount_show_always && $cust_bill_pkg->recur == 0) ) &&
              ( !$type || $type eq 'R' || $type eq 'U' )
            )
         {
@@ -4344,7 +4349,7 @@
       $_->{amount}      =~ s/^\-0\.00$/0.00/;
       $_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ),
       push @b, { %$_ }
-        unless $_->{amount} == 0;
+	unless ( $_->{amount} == 0 && !$discount_show_always );
     }
   }
 



More information about the freeside-commits mailing list