summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_pkg/voip_inbound.pm13
-rw-r--r--FS/FS/svc_phone.pm2
-rwxr-xr-xFS/bin/freeside-upgrade6
3 files changed, 17 insertions, 4 deletions
diff --git a/FS/FS/part_pkg/voip_inbound.pm b/FS/FS/part_pkg/voip_inbound.pm
index e9ab1f733..efaf586ab 100644
--- a/FS/FS/part_pkg/voip_inbound.pm
+++ b/FS/FS/part_pkg/voip_inbound.pm
@@ -120,6 +120,10 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
'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',
@@ -160,6 +164,7 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
use_duration
output_format usage_mandate summarize_usage usage_section
bill_every_call
+ bill_only_pkg_dates
)
],
'weight' => 42,
@@ -236,12 +241,18 @@ sub calc_usage {
) {
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 ) {
diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm
index c2250c111..637c148c1 100644
--- a/FS/FS/svc_phone.pm
+++ b/FS/FS/svc_phone.pm
@@ -813,7 +813,7 @@ sub phone_name_or_cust {
}
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;
}
diff --git a/FS/bin/freeside-upgrade b/FS/bin/freeside-upgrade
index c5ea9330f..c5df06dc3 100755
--- a/FS/bin/freeside-upgrade
+++ b/FS/bin/freeside-upgrade
@@ -449,8 +449,10 @@ Also performs other upgrade functions:
[ -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.