[freeside-commits] freeside/FS/FS cust_main.pm,1.367,1.368

Ivan,,, ivan at wavetail.420.am
Wed Sep 10 00:25:17 PDT 2008


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

Modified Files:
	cust_main.pm 
Log Message:
add upcoming/preceding option, RT#3851

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.367
retrieving revision 1.368
diff -u -d -r1.367 -r1.368
--- cust_main.pm	8 Sep 2008 21:46:11 -0000	1.367
+++ cust_main.pm	10 Sep 2008 07:25:14 -0000	1.368
@@ -2381,6 +2381,7 @@
     # only for figuring next bill date, nothing else, so, reset $sdate again
     # here
     $sdate = $cust_pkg->bill || $cust_pkg->setup || $time;
+    #no need, its in $hash{last_bill}# my $last_bill = $cust_pkg->last_bill;
     $cust_pkg->last_bill($sdate);
     
     if ( $part_pkg->freq =~ /^\d+$/ ) {
@@ -2455,10 +2456,17 @@
         'recur'     => $recur,
         'unitrecur' => $unitrecur,
         'quantity'  => $cust_pkg->quantity,
-        'sdate'     => $sdate,
-        'edate'     => $cust_pkg->bill,
         'details'   => \@details,
       };
+
+      if ( $part_pkg->option('recur_temporality') eq 'preceding' ) {
+        $cust_bill_pkg->sdate( $hash{last_bill} );
+        $cust_bill_pkg->edate( $sdate - 86399   );2#60s*60m*24h-1
+      } else { #if ( $part_pkg->option('recur_temporality') eq 'upcoming' ) {
+        $cust_bill_pkg->sdate( $sdate );
+        $cust_bill_pkg->edate( $cust_pkg->bill );
+      }
+
       $cust_bill_pkg->pkgpart_override($part_pkg->pkgpart)
         unless $part_pkg->pkgpart == $real_pkgpart;
 



More information about the freeside-commits mailing list