summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm2
-rw-r--r--FS/FS/Schema.pm1
-rw-r--r--FS/FS/part_pkg.pm20
3 files changed, 22 insertions, 1 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 6a151aa80..f5269cd4b 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -3221,7 +3221,7 @@ and customer address. Include units.',
{
'key' => 'cust_pkg-show_fcc_voice_grade_equivalent',
'section' => 'UI',
- 'description' => "Show a field on package definitions for assigning a DS0 equivalency number suitable for use on FCC form 477.",
+ 'description' => "Show fields on package definitions for FCC Form 477 classification",
'type' => 'checkbox',
},
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 7e1243c1b..0b67022fe 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -1716,6 +1716,7 @@ sub tables_hashref {
'credit_weight', 'real', 'NULL', '', '', '',
'agentnum', 'int', 'NULL', '', '', '',
'fcc_ds0s', 'int', 'NULL', '', '', '',
+ 'fcc_voip_class','char', 'NULL', 1, '', '',
'no_auto', 'char', 'NULL', 1, '', '',
'recur_show_zero', 'char', 'NULL', 1, '', '',
'setup_show_zero', 'char', 'NULL', 1, '', '',
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index 1f2c1692f..8aea6f50c 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -103,6 +103,9 @@ inherits from FS::Record. The following fields are currently supported:
=item fcc_ds0s - Optional DS0 equivalency number for FCC form 477
+=item fcc_voip_class - Which column of FCC form 477 part II.B this package
+belongs in.
+
=back
=head1 METHODS
@@ -573,6 +576,7 @@ sub check {
: $self->ut_agentnum_acl('agentnum', \@null_agentnum_right)
)
|| $self->ut_numbern('fcc_ds0s')
+ || $self->ut_numbern('fcc_voip_class')
|| $self->SUPER::check
;
return $error if $error;
@@ -1501,6 +1505,22 @@ sub _upgrade_data { # class method
}
}
+ # set any package with FCC voice lines to the "VoIP with broadband" category
+ # for backward compatibility
+ my $journal = 'part_pkg_fcc_voip_class';
+ if (!FS::upgrade_journal->is_done($journal)) {
+ @part_pkg = qsearch('part_pkg', {
+ fcc_ds0s => { op => '>', value => 0 },
+ fcc_voip_class => ''
+ });
+ foreach my $part_pkg (@part_pkg) {
+ $part_pkg->set(fcc_voip_class => 2);
+ my $error = $part_pkg->replace;
+ die $error if $error;
+ }
+ FS::upgrade_journal->set_done($journal);
+ }
+
}
=item curuser_pkgs_sql