summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-09-06 11:46:59 -0700
committerMark Wells <mark@freeside.biz>2012-09-06 11:46:59 -0700
commitb7ce9a95a6fa002d0d537c950f11f8a23d3dfc25 (patch)
tree42e304103826c3f7b3157159dc2e850e4f1a8631 /FS
parentfdb87db06d3c62a7f7536d1ed630293da94d959a (diff)
fix 477 part IIB, #18503
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 42432b2a4..667263f9c 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -3301,7 +3301,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 709e9f9c6..ab679c491 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -1911,6 +1911,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 061001bdc..91bcdc5b5 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.
+
=item successor - Foreign key for the part_pkg that replaced this record.
If this record is not obsolete, will be null.
@@ -622,6 +625,7 @@ sub check {
: $self->ut_agentnum_acl('agentnum', \@null_agentnum_right)
)
|| $self->ut_numbern('fcc_ds0s')
+ || $self->ut_numbern('fcc_voip_class')
|| $self->ut_foreign_keyn('successor', 'part_pkg', 'pkgpart')
|| $self->ut_foreign_keyn('family_pkgpart', 'part_pkg', 'pkgpart')
|| $self->SUPER::check
@@ -1592,6 +1596,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