[freeside-commits] freeside/FS/FS/part_pkg flat.pm, 1.69, 1.70 rt_time.pm, 1.5, 1.6 voip_cdr.pm, 1.139, 1.140 voip_inbound.pm, 1.18, 1.19

Mark Wells mark at wavetail.420.am
Tue Jan 24 14:25:15 PST 2012


Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv3013/FS/FS/part_pkg

Modified Files:
	flat.pm rt_time.pm voip_cdr.pm voip_inbound.pm 
Log Message:
option to bill partial period on cancel/suspend, #16066

Index: flat.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat.pm,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -w -d -r1.69 -r1.70
--- flat.pm	22 Dec 2011 23:38:57 -0000	1.69
+++ flat.pm	24 Jan 2012 22:25:13 -0000	1.70
@@ -70,7 +70,14 @@
                                     'unsuspending',
                           'type' => 'checkbox',
                         },
-
+    'bill_recur_on_cancel' => {
+                        'name' => 'Bill the last period on cancellation',
+                        'type' => 'checkbox',
+                        },
+    'bill_suspend_as_cancel' => {
+                        'name' => 'Bill immediately upon suspension', #desc?
+                        'type' => 'checkbox',
+                        },
     'externalid' => { 'name'   => 'Optional External ID',
                       'default' => '',
                     },
@@ -81,6 +88,8 @@
                         start_1st
                         sync_bill_date prorate_defer_bill prorate_round_day
                         suspend_bill unsuspend_adjust_bill
+                        bill_recur_on_cancel
+                        bill_suspend_as_cancel
                         externalid ),
                   ],
   'weight' => 10,
@@ -138,7 +147,7 @@
   my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
 
   return 0
-    if $self->recur_temporality eq 'preceding' && $last_bill == 0;
+    if $self->recur_temporality eq 'preceding' && !$last_bill;
 
   my $charge = $self->base_recur($cust_pkg, $sdate);
   if ( my $cutoff_day = $self->cutoff_day($cust_pkg) ) {

Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -w -d -r1.139 -r1.140
--- voip_cdr.pm	5 Jan 2012 20:06:59 -0000	1.139
+++ voip_cdr.pm	24 Jan 2012 22:25:13 -0000	1.140
@@ -315,12 +315,13 @@
 
 }
 
-sub calc_cancel {
-  my $self = shift;
-  my($cust_pkg, $sdate, $details, $param ) = @_;
-
-  $self->calc_usage(@_);
-}
+# use the default
+#sub calc_cancel {
+#  my $self = shift;
+#  my($cust_pkg, $sdate, $details, $param ) = @_;
+#
+#  $self->calc_usage(@_);
+#}
 
 #false laziness w/voip_sqlradacct calc_recur resolve it if that one ever gets used again
 

Index: rt_time.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/rt_time.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -d -r1.5 -r1.6
--- rt_time.pm	12 Feb 2011 04:56:57 -0000	1.5
+++ rt_time.pm	24 Jan 2012 22:25:13 -0000	1.6
@@ -52,12 +52,13 @@
 
 sub can_discount { 0; }
 
-sub calc_cancel {
-  my $self = shift;
-  my($cust_pkg, $sdate, $details, $param ) = @_;
-
-  $self->calc_usage(@_);
-}
+# use the default
+#sub calc_cancel {
+#  my $self = shift;
+#  my($cust_pkg, $sdate, $details, $param ) = @_;
+#
+#  $self->calc_usage(@_);
+#}
 
 sub calc_usage {
   my $self = shift;

Index: voip_inbound.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_inbound.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -w -d -r1.18 -r1.19
--- voip_inbound.pm	14 Nov 2011 04:27:57 -0000	1.18
+++ voip_inbound.pm	24 Jan 2012 22:25:13 -0000	1.19
@@ -177,12 +177,13 @@
 
 }
 
-sub calc_cancel {
-  my $self = shift;
-  my($cust_pkg, $sdate, $details, $param ) = @_;
-
-  $self->calc_usage(@_);
-}
+# use the default
+#sub calc_cancel {
+#  my $self = shift;
+#  my($cust_pkg, $sdate, $details, $param ) = @_;
+#
+#  $self->calc_usage(@_);
+#}
 
 #false laziness w/voip_sqlradacct calc_recur resolve it if that one ever gets used again
 



More information about the freeside-commits mailing list