diff options
author | ivan <ivan> | 2008-09-10 07:25:14 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-09-10 07:25:14 +0000 |
commit | 43301b925a730e808e3c3292da9058a167102f56 (patch) | |
tree | fd1044f1c1abfbcb62aa7de6d949d6824500fc7f | |
parent | c27ae57ba525791343cf0e4d46565b69ec1e3276 (diff) |
add upcoming/preceding option, RT#3851
-rw-r--r-- | FS/FS/cust_main.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 2031d7e06..8b4181e6f 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2381,6 +2381,7 @@ sub _make_lines { # 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 @@ sub _make_lines { '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; |