8 #foreach (qsearch('part_pkg', { 'disabled' => '' })) {
9 # $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
10 # $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
12 foreach (qsearch('part_pkg', {} )) {
13 $all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
14 $all_comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
16 $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
17 $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
20 my($custnum, %remove_pkg);
21 if ( $cgi->param('error') ) {
22 $custnum = $cgi->param('custnum');
23 %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg');
25 my($query) = $cgi->keywords;
32 print header("Add/Edit Packages", '');
34 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
36 if $cgi->param('error');
38 print qq!<FORM ACTION="${p1}process/cust_pkg.cgi" METHOD=POST>!;
40 print qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
43 my @cust_pkg = qsearch('cust_pkg',{ 'custnum' => $custnum, 'cancel' => '' } );
47 Current packages - select to remove (services are moved to a new package below)
54 print '<TR>' if $count == 0;
55 my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') );
56 print qq!<TD><INPUT TYPE="checkbox" NAME="remove_pkg" VALUE="$pkgnum"!;
57 print " CHECKED" if $remove_pkg{$pkgnum};
58 print qq!>$pkgnum: $all_pkg{$pkgpart} - $all_comment{$pkgpart}</TD>\n!;
66 print qq!</TABLE><BR><BR>!;
70 Order new packages<BR><BR>
73 my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
74 my $agent = qsearchs('agent',{'agentnum'=> $cust_main->agentnum });
79 foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
81 my($pkgpart)=$type_pkgs->pkgpart;
82 next unless exists $pkg{$pkgpart}; #skip disabled ones
83 print qq!<TR>! if ( $count == 0 );
84 my $value = $cgi->param("pkg$pkgpart") || 0;
87 <INPUT TYPE="text" NAME="pkg$pkgpart" VALUE="$value" SIZE="2" MAXLENGTH="2">
88 $pkgpart: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n
98 unless ( $pkgparts ) {
100 my $typenum = $agent->typenum;
101 my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } );
102 my $atype = $agent_type->atype;
104 (No <a href="${p2}browse/part_pkg.cgi">package definitions</a>, or agent type
105 <a href="${p2}edit/agent_type.cgi?$typenum">$atype</a> not allowed to purchase
112 <P><INPUT TYPE="submit" VALUE="Order">