[freeside-commits] freeside/FS/FS cust_main.pm, 1.271.2.55, 1.271.2.56
Ivan,,,
ivan at wavetail.420.am
Wed Sep 10 00:25:01 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv18062
Modified Files:
Tag: FREESIDE_1_7_BRANCH
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.271.2.55
retrieving revision 1.271.2.56
diff -u -d -r1.271.2.55 -r1.271.2.56
--- cust_main.pm 8 Sep 2008 02:47:20 -0000 1.271.2.55
+++ cust_main.pm 10 Sep 2008 07:24:57 -0000 1.271.2.56
@@ -2020,6 +2020,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+$/ ) {
@@ -2100,10 +2101,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 );
+ }
+
$error = $cust_bill_pkg->insert;
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
More information about the freeside-commits
mailing list