summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xFS/bin/freeside-setup4
-rw-r--r--README.1.5.0pre11
-rwxr-xr-xhttemplate/view/cust_main.cgi16
3 files changed, 11 insertions, 10 deletions
diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup
index 8f3d99fd5..8b7466222 100755
--- a/FS/bin/freeside-setup
+++ b/FS/bin/freeside-setup
@@ -669,7 +669,7 @@ sub tables_hash_hack {
],
'primary_key' => 'pkgpart',
'unique' => [],
- 'index' => [],
+ 'index' => [ [ disabled ], ],
},
# 'part_title' => {
@@ -712,7 +712,7 @@ sub tables_hash_hack {
],
'primary_key' => 'svcpart',
'unique' => [],
- 'index' => [],
+ 'index' => [ [ 'disabled' ] ],
},
'part_svc_column' => {
diff --git a/README.1.5.0pre1 b/README.1.5.0pre1
index 57fc36af6..0de86bce0 100644
--- a/README.1.5.0pre1
+++ b/README.1.5.0pre1
@@ -7,6 +7,7 @@ schema changes:
*** add column cust_main_county.taxname
*** add column cust_bill_pkg.itemdesc
*** drop index cust_bill_pkg1
+ *** add index part_pkg1 and part_svc1
install DBIx::DBSchema 0.21
install NetAddr::IP
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 62e961dfa..6fe759bd9 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -280,14 +280,14 @@ print '<BR>'.
qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!.
'<SELECT NAME="pkgpart"><OPTION> ';
-foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
- my $pkgpart = $type_pkgs->pkgpart;
-# my $part_pkg = qsearchs('part_pkg', { 'pkgpart' => $pkgpart } )
-# or do { warn "unknown type_pkgs.pkgpart $pkgpart"; next; };
- my $part_pkg =
- qsearchs('part_pkg', { 'pkgpart' => $pkgpart, 'disabled' => '' } )
- or next;
- print qq!<OPTION VALUE="$pkgpart">!. $part_pkg->pkg. ' - '.
+foreach my $part_pkg (
+ qsearch( 'part_pkg', { 'disabled' => '' }, '',
+ ' AND 0 < ( SELECT COUNT(*) FROM type_pkgs '.
+ ' WHERE typenum = '. $agent->typenum.
+ ' AND type_pkgs.pkgpart = part_pkg.pkgpart )'
+ )
+) {
+ print '<OPTION VALUE="'. $part_pkg->pkgpart. '">'. $part_pkg->pkg. ' - '.
$part_pkg->comment;
}