summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_bill_pkg.pm5
-rwxr-xr-xFS/FS/part_svc_router.pm3
-rw-r--r--FS/FS/pkg_svc.pm5
-rw-r--r--FS/FS/rate_detail.pm5
-rw-r--r--FS/FS/reg_code_pkg.pm5
-rw-r--r--FS/FS/type_pkgs.pm5
-rwxr-xr-xFS/bin/freeside-setup21
7 files changed, 36 insertions, 13 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 6800707..3478904 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -36,6 +36,8 @@ supported:
=over 4
+=item billpkgnum - primary key
+
=item invnum - invoice (see L<FS::cust_bill>)
=item pkgnum - package (see L<FS::cust_pkg>) or 0 for the special virtual sales tax package
@@ -153,7 +155,8 @@ sub check {
my $self = shift;
my $error =
- $self->ut_number('pkgnum')
+ $self->ut_numbern('billpkgnum')
+ || $self->ut_number('pkgnum')
|| $self->ut_number('invnum')
|| $self->ut_money('setup')
|| $self->ut_money('recur')
diff --git a/FS/FS/part_svc_router.pm b/FS/FS/part_svc_router.pm
index 0b23ab5..df04cc9 100755
--- a/FS/FS/part_svc_router.pm
+++ b/FS/FS/part_svc_router.pm
@@ -13,7 +13,8 @@ sub table { 'part_svc_router'; }
sub check {
my $self = shift;
my $error =
- $self->ut_foreign_key('svcpart', 'part_svc', 'svcpart')
+ $self->ut_numbern('svcrouternum')
+ || $self->ut_foreign_key('svcpart', 'part_svc', 'svcpart')
|| $self->ut_foreign_key('routernum', 'router', 'routernum');
return $error if $error;
''; #no error
diff --git a/FS/FS/pkg_svc.pm b/FS/FS/pkg_svc.pm
index ea52176..065ddbe 100644
--- a/FS/FS/pkg_svc.pm
+++ b/FS/FS/pkg_svc.pm
@@ -39,6 +39,8 @@ FS::Record. The following fields are currently supported:
=over 4
+=item pkgsvcnum - primary key
+
=item pkgpart - Billing item definition (see L<FS::part_pkg>)
=item svcpart - Service definition (see L<FS::part_svc>)
@@ -101,7 +103,8 @@ sub check {
my $error;
$error =
- $self->ut_number('pkgpart')
+ $self->ut_numbern('pkgsvcnum')
+ || $self->ut_number('pkgpart')
|| $self->ut_number('svcpart')
|| $self->ut_number('quantity')
;
diff --git a/FS/FS/rate_detail.pm b/FS/FS/rate_detail.pm
index 313b053..7d54355 100644
--- a/FS/FS/rate_detail.pm
+++ b/FS/FS/rate_detail.pm
@@ -34,6 +34,8 @@ inherits from FS::Record. The following fields are currently supported:
=over 4
+=item ratedetailnum - primary key
+
=item ratenum - rate plan (see L<FS::rate>)
=item orig_regionnum - call origination region
@@ -106,7 +108,8 @@ sub check {
my $self = shift;
my $error =
- $self->ut_foreign_key('ratenum', 'rate', 'ratenum')
+ $self->ut_numbern('ratedetailnum')
+ || $self->ut_foreign_key('ratenum', 'rate', 'ratenum')
|| $self->ut_foreign_keyn('orig_regionnum', 'rate_region', 'regionnum' )
|| $self->ut_foreign_key('dest_regionnum', 'rate_region', 'regionnum' )
|| $self->ut_number('min_included')
diff --git a/FS/FS/reg_code_pkg.pm b/FS/FS/reg_code_pkg.pm
index 598497c..9b9a877 100644
--- a/FS/FS/reg_code_pkg.pm
+++ b/FS/FS/reg_code_pkg.pm
@@ -35,6 +35,8 @@ supported:
=over 4
+=item codepkgnum - primary key
+
=item codenum - registration code (see L<FS::reg_code>)
=item pkgpart - package definition (see L<FS::part_pkg>)
@@ -99,7 +101,8 @@ sub check {
my $self = shift;
my $error =
- $self->ut_foreign_key('codenum', 'reg_code', 'codenum')
+ $self->ut_numbern('codepkgnum')
+ || $self->ut_foreign_key('codenum', 'reg_code', 'codenum')
|| $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart')
;
return $error if $error;
diff --git a/FS/FS/type_pkgs.pm b/FS/FS/type_pkgs.pm
index 07ad2bc..bf34e7c 100644
--- a/FS/FS/type_pkgs.pm
+++ b/FS/FS/type_pkgs.pm
@@ -35,6 +35,8 @@ FS::Record. The following fields are currently supported:
=over 4
+=item typepkgnum - primary key
+
=item typenum - Agent type, see L<FS::agent_type>
=item pkgpart - Billing item definition, see L<FS::part_pkg>
@@ -80,7 +82,8 @@ sub check {
my $self = shift;
my $error =
- $self->ut_number('typenum')
+ $self->ut_numbern('typepkgnum')
+ || $self->ut_number('typenum')
|| $self->ut_number('pkgpart')
;
return $error if $error;
diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup
index 38b9166..30ef205 100755
--- a/FS/bin/freeside-setup
+++ b/FS/bin/freeside-setup
@@ -343,10 +343,11 @@ sub tables_hash_hack {
'type_pkgs' => {
'columns' => [
+ 'typepkgnum', 'serial', '', '',
'typenum', 'int', '', '',
'pkgpart', 'int', '', '',
],
- 'primary_key' => '',
+ 'primary_key' => 'typepkgnum',
'unique' => [ ['typenum', 'pkgpart'] ],
'index' => [ ['typenum'] ],
},
@@ -399,6 +400,7 @@ sub tables_hash_hack {
'cust_bill_pkg' => {
'columns' => [
+ 'billpkgnum', 'serial', '', '',
'pkgnum', 'int', '', '',
'invnum', 'int', '', '',
'setup', @money_type,
@@ -407,7 +409,7 @@ sub tables_hash_hack {
'edate', @date_type,
'itemdesc', 'varchar', 'NULL', $char_d,
],
- 'primary_key' => '',
+ 'primary_key' => 'billpkgnum',
'unique' => [],
'index' => [ ['invnum'] ],
},
@@ -713,12 +715,13 @@ sub tables_hash_hack {
'pkg_svc' => {
'columns' => [
+ 'pkgsvcnum', 'serial', '', '',
'pkgpart', 'int', '', '',
'svcpart', 'int', '', '',
'quantity', 'int', '', '',
'primary_svc','char', 'NULL', 1,
],
- 'primary_key' => '',
+ 'primary_key' => 'pkgsvcnum',
'unique' => [ ['pkgpart', 'svcpart'] ],
'index' => [ ['pkgpart'] ],
},
@@ -1058,10 +1061,11 @@ sub tables_hash_hack {
'part_svc_router' => {
'columns' => [
+ 'svcrouternum', 'serial', '', '',
'svcpart', 'int', '', '',
'routernum', 'int', '', '',
],
- 'primary_key' => '',
+ 'primary_key' => 'svcrouternum',
'unique' => [],
'index' => [],
},
@@ -1108,11 +1112,12 @@ sub tables_hash_hack {
'virtual_field' => {
'columns' => [
+ 'vfieldnum', 'serial', '', '',
'recnum', 'int', '', '',
'vfieldpart', 'int', '', '',
'value', 'varchar', '', 128,
],
- 'primary_key' => '',
+ 'primary_key' => 'vfieldnum',
'unique' => [ [ 'vfieldpart', 'recnum' ] ],
'index' => [],
},
@@ -1179,6 +1184,7 @@ sub tables_hash_hack {
'rate_detail' => {
'columns' => [
+ 'ratedetailnum', 'serial', '', '',
'ratenum', 'int', '', '',
'orig_regionnum', 'int', 'NULL', '',
'dest_regionnum', 'int', '', '',
@@ -1187,7 +1193,7 @@ sub tables_hash_hack {
'sec_granularity', 'int', '', '',
#time period (link to table of periods)?
],
- 'primary_key' => '',
+ 'primary_key' => 'ratedetailnum',
'unique' => [ [ 'ratenum', 'orig_regionnum', 'dest_regionnum' ] ],
'index' => [],
},
@@ -1228,10 +1234,11 @@ sub tables_hash_hack {
'reg_code_pkg' => {
'columns' => [
+ 'codepkgnum', 'serial', '', '',
'codenum', 'int', '', '',
'pkgpart', 'int', '', '',
],
- 'primary_key' => '',
+ 'primary_key' => 'codepkgnum',
'unique' => [ [ 'codenum', 'pkgpart' ] ],
'index' => [ [ 'codenum' ] ],
},