[freeside-commits] freeside/FS/FS/part_pkg bulk.pm,1.8,1.9
Mark Wells
mark at wavetail.420.am
Sun Oct 31 12:28:25 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv18160
Modified Files:
bulk.pm
Log Message:
no_prorate option for bulk packages, RT#9821
Index: bulk.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/bulk.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -d -r1.8 -r1.9
--- bulk.pm 25 Oct 2010 22:22:41 -0000 1.8
+++ bulk.pm 31 Oct 2010 19:28:23 -0000 1.9
@@ -7,7 +7,7 @@
@ISA = qw(FS::part_pkg::flat);
-$DEBUG = 1;
+$DEBUG = 0;
$me = '[FS::part_pkg::bulk]';
%info = (
@@ -33,9 +33,13 @@
'instead of a detailed list',
'type' => 'checkbox',
},
+ 'no_prorate' => { 'name' => 'Don\'t prorate recurring fees on new '.
+ 'services',
+ 'type' => 'checkbox',
+ },
},
'fieldorder' => [ 'setup_fee', 'recur_fee', 'svc_setup_fee', 'svc_recur_fee',
- 'unused_credit', 'summarize_svcs' ],
+ 'unused_credit', 'summarize_svcs', 'no_prorate' ],
'weight' => 50,
);
@@ -86,9 +90,15 @@
my $svc_end = $h_cust_svc->date_deleted;
$svc_end = ( !$svc_end || $svc_end > $$sdate ) ? $$sdate : $svc_end;
- my $recur_charge =
- $self->option('svc_recur_fee') * ( $svc_end - $svc_start )
+ my $recur_charge;
+ if ( $self->option('no_prorate',1) ) {
+ $recur_charge = $self->option('svc_recur_fee');
+ }
+ else {
+ $recur_charge = $self->option('svc_recur_fee')
+ * ( $svc_end - $svc_start )
/ ( $$sdate - $last_bill );
+ }
$svc_details .= $money_char. sprintf('%.2f', $recur_charge ).
' ('. time2str('%x', $svc_start).
More information about the freeside-commits
mailing list