summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rwxr-xr-xhttemplate/browse/part_svc.cgi1
-rw-r--r--httemplate/edit/elements/part_svc_column.html19
-rw-r--r--httemplate/edit/elements/svc_Common.html10
-rwxr-xr-xhttemplate/edit/part_svc.cgi4
-rw-r--r--httemplate/edit/process/elements/process.html9
-rwxr-xr-xhttemplate/edit/process/part_pkg.cgi33
-rw-r--r--httemplate/edit/svc_broadband.cgi3
-rw-r--r--httemplate/misc/cust_pkg-import.html4
-rw-r--r--httemplate/search/cust_timespan.html7
-rw-r--r--httemplate/search/elements/search.html15
-rw-r--r--httemplate/search/report_cust_timespan.html2
-rw-r--r--httemplate/view/svc_broadband.cgi3
12 files changed, 98 insertions, 12 deletions
diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
index b9474636d..222433db3 100755
--- a/httemplate/browse/part_svc.cgi
+++ b/httemplate/browse/part_svc.cgi
@@ -251,6 +251,7 @@ my %flag = (
'A' => 'Automatically filled in from inventory',
'H' => 'Selected from hardware class',
'X' => 'Excluded',
+ 'P' => 'From package 477 information',
);
my %search;
diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html
index 816f3428b..bdbce7c79 100644
--- a/httemplate/edit/elements/part_svc_column.html
+++ b/httemplate/edit/elements/part_svc_column.html
@@ -15,6 +15,7 @@ To be called from part_svc.cgi.
# don't allow the 'inventory' flags (M, A) to be chosen for
# fields that aren't free-text
my $inv_sub = sub { $_[0]->{disable_inventory} || $_[0]->{type} ne 'text' };
+
tie my %flag, 'Tie::IxHash',
'' => { 'desc' => 'No default', 'condition' => sub { 0 } },
'D' => { 'desc' => 'Default',
@@ -38,6 +39,9 @@ tie my %flag, 'Tie::IxHash',
'H' => { 'desc' => 'Select from hardware class',
'condition' => sub { $_[0]->{type} ne 'select-hardware' },
},
+ 'P' => { 'desc' => 'From package FCC 477 information',
+ 'condition' => sub { $_[0]->{type} ne 'fcc_477_speed' }, # get values from package fcc 477 information
+ },
'X' => { 'desc' => 'Excluded',
'condition' => sub { 1 }, # obsolete
},
@@ -202,6 +206,20 @@ my %communigate_fields = (
% $mode = 'hardware';
% $multiple = 0;
% }
+%
+% if ( $def->{'type'} eq 'fcc_477_speed' ) {
+% if ($field eq 'speed_up') {
+ <SPAN ID="<% $name %>_select">
+ upstream speed
+ <INPUT TYPE="hidden" ID="<% $name %>_select" NAME="<% $name %>_classnum" VALUE="up">
+ </SPAN>
+% } elsif ($field eq 'speed_down') {
+ <SPAN ID="<% $name %>_select">
+ downstream speed
+ <INPUT TYPE="hidden" ID="<% $name %>_select" NAME="<% $name %>_classnum" VALUE="down">
+ </SPAN>
+% }
+% } else {
<& /elements/select-table.html,
'field' => $name.'_classnum',
'id' => $name.'_select',
@@ -211,6 +229,7 @@ my %communigate_fields = (
'empty_label' => "Select $mode class",
'multiple' => $multiple,
&>
+% }
% }
</TD>
<TD>
diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html
index a4e345e40..e1c309080 100644
--- a/httemplate/edit/elements/svc_Common.html
+++ b/httemplate/edit/elements/svc_Common.html
@@ -169,6 +169,16 @@
];
} # shouldn't this be enforced for all 'S' fields?
+ elsif ( $flag eq 'P' ) { #form fcc_477 values
+ $f->{type} = 'fixed';
+ my $cust_pkg = FS::Record::qsearchs({
+ 'table' => 'cust_pkg',
+ 'hashref' => { 'pkgnum' => $object->{Hash}->{pkgnum} }
+ });
+ my $fcc_record = $cust_pkg->fcc_477_record('broadband_'.$columndef->columnvalue.'stream') if $cust_pkg;
+ $f->{'value'} = $fcc_record->{Hash}->{optionvalue} ? $fcc_record->{Hash}->{optionvalue} * 1000 : '';
+ } # end 477 values
+
if ( $f->{'type'} =~ /^select-svc/ )
{
$f->{'include_opt_callback'} =
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi
index fed21256f..49c1c03d8 100755
--- a/httemplate/edit/part_svc.cgi
+++ b/httemplate/edit/part_svc.cgi
@@ -107,7 +107,7 @@ function flag_changed(obj) {
select.multiple = false;
}
}
- } else if ( newflag == 'M' || newflag == 'A' || newflag == 'H' ) {
+ } else if ( newflag == 'M' || newflag == 'A' || newflag == 'H' || newflag == 'P' ) {
// these all require a class selection
if ( select ) {
select.disabled = false;
@@ -120,7 +120,7 @@ function flag_changed(obj) {
}
var required = document.getElementById(layer + '__' + field + '_required');
if (required && !required.disabledinit) {
- if (newflag == "F") {
+ if (newflag == "F" || newflag =="P") {
required.checked = false;
required.disabled = true;
} else {
diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html
index 8c307f0b6..c197eb123 100644
--- a/httemplate/edit/process/elements/process.html
+++ b/httemplate/edit/process/elements/process.html
@@ -89,6 +89,9 @@ Example:
# for use with tables that are FS::option_Common (among other things)
'args_callback' => sub { my( $cgi, $object ) = @_; },
+ # if no errors after package insert or replace will update services attached to package.
+ 'update_svc' => sub { my( $cgi, $object ) = @_; },
+
'debug' => 1, #turns on debugging output
#agent virtualization
@@ -438,6 +441,12 @@ foreach my $value ( @values ) {
}
}
+ if ( !$error and $opt{'update_svc'} ) {
+ my @args = ();
+ @args = &{ $opt{'args_callback'} }( $cgi, $new ) if $opt{'args_callback'};
+ $error = &{ $opt{'update_svc'} }( $cgi, $new, @args );
+ }
+
if ( $error ) {
$cgi->param('error', $error);
diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi
index c4d150ba1..5beb03411 100755
--- a/httemplate/edit/process/part_pkg.cgi
+++ b/httemplate/edit/process/part_pkg.cgi
@@ -9,6 +9,7 @@
'edit_ext' => 'cgi',
'precheck_callback' => $precheck_callback,
'args_callback' => $args_callback,
+ 'update_svc' => $update_svc,
'process_locale' => 'pkg',
'process_m2m' => \@process_m2m,
'process_o2m' => \@process_o2m,
@@ -199,6 +200,38 @@ my $args_callback = sub {
};
+## update services upon package change.
+my $update_svc = sub {
+ my $cgi = shift @_;
+ my $new = shift @_;
+ my %args = @_;
+ my $error;
+
+ my @svcs = $new->pkg_svc();
+
+## update broadband services getting their up and down speeds from package fcc_477 options
+ foreach my $svc_part(@svcs) {
+ my @part_svc_column = qsearch('part_svc_column',{ 'svcpart' => $svc_part->{Hash}->{svcpart}, 'columnflag' => 'P' });
+
+ if ($svc_part->{Hash}->{svcdb} eq "svc_broadband" && (keys $args{fcc_options}) && @part_svc_column ) {
+ ## find provisioned services to update
+ my @svc_svcdb = qsearch({
+ 'table' => 'svc_broadband',
+ 'select' => 'svc_broadband.*, cust_svc.svcpart',
+ 'addl_from' => 'LEFT JOIN cust_svc USING (svcnum) LEFT JOIN cust_pkg USING (pkgnum)',
+ 'extra_sql' => " WHERE cust_svc.svcpart = '".$svc_part->{Hash}->{svcpart}."' AND cust_pkg.pkgpart = '".$svc_part->{Hash}->{pkgpart}."'",
+ });
+ foreach my $svc (@svc_svcdb) {
+ next if ($svc->{Hash}->{speed_down} == $args{fcc_options}->{broadband_downstream} * 1000 && $svc->{Hash}->{speed_up} == $args{fcc_options}->{broadband_upstream} * 1000);
+ $svc->{Hash}->{speed_down} = $args{fcc_options}->{broadband_downstream} * 1000;
+ $svc->{Hash}->{speed_up} = $args{fcc_options}->{broadband_upstream} * 1000;
+ $error = $svc->replace();
+ }
+ }
+ }
+ return $error;
+};
+
my $redirect_callback = sub {
#my( $cgi, $new ) = @_;
return '' unless $custnum;
diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi
index 81c694aa5..bcf55fe11 100644
--- a/httemplate/edit/svc_broadband.cgi
+++ b/httemplate/edit/svc_broadband.cgi
@@ -100,7 +100,7 @@ END
;
my @fields = (
- qw( description speed_down speed_up ),
+ qw( description speed_down speed_up speed_test_down speed_test_up speed_test_latency),
{ field=>'sectornum', type=>'select-tower_sector', },
{ field=>'routernum', type=>'select-router_block_ip',
include_opt_callback => sub {
@@ -179,7 +179,6 @@ my $svc_field_callback = sub {
my $columndef = $part_svc->part_svc_column($fieldref->{'field'});
if ($fieldref->{field} eq 'usergroup' && $columndef->columnflag eq 'F') {
-
$fieldref->{'formatted_value'} =
[ $object->radius_groups('long_description') ];
}
diff --git a/httemplate/misc/cust_pkg-import.html b/httemplate/misc/cust_pkg-import.html
index 6272d28ff..da242a28f 100644
--- a/httemplate/misc/cust_pkg-import.html
+++ b/httemplate/misc/cust_pkg-import.html
@@ -36,6 +36,7 @@ Import a file containing customer packages.
<OPTION VALUE="svc_acct">Account service
<OPTION VALUE="svc_acct-agent_custid">Account service with agent_custid
<OPTION VALUE="svc_acct-locationnum">Account service with existing location
+ <OPTION VALUE="svc_broadband">Broadband service
<OPTION VALUE="svc_phone">Phone service
<OPTION VALUE="svc_phone-agent_custid">Phone service with agent_custid
<OPTION VALUE="svc_phone-locationnum">Phone service with existing location
@@ -105,6 +106,9 @@ Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.
<b>Account service with existing location</b> format has the following field order: <i>custnum<%$req%>, locationnum, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, username, _password, domsvc</i>
<BR><BR>
+<b>Broadband service</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, ip_addr<%$req%>, description, routernum, blocknum, sectornum, speed_up, speed_down</i>
+<BR><BR>
+
<b>Phone service</b> format has the following field order: <i>custnum<%$req%>, pkgpart<%$req%>, discountnum, start_date, setup, bill, last_bill, susp, adjourn, cancel, expire, countrycode, phonenum, sip_password, pin</i>
<BR><BR>
diff --git a/httemplate/search/cust_timespan.html b/httemplate/search/cust_timespan.html
index f5684251a..f95250a44 100644
--- a/httemplate/search/cust_timespan.html
+++ b/httemplate/search/cust_timespan.html
@@ -11,6 +11,7 @@
'header' => \@header,
'fields' => \@fields,
'links' => \@links,
+ 'disable_maxselect' => '1',
&>
<%init>
@@ -84,7 +85,11 @@ my $active_pkg_sql = 'select pkgnum from cust_pkg where cust_pkg.custnum = cust_
## sql to get the first active date, last cancel date, and last reason.
my $active_date = 'select min(setup) from cust_pkg left join part_pkg using (pkgpart) where cust_pkg.custnum = cust_main.custnum and part_pkg.freq > \'0\'';
-my $cancel_date = 'select max(cancel) from cust_pkg where cust_pkg.custnum = cust_main.custnum';
+
+## set cancel date range here
+my($beginning_date, $ending_date) = FS::UI::Web::parse_beginning_ending($cgi, '');
+my $cancel_date = 'select max(cancel) from cust_pkg left join part_pkg using (pkgpart) where cust_pkg.custnum = cust_main.custnum and part_pkg.freq > \'0\' and (cancel >= '.$beginning_date.' and cancel <= '.$ending_date.')';
+
my $cancel_reason = 'select reason.reason from cust_pkg
left join cust_pkg_reason on (cust_pkg.pkgnum = cust_pkg_reason.pkgnum)
left join reason on (cust_pkg_reason.reasonnum = reason.reasonnum)
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 0e8c69a51..730a51aa3 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -389,14 +389,15 @@ unless ( $type =~ /^(csv|xml|\w*.xls)$/) {
#setup some pagination things if we're in html mode
my $conf = new FS::Conf;
- $confmax = $conf->config('maxsearchrecordsperpage') || 100;
- if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) {
- $maxrecords = $1;
- } else {
- $maxrecords ||= $confmax;
- }
-
$opt{'disable_maxselect'} ||= $conf->exists('disable_maxselect');
+ unless ($opt{'disable_maxselect'}) {
+ $confmax = $conf->config('maxsearchrecordsperpage') || 100;
+ if ( $cgi->param('maxrecords') =~ /^(\d+)$/ ) {
+ $maxrecords = $1;
+ } else {
+ $maxrecords ||= $confmax;
+ }
+ }
$limit = $maxrecords ? "LIMIT $maxrecords" : '';
diff --git a/httemplate/search/report_cust_timespan.html b/httemplate/search/report_cust_timespan.html
index 4ff3bb892..27dd94006 100644
--- a/httemplate/search/report_cust_timespan.html
+++ b/httemplate/search/report_cust_timespan.html
@@ -20,6 +20,8 @@
'curr_value' => scalar( $cgi->param('cust_status') ),
&>
+ <& /elements/tr-input-beginning_ending.html &>
+
</FORM>
</TABLE>
diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi
index 0517c307a..189fe5e6f 100644
--- a/httemplate/view/svc_broadband.cgi
+++ b/httemplate/view/svc_broadband.cgi
@@ -33,6 +33,9 @@ my @fields = (
{ field => 'routernum', value_callback => \&router },
'speed_down',
'speed_up',
+ 'speed_test_down',
+ 'speed_test_up',
+ 'speed_test_latency',
{ field => 'ip_addr', value_callback => \&ip_addr },
{ field => 'sectornum', value_callback => \&sectornum },
{ field => 'mac_addr', type=>'mac_addr', value_callback => \&mac_addr },