[freeside-commits] freeside/FS/FS/part_pkg flat.pm,1.38,1.39
Ivan,,,
ivan at wavetail.420.am
Fri Feb 5 18:57:14 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv1433/FS/FS/part_pkg
Modified Files:
flat.pm
Log Message:
discount reporting, RT#6679
Index: flat.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- flat.pm 5 Feb 2010 02:39:31 -0000 1.38
+++ flat.pm 6 Feb 2010 02:57:12 -0000 1.39
@@ -11,6 +11,7 @@
use FS::UI::bytecount;
use FS::Conf;
use FS::part_pkg;
+use FS::cust_bill_pkg_discount;
@ISA = qw(FS::part_pkg);
@@ -190,6 +191,16 @@
$amount *= $months;
$amount = sprintf('%.2f', $amount);
+ next unless $amount > 0;
+
+ #record details in cust_bill_pkg_discount
+ my $cust_bill_pkg_discount = new FS::cust_bill_pkg_discount {
+ 'pkgdiscountnum' => $cust_pkg_discount->pkgdiscountnum,
+ 'amount' => $amount,
+ 'months' => $months,
+ };
+ push @{ $param->{'discounts'} }, $cust_bill_pkg_discount;
+
#add details on discount to invoice
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
More information about the freeside-commits
mailing list