[freeside-commits] freeside/FS/FS/part_pkg agent.pm, 1.6, 1.7 cdr_termination.pm, 1.6, 1.7 prorate.pm, 1.20, 1.21 prorate_Mixin.pm, 1.2, 1.3 sql_external.pm, 1.10, 1.11 voip_cdr.pm, 1.103, 1.104 voip_inbound.pm, 1.3, 1.4
Mark Wells
mark at wavetail.420.am
Wed Sep 29 16:41:36 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv12864
Modified Files:
agent.pm cdr_termination.pm prorate.pm prorate_Mixin.pm
sql_external.pm voip_cdr.pm voip_inbound.pm
Log Message:
option to charge the next full period when prorating, RT#9874
Index: prorate_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/prorate_Mixin.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- prorate_Mixin.pm 24 Aug 2010 19:07:59 -0000 1.2
+++ prorate_Mixin.pm 29 Sep 2010 23:41:34 -0000 1.3
@@ -81,11 +81,18 @@
timelocal(0,0,0,$cutoff_day,$mon == 0 ? 11 : $mon - 1,$year-($mon==11));
}
+ # next bill date will be figured as $$sdate + one period
$$sdate = $mstart;
my $permonth = $self->option('recur_fee', 1) / $self->freq;
my $months = ( ( $self->freq - 1 ) + ($mend-$mnow) / ($mend-$mstart) );
+ if ( $self->option('add_full_period',1) ) {
+ # charge a full period in addition to the partial month
+ $months += $self->freq;
+ $$sdate = $self->add_freq($mstart);
+ }
+
$param->{'months'} = $months;
$charge = sprintf('%.2f', $permonth * $months);
}
Index: sql_external.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/sql_external.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -d -r1.10 -r1.11
--- sql_external.pm 9 Mar 2010 08:37:33 -0000 1.10
+++ sql_external.pm 29 Sep 2010 23:41:34 -0000 1.11
@@ -24,6 +24,10 @@
'subscription',
'default' => '1',
},
+ 'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
+ 'for one full period after that',
+ 'type' => 'checkbox',
+ },
'recur_method' => { 'name' => 'Recurring fee method',
#'type' => 'radio',
@@ -45,7 +49,7 @@
},
},
'fieldorder' => [qw( setup_fee recur_fee unused_credit recur_method cutoff_day
- datasrc db_username db_password query
+ add_full_period datasrc db_username db_password query
)],
'weight' => '58',
);
Index: agent.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/agent.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -d -r1.6 -r1.7
--- agent.pm 31 Jan 2010 02:57:13 -0000 1.6
+++ agent.pm 29 Sep 2010 23:41:34 -0000 1.7
@@ -38,6 +38,10 @@
'cutoff_day' => { 'name' => 'Billing Day (1 - 28)',
'default' => '1',
},
+ 'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
+ 'for one full period after that',
+ 'type' => 'checkbox',
+ },
'no_pkg_prorate' => { 'name' => 'Disable prorating bulk packages (charge full price for packages active only a portion of the month)',
'type' => 'checkbox',
@@ -46,7 +50,7 @@
},
#'fieldorder' => [qw( setup_fee recur_fee recur_method cutoff_day ) ],
- 'fieldorder' => [qw( setup_fee recur_fee cutoff_day no_pkg_prorate ) ],
+ 'fieldorder' => [qw( setup_fee recur_fee cutoff_day add_full_period no_pkg_prorate ) ],
'weight' => 51,
Index: prorate.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/prorate.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -d -r1.20 -r1.21
--- prorate.pm 19 Aug 2010 19:11:32 -0000 1.20
+++ prorate.pm 29 Sep 2010 23:41:34 -0000 1.21
@@ -79,6 +79,11 @@
'package recharge',
'type' => 'checkbox',
},
+ 'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
+ 'for one full period after that',
+ 'type' => 'checkbox',
+ },
+
#it would be better if this had to be turned on, its confusing
'externalid' => { 'name' => 'Optional External ID',
@@ -89,7 +94,8 @@
'seconds', 'upbytes', 'downbytes', 'totalbytes',
'recharge_amount', 'recharge_seconds', 'recharge_upbytes',
'recharge_downbytes', 'recharge_totalbytes',
- 'usage_rollover', 'recharge_reset', 'externalid', ],
+ 'usage_rollover', 'recharge_reset', 'add_full_period',
+ 'externalid', ],
'freq' => 'm',
'weight' => 20,
);
Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -w -d -r1.103 -r1.104
--- voip_cdr.pm 29 Sep 2010 19:38:00 -0000 1.103
+++ voip_cdr.pm 29 Sep 2010 23:41:34 -0000 1.104
@@ -70,7 +70,10 @@
'subscription',
'default' => '1',
},
-
+ 'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
+ 'for one full period after that',
+ 'type' => 'checkbox',
+ },
'recur_method' => { 'name' => 'Recurring fee method',
#'type' => 'radio',
#'options' => \%recur_method,
@@ -253,6 +256,7 @@
'fieldorder' => [qw(
setup_fee recur_fee recur_temporality unused_credit
recur_method cutoff_day
+ add_full_period
cdr_svc_method
rating_method ratenum min_charge sec_granularity
ignore_unrateable
Index: voip_inbound.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_inbound.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- voip_inbound.pm 21 May 2010 03:42:34 -0000 1.3
+++ voip_inbound.pm 29 Sep 2010 23:41:34 -0000 1.4
@@ -47,6 +47,10 @@
'subscription',
'default' => '1',
},
+ 'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
+ 'for one full period after that',
+ 'type' => 'checkbox',
+ },
'recur_method' => { 'name' => 'Recurring fee method',
'type' => 'select',
@@ -152,7 +156,7 @@
},
'fieldorder' => [qw(
setup_fee recur_fee recur_temporality unused_credit
- recur_method cutoff_day
+ recur_method cutoff_day add_full_period
min_charge sec_granularity
default_prefix
disable_tollfree
Index: cdr_termination.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/cdr_termination.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -d -r1.6 -r1.7
--- cdr_termination.pm 16 Jan 2010 23:39:57 -0000 1.6
+++ cdr_termination.pm 29 Sep 2010 23:41:34 -0000 1.7
@@ -58,6 +58,10 @@
'subscription',
'default' => '1',
},
+ 'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
+ 'for one full period after that',
+ 'type' => 'checkbox',
+ },
'recur_method' => { 'name' => 'Recurring fee method',
#'type' => 'radio',
@@ -90,6 +94,7 @@
'fieldorder' => [qw(
setup_fee recur_fee
recur_temporality unused_credit recur_method cutoff_day
+ add_full_period
output_format usage_section summarize_usage usage_mandate
)
],
More information about the freeside-commits
mailing list