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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
<% include('/elements/header-popup.html', 'Order new package' ) %>
<LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
<SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
<SCRIPT TYPE="text/javascript">
function enable_order_pkg () {
if ( document.OrderPkgForm.pkgpart.selectedIndex > 0 ) {
document.OrderPkgForm.submit.disabled = false;
} else {
document.OrderPkgForm.submit.disabled = true;
}
}
</SCRIPT>
<% include('/elements/error.html') %>
<FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/quick-cust_pkg.cgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cust_main->custnum %>">
<% ntable("#cccccc", 2) %>
<% include('/elements/tr-select-cust-part_pkg.html',
'curr_value' => $pkgpart,
'classnum' => -1,
'cust_main' => $cust_main,
'onchange' => 'enable_order_pkg',
)
%>
%# false laziness w/edit/quick-charge.html
<TR>
<TH ALIGN="right">Start date </TD>
<TD COLSPAN=6>
<INPUT TYPE = "text"
NAME = "start_date"
SIZE = 32
ID = "start_date_text"
VALUE = "<% $start_date %>"
>
<IMG SRC = "../images/calendar.png"
ID = "start_date_button"
STYLE = "cursor: pointer"
TITLE = "Select date"
>
<FONT SIZE=-1>(leave blank to start immediately)</FONT>
</TD>
</TR>
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "start_date_text",
ifFormat: "%m/%d/%Y",
button: "start_date_button",
align: "BR"
});
</SCRIPT>
% if ( $curuser->access_right('Discount customer package') ) {
<% include('/elements/tr-select-discount.html') %>
% }
% if ( $conf->exists('pkg_referral') ) {
<% include('/elements/tr-select-part_referral.html',
'curr_value' => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum,
'disable_empty' => 1,
'multiple' => $conf->exists('pkg_referral-multiple'),
'colspan' => 7,
)
%>
% }
<% include('/elements/tr-select-cust_location.html',
'cgi' => $cgi,
'cust_main' => $cust_main,
)
%>
</TABLE>
<BR>
<INPUT NAME="submit" TYPE="submit" VALUE="Order Package" <% $pkgpart ? '' : 'DISABLED' %>>
</FORM>
</BODY>
</HTML>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
unless $curuser->access_right('Order customer package');
my $conf = new FS::Conf;
$cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum";
my $custnum = $1;
my $cust_main = qsearchs({
'table' => 'cust_main',
'hashref' => { 'custnum' => $custnum },
'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
});
my $pkgpart = scalar($cgi->param('pkgpart'));
my $format = "%m/%d/%Y %T %z (%Z)"; #false laziness w/REAL_cust_pkg.cgi?
my $start_date = $cust_main->next_bill_date;
$start_date = $start_date ? time2str($format, $start_date) : '';
</%init>
|