blob: d6a24fb322a8ccb6155aa52633879b10df972681 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
<% include('/elements/header-popup.html', "Change Package") %>
<% include('/elements/error.html') %>
<FORM ACTION="<% $p %>edit/process/cust_pkg.cgi" METHOD=POST>
<INPUT TYPE="hidden" NAME="action" VALUE="change">
<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
<INPUT TYPE="hidden" NAME="remove_pkg" VALUE="<% $pkgnum %>">
<% ntable('#cccccc') %>
<TR>
<TD>Current package: </TD>
<TD>
<B><% $part_pkg->pkgpart %>: <% $part_pkg->pkg %> - <% $part_pkg->comment %></B>
</TD>
</TR>
<TR>
<TD>New package: </TD>
<TD><% include('/elements/select-cust-part_pkg.html',
'cust_main' => $cust_main,
'element_name' => 'new_pkgpart',
'extra_sql' => ' AND pkgpart != '. $cust_pkg->pkgpart,
'curr_value' => ( $cgi->param('error')
? scalar($cgi->param('new_pkgpart'))
: ''
),
)
%>
</TD>
</TR>
</TABLE>
<BR>
<INPUT TYPE="submit" VALUE="Change package">
</FORM>
</BODY>
</HTML>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Change customer package');
my $pkgnum;
if ( $cgi->param('error') ) {
$pkgnum = ($cgi->param('remove_pkg'))[0];
} else {
$pkgnum = $cgi->param('pkgnum');
}
$pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum";
$pkgnum = $1;
my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } )
or die "unknown pkgnum $pkgnum";
my $custnum = $cust_pkg->custnum;
my $conf = new FS::Conf;
my $cust_main = $cust_pkg->cust_main
or die "can't get cust_main record for custnum ". $cust_pkg->custnum.
" ( pkgnum ". cust_pkg->pkgnum. ")";
my $agent = $cust_main->agent;
my $part_pkg = $cust_pkg->part_pkg;
</%init>
|