summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/part_pkg/voip_inbound.pm13
-rw-r--r--FS/FS/svc_phone.pm2
-rwxr-xr-xFS/bin/freeside-upgrade6
-rw-r--r--README2
-rw-r--r--httemplate/edit/elements/edit.html3
-rw-r--r--httemplate/elements/tr-select-from_to.html2
-rw-r--r--httemplate/view/cust_main/notes/email.html5
7 files changed, 25 insertions, 8 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.
diff --git a/README b/README
index 476b58e95..0ddb78aeb 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
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.
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 113f611e1..8ba703a2f 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -358,6 +358,7 @@ Example:
% #contact
% 'custnum' => $f->{'custnum'},
% 'prospectnum' => $f->{'prospectnum'},
+%
% );
%
% $include_common{$_} = $f->{$_} foreach grep exists($f->{$_}),
@@ -370,7 +371,7 @@ Example:
% 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
diff --git a/httemplate/elements/tr-select-from_to.html b/httemplate/elements/tr-select-from_to.html
index 1224de68a..c24209737 100644
--- a/httemplate/elements/tr-select-from_to.html
+++ b/httemplate/elements/tr-select-from_to.html
@@ -39,7 +39,7 @@
my %hash = (
'show_month_abbr' => 1,
'start_year' => '1999',
- 'end_year' => '2017',
+ 'end_year' => $eyear+3,
@_,
);
</%init>
diff --git a/httemplate/view/cust_main/notes/email.html b/httemplate/view/cust_main/notes/email.html
index 41c5b8ad4..9e217e4f0 100644
--- a/httemplate/view/cust_main/notes/email.html
+++ b/httemplate/view/cust_main/notes/email.html
@@ -61,7 +61,10 @@ my $cust_main = $opt{'cust_main'}
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';