'freq' => $part_pkg->freq,
};
- if ( $part_pkg->option('recur_temporality', 1) eq 'preceding' ) {
+ if ( $part_pkg->recur_temporality eq 'preceding' ) {
$cust_bill_pkg->sdate( $hash{last_bill} );
$cust_bill_pkg->edate( $sdate - 86399 ); #60s*60m*24h-1
$cust_bill_pkg->edate( $time ) if $options{cancel};
- } else { #if ( $part_pkg->option('recur_temporality', 1) eq 'upcoming' ) {
+ } else { #if ( $part_pkg->recur_temporality eq 'upcoming' ) {
$cust_bill_pkg->sdate( $sdate );
$cust_bill_pkg->edate( $cust_pkg->bill );
#$cust_bill_pkg->edate( $time ) if $options{cancel};
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->option('recur_temporality', 1) eq 'preceding'
+ if $self->recur_temporality eq 'preceding'
&& ( $last_bill eq '' || $last_bill == 0 );
# termination calculations
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->option('recur_temporality', 1) eq 'preceding' && $last_bill == 0;
+ if $self->recur_temporality eq 'preceding' && $last_bill == 0;
my $charge = $self->base_recur($cust_pkg, $sdate);
if ( my $cutoff_day = $self->cutoff_day($cust_pkg) ) {
$self->freq =~ /^\d+$/ && $self->freq > 0;
}
+sub recur_temporality {
+ my $self = shift;
+ $self->option('recur_temporality', 1);
+}
+
sub usage_valuehash {
my $self = shift;
map { $_, $self->option($_) }
our $DEBUG = 1;
+sub recur_temporality { 'preceding'; }
+
sub price_info {
my $self = shift;
my $str = $self->SUPER::price_info;
'weight' => 54.5, #:/
'inherit_fields' => [ 'flat', 'global_Mixin' ],
'fields' => {
- #'recur_temporality' => { 'hidden' => 1, 'value' => 'preceding' }, #XXX do
'recur_temporality' => { 'disabled' => 1 },
'sync_bill_date' => { 'disabled' => 1 },
'cutoff_day' => { 'disabled' => 1 },
'weight' => 54.7, #:/
'inherit_fields' => [ 'flat', 'global_Mixin' ],
'fields' => {
- #'recur_temporality' => { 'hidden' => 1, 'value' => 'preceding' }, #XXX do
'recur_temporality' => { 'disabled' => 1 },
'sync_bill_date' => { 'disabled' => 1 },
'cutoff_day' => { 'disabled' => 1 },
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->option('recur_temporality', 1) eq 'preceding'
+ if $self->recur_temporality eq 'preceding'
&& ( $last_bill eq '' || $last_bill == 0 );
my $ratenum = $cust_pkg->part_pkg->option('ratenum');
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->option('recur_temporality', 1) eq 'preceding'
+ if $self->recur_temporality eq 'preceding'
&& ( $last_bill eq '' || $last_bill == 0 );
my $spool_cdr = $cust_pkg->cust_main->spool_cdr;