4 <FONT SIZE="+1"><B>First package</B></FONT>
5 <% ntable("#cccccc") %>
9 <% include('first_pkg/select-part_pkg.html',
10 'part_pkg' => \@part_pkg,
12 # map { $_ => $opt{$_} } qw( pkgpart_svcpart saved_domsvc )
19 my( $cust_main, %opt ) = @_;
21 # pry the wrong place for this logic. also pretty expensive
23 #false laziness, copied from FS::cust_pkg::order
26 my @agents = $FS::CurrentUser::CurrentUser->agents;
27 if ( scalar(@agents) == 1 ) {
28 # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART
29 $pkgpart = $agents[0]->pkgpart_hashref;
30 $agentnum = $agents[0]->agentnum;
32 #can't know (agent not chosen), so, allow all
35 foreach my $agent ( @agents ) {
36 next if $typenum{$agent->typenum}++;
37 $pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref }
42 my @first_svc = ( 'svc_acct', 'svc_phone' );
45 grep { $_->svcpart(\@first_svc)
46 && ( $pkgpart->{ $_->pkgpart }
48 || ( $agentnum ne 'all' && $agentnum && $_->agentnum
49 && $_->agentnum == $agentnum
53 qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case?