1 <!-- $Id: cust_pkg.cgi,v 1.6 2002-01-30 14:18:08 ivan Exp $ -->
6 foreach (qsearch('part_pkg', { 'disabled' => '' })) {
7 $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
8 $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
11 my($custnum, %remove_pkg);
12 if ( $cgi->param('error') ) {
13 $custnum = $cgi->param('custnum');
14 %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg');
16 my($query) = $cgi->keywords;
23 print header("Add/Edit Packages", '');
25 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
27 if $cgi->param('error');
29 print qq!<FORM ACTION="${p1}process/cust_pkg.cgi" METHOD=POST>!;
31 print qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
34 my @cust_pkg = qsearch('cust_pkg',{ 'custnum' => $custnum, 'cancel' => '' } );
38 Current packages - select to remove (services are moved to a new package below)
45 print '<TR>' if $count == 0;
46 my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') );
47 print qq!<TD><INPUT TYPE="checkbox" NAME="remove_pkg" VALUE="$pkgnum"!;
48 print " CHECKED" if $remove_pkg{$pkgnum};
49 print qq!>$pkgnum: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n!;
57 print qq!</TABLE><BR><BR>!;
61 Order new packages<BR><BR>
64 my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
65 my $agent = qsearchs('agent',{'agentnum'=> $cust_main->agentnum });
70 foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
72 my($pkgpart)=$type_pkgs->pkgpart;
73 next unless exists $pkg{$pkgpart}; #skip disabled ones
74 print qq!<TR>! if ( $count == 0 );
75 my $value = $cgi->param("pkg$pkgpart") || 0;
78 <INPUT TYPE="text" NAME="pkg$pkgpart" VALUE="$value" SIZE="2" MAXLENGTH="2">
79 $pkgpart: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n
89 unless ( $pkgparts ) {
91 my $typenum = $agent->typenum;
92 my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } );
93 my $atype = $agent_type->atype;
95 (No <a href="${p2}browse/part_pkg.cgi">package definitions</a>, or agent type
96 <a href="${p2}edit/agent_type.cgi?$typenum">$atype</a> not allowed to purchase
103 <P><INPUT TYPE="submit" VALUE="Order">