5 foreach (qsearch('part_pkg', { 'disabled' => '' })) {
6 $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
7 $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
10 my($custnum, %remove_pkg);
11 if ( $cgi->param('error') ) {
12 $custnum = $cgi->param('custnum');
13 %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg');
15 my($query) = $cgi->keywords;
22 print header("Add/Edit Packages", '');
24 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
26 if $cgi->param('error');
28 print qq!<FORM ACTION="${p1}process/cust_pkg.cgi" METHOD=POST>!;
30 print qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
33 my @cust_pkg = qsearch('cust_pkg',{ 'custnum' => $custnum, 'cancel' => '' } );
37 Current packages - select to remove (services are moved to a new package below)
44 print '<TR>' if $count == 0;
45 my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') );
46 print qq!<TD><INPUT TYPE="checkbox" NAME="remove_pkg" VALUE="$pkgnum"!;
47 print " CHECKED" if $remove_pkg{$pkgnum};
48 print qq!>$pkgnum: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n!;
56 print qq!</TABLE><BR><BR>!;
60 Order new packages<BR><BR>
63 my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
64 my $agent = qsearchs('agent',{'agentnum'=> $cust_main->agentnum });
69 foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
71 my($pkgpart)=$type_pkgs->pkgpart;
72 next unless exists $pkg{$pkgpart}; #skip disabled ones
73 print qq!<TR>! if ( $count == 0 );
74 my $value = $cgi->param("pkg$pkgpart") || 0;
77 <INPUT TYPE="text" NAME="pkg$pkgpart" VALUE="$value" SIZE="2" MAXLENGTH="2">
78 $pkgpart: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n
88 unless ( $pkgparts ) {
90 my $typenum = $agent->typenum;
91 my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } );
92 my $atype = $agent_type->atype;
94 (No <a href="${p2}browse/part_pkg.cgi">package definitions</a>, or agent type
95 <a href="${p2}edit/agent_type.cgi?$typenum">$atype</a> not allowed to purchase
102 <P><INPUT TYPE="submit" VALUE="Order">