my $time = $options{'time'} || time;
my $invoice_time = $options{'invoice_time'} || $time;
+ my $cmp_time = ( $conf->exists('next-bill-ignore-time')
+ ? day_end( $time )
+ : $time
+ );
+
$options{'not_pkgpart'} ||= {};
$options{'not_pkgpart'} = { map { $_ => 1 }
split(/\s*,\s*/, $options{'not_pkgpart'})
my $next_bill = $cust_pkg->getfield('bill') || 0;
my $error;
- while ( $next_bill <= $time ) {
+ while ( $next_bill <= $cmp_time ) {
$error =
$self->_make_lines( 'part_pkg' => $part_pkg,
'cust_pkg' => $cust_pkg,
return $error if $error;
}
+ $cust_bill_pkg->set_display( part_pkg => $part_pkg,
+ real_pkgpart => $real_pkgpart,
+ );
+
push @$cust_bill_pkgs, $cust_bill_pkg;
} #if $setup != 0 || $recur != 0
}
- #what's this doing in the middle of _handle_taxes? probably should split
- #this into three parts above in _make_lines
- $cust_bill_pkg->set_display( part_pkg => $part_pkg,
- real_pkgpart => $real_pkgpart,
- );
-
my %tax_cust_bill_pkg = $cust_bill_pkg->disintegrate;
foreach my $key (keys %tax_cust_bill_pkg) {
my @taxes = @{ $taxes{$key} || [] };