1 <% include('/elements/header-popup.html', 'Order new package' ) %>
3 <LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
4 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
5 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
6 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
8 <SCRIPT TYPE="text/javascript" SRC="../elements/order_pkg.js"></SCRIPT>
10 <% include('/elements/error.html') %>
12 <FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/quick-cust_pkg.cgi" METHOD="POST">
14 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $cust_main->custnum %>">
16 <% ntable("#cccccc", 2) %>
17 <% include('/elements/tr-select-cust-part_pkg.html',
18 'curr_value' => $pkgpart,
20 'cust_main' => $cust_main,
21 'onchange' => 'enable_order_pkg',
26 <TH ALIGN="right">Start date </TD>
28 <% include('/elements/input-date-field.html',{
29 'name' => 'start_date',
30 'format' => $date_format,
31 'value' => $start_date,
34 <FONT SIZE=-1>(leave blank to start immediately)</FONT>
38 % if ( $cust_main->payby =~ /^(CARD|CHEK)$/ ) {
39 % my $what = lc(FS::payby->shortname($cust_main->payby));
41 <TH ALIGN="right">Disable automatic <% $what %> charge </TH>
42 <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="no_auto" VALUE="Y"></TD>
46 % if ( $curuser->access_right('Discount customer package') ) {
47 <% include('/elements/tr-select-discount.html',
48 'element_etc' => 'DISABLED',
55 % if ( $curuser->access_right('Waive setup fee') ) {
57 <TH ALIGN="right">Waive setup fee </TH>
58 <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="waive_setup" VALUE="Y"></TD>
62 % if ( $conf->exists('pkg_referral') ) {
63 <% include('/elements/tr-select-part_referral.html',
64 'curr_value' => scalar( $cgi->param('refnum') ), #get rid of empty_label first# || $cust_main->refnum,
66 'multiple' => $conf->exists('pkg_referral-multiple'),
72 <% include('/elements/tr-select-cust_location.html',
74 'cust_main' => $cust_main,
79 <TH ALIGN="right">Contract end date </TD>
81 <% include('/elements/input-date-field.html',{
82 'name' => 'contract_end',
83 'format' => $date_format,
92 <% include( '/elements/standardize_locations.html',
93 'form' => "OrderPkgForm",
96 'callback' => 'document.OrderPkgForm.submit();',
101 <INPUT NAME = "submitButton"
103 VALUE = "Order Package"
104 onClick = "this.disabled=true; standardize_new_location();"
105 <% $pkgpart ? '' : 'DISABLED' %>
113 my $curuser = $FS::CurrentUser::CurrentUser;
116 unless $curuser->access_right('Order customer package');
118 my $conf = new FS::Conf;
119 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
121 $cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum";
123 my $cust_main = qsearchs({
124 'table' => 'cust_main',
125 'hashref' => { 'custnum' => $custnum },
126 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
129 my $pkgpart = scalar($cgi->param('pkgpart'));
131 my $format = $date_format. ' %T %z (%Z)'; #false laziness w/REAL_cust_pkg.cgi?
133 if( ! $conf->exists('order_pkg-no_start_date') ) {
134 $start_date = $cust_main->next_bill_date;
135 $start_date = $start_date ? time2str($format, $start_date) : '';