<%doc> Example: include( '/elements/select-cust-part_pkg.html', #required 'cust_main' => $cust_main, #or 'custnum' ? #strongly recommended (you want your forms to be "sticky" on errors, right?) 'curr_value' => 'current_value', #opt 'part_pkg' => \@records, #select-table.html options ) <% include( '/elements/select-part_pkg.html', 'empty_label' => 'Select package', #? need here in case removed #from select-part_pkg ?? %opt, ) %> <%init> my( %opt ) = @_; my $cust_main = $opt{'cust_main'} or die "cust_main not specified"; $opt{'extra_sql'} .= ' AND '. FS::part_pkg->agent_pkgs_sql( $cust_main->agent ); # ' AND ( agentnum IS NOT NULL '. # ' OR 0 < ( SELECT COUNT(*) FROM type_pkgs '. # ' WHERE typenum = '. $cust_main->agent->typenum. # ' AND type_pkgs.pkgpart = part_pkg.pkgpart )'. # ' )';