[freeside-commits] freeside/FS/FS/part_pkg delayed_Mixin.pm, 1.1, 1.2 flat.pm, 1.65, 1.66
Ivan,,,
ivan at wavetail.420.am
Wed Aug 10 17:38:03 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv14582/FS/FS/part_pkg
Modified Files:
delayed_Mixin.pm flat.pm
Log Message:
hide start date on package order for specific package definitions, RT#13783
Index: flat.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat.pm,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -w -d -r1.65 -r1.66
--- flat.pm 17 Jun 2011 09:47:04 -0000 1.65
+++ flat.pm 11 Aug 2011 00:38:01 -0000 1.66
@@ -219,6 +219,8 @@
sub is_prepaid { 0; } #no, we're postpaid
+sub can_start_date { ! shift->option('start_1st', 1) }
+
#XXX discounts only on recurring fees for now (no setup/one-time or usage)
sub can_discount {
my $self = shift;
Index: delayed_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/delayed_Mixin.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- delayed_Mixin.pm 10 Aug 2011 23:43:43 -0000 1.1
+++ delayed_Mixin.pm 11 Aug 2011 00:38:01 -0000 1.2
@@ -25,7 +25,7 @@
sub calc_setup {
my($self, $cust_pkg, $time ) = @_;
- unless ( $self->option('delay_setup') ) {
+ unless ( $self->option('delay_setup', 1) ) {
my $d = $cust_pkg->bill || $time;
$d += 86400 * $self->option('free_days');
$cust_pkg->bill($d);
@@ -37,7 +37,7 @@
sub calc_remain {
my ($self, $cust_pkg, %options) = @_;
- unless ( $self->option('delay_setup') ) {
+ unless ( $self->option('delay_setup', 1) ) {
my $last_bill = $cust_pkg->last_bill || 0;
my $next_bill = $cust_pkg->getfield('bill') || 0;
my $free_days = $self->option('free_days');
@@ -49,4 +49,6 @@
return $self->SUPER::calc_remain($cust_pkg, %options);
}
+sub can_start_date { ! shift->option('delay_setup', 1) }
+
1;
More information about the freeside-commits
mailing list