[freeside-commits] freeside/FS/FS/part_pkg flat.pm,1.43,1.44

Ivan,,, ivan at wavetail.420.am
Thu Aug 19 03:15:24 PDT 2010


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

Modified Files:
	flat.pm 
Log Message:
fix fixed-amount discounts against packages with pkg add-ons, RT#9669

Index: flat.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat.pm,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -w -d -r1.43 -r1.44
--- flat.pm	3 Aug 2010 06:31:09 -0000	1.43
+++ flat.pm	19 Aug 2010 10:15:21 -0000	1.44
@@ -154,7 +154,7 @@
 sub unit_setup {
   my($self, $cust_pkg, $sdate, $details ) = @_;
 
-  $self->option('setup_fee');
+  $self->option('setup_fee') || 0;
 }
 
 sub calc_recur {
@@ -185,7 +185,8 @@
      my $discount = $cust_pkg_discount->discount;
      #UI enforces one or the other (for now?  probably for good)
      my $amount = 0;
-     $amount += $discount->amount;
+     $amount += $discount->amount
+       if $cust_pkg->pkgpart == $param->{real_pkgpart};
      $amount += sprintf('%.2f', $discount->percent * $br / 100 );
 
      my $chg_months = $param->{'months'} || $cust_pkg->part_pkg->freq;



More information about the freeside-commits mailing list