[freeside-commits] freeside/FS/FS/part_pkg flat.pm, 1.41, 1.42 subscription.pm, 1.16, 1.17
Ivan,,,
ivan at wavetail.420.am
Thu Apr 1 01:10:07 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv25748
Modified Files:
flat.pm subscription.pm
Log Message:
fix nasty discount fallout (i hope)
Index: flat.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -w -d -r1.41 -r1.42
--- flat.pm 1 Apr 2010 07:39:23 -0000 1.41
+++ flat.pm 1 Apr 2010 08:10:05 -0000 1.42
@@ -158,8 +158,7 @@
}
sub calc_recur {
- my $self = shift;
- my($cust_pkg) = @_;
+ my($self, $cust_pkg, $sdate, $details, $param ) = @_;
#my $last_bill = $cust_pkg->last_bill;
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
@@ -167,18 +166,17 @@
return 0
if $self->option('recur_temporality', 1) eq 'preceding' && $last_bill == 0;
- my $br = $self->base_recur(@_);
+ my $br = $self->base_recur($cust_pkg);
- my $discount = $self->calc_discount(@_);
+ my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
sprintf('%.2f', $br - $discount);
}
sub calc_discount {
- my $self = shift;
- my($cust_pkg, $sdate, $details, $param ) = @_;
+ my($self, $cust_pkg, $sdate, $details, $param ) = @_;
- my $br = $self->base_recur(@_);
+ my $br = $self->base_recur($cust_pkg);
my $tot_discount = 0;
#UI enforces just 1 for now, will need ordering when they can be stacked
Index: subscription.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/subscription.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -d -r1.16 -r1.17
--- subscription.pm 31 Jan 2010 02:57:14 -0000 1.16
+++ subscription.pm 1 Apr 2010 08:10:05 -0000 1.17
@@ -91,7 +91,7 @@
);
sub calc_recur {
- my($self, $cust_pkg, $sdate ) = @_;
+ my($self, $cust_pkg, $sdate, $details, $param ) = @_;
my $cutoff_day = $self->option('cutoff_day', 1) || 1;
my $mnow = $$sdate;
my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($mnow) )[0,1,2,3,4,5];
@@ -103,9 +103,9 @@
$$sdate = timelocal(0,0,0,$cutoff_day,$mon,$year);
- my $br = $self->base_recur(@_);
+ my $br = $self->base_recur($cust_pkg);
- my $discount = $self->calc_discount(@_);
+ my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
sprintf('%.2f', $br - $discount);
}
More information about the freeside-commits
mailing list