'type' => 'checkbox',
},
+ 'bill_only_pkg_dates' => { 'name' => 'Only bill CDRs with a date during the package billing period',
+ 'type' => 'checkbox',
+ },
+
#XXX also have option for an external db
# 'cdr_location' => { 'name' => 'CDR database location'
# 'type' => 'select',
use_duration
output_format usage_mandate summarize_usage usage_section
bill_every_call
+ bill_only_pkg_dates
)
],
'weight' => 42,
) {
my $svc_phone = $cust_svc->svc_x;
- my $cdr_search = $svc_phone->psearch_cdrs(
+ my %options = (
'inbound' => 1,
'default_prefix' => $self->option('default_prefix'),
'status' => '', # unprocessed only
'for_update' => 1,
);
+ if ( $self->option('bill_only_pkg_dates') ) {
+ $options{'begin'} = $last_bill;
+ $options{'end'} = $$sdate;
+ }
+
+ my $cdr_search = $svc_phone->psearch_cdrs(%options);
$cdr_search->limit(1000);
$cdr_search->increment(0);
while ( my $cdr = $cdr_search->fetch ) {
}
my $cust_pkg = $self->cust_svc->cust_pkg or return '';
if ( $cust_pkg->contactnum ) {
- return $cust_pkg->contact->firstlast;
+ return $cust_pkg->contact_obj->firstlast;
} else {
return $cust_pkg->cust_main->name_short;
}
[ -v ]: Run verbosely, sending debugging information to STDERR. This is the
current default.
- [ -s ]: Schema changes only. Useful for Pg/slony slaves where the data
- changes will be replicated from the Pg/slony master.
+ [ -s ]: Schema changes only. Used to be useful for Pg/slony slaves where the
+ data changes would be replicated from the Pg/slony master (current
+ native Pg replication replicates schema changes to slaves
+ automatically).
[ -r ]: Skip sqlradius updates. Useful for occassions where the sqlradius
databases may be inaccessible.
Freeside is a billing and administration package for Internet Service
Providers, VoIP providers and other online businesses.
-Copyright (C) 2005-2017 Freeside Internet Services, Inc.
+Copyright (C) 2005-2018 Freeside Internet Services, Inc.
Copyright (C) 2000-2005 Ivan Kohler
Copyright (C) 1999 Silicon Interactive Software Design
Additional copyright holders may be found in the docs/license.html file.
% #contact
% 'custnum' => $f->{'custnum'},
% 'prospectnum' => $f->{'prospectnum'},
+%
% );
%
% $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
% qw( formatted_value ), #fixed
% qw( country ), #select-country
% qw( width height config ), #htmlarea
-% qw( alt_format ), #select-cust_location
+% qw( is_optional alt_format ), #select-cust_location
% qw( classnum ), # select-inventory_item
% qw( aligned ), # columnstart
% qw( debug ), # select-table
my %hash = (
'show_month_abbr' => 1,
'start_year' => '1999',
- 'end_year' => '2017',
+ 'end_year' => $eyear+3,
@_,
);
</%init>
my $custnum = $cust_main->custnum;
my $where = "WHERE cust_msg.custnum = $custnum";
-my $maxrecords = $curuser->option('customer_view_emails') || 10;
+my $maxrecords = 10;
+if ( $curuser->option('customer_view_emails') =~ /^\s*(\d+)\s*$/ ) {
+ $maxrecords = $1;
+}
my $order_by = '_date DESC';