1 <& /elements/header-popup.html, mt($title) &>
3 <& /elements/error.html &>
5 %# use unsusp_pkg.cgi, the same target as a direct "unsuspend package" link
6 <FORM NAME="UnholdForm" ACTION="process/unhold_pkg.html" METHOD=POST>
7 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
10 <% emt('Start billing [_1]', $part_pkg->pkg_comment(cust_pkg => $cust_pkg)) %>
11 <UL STYLE="padding-left: 3ex; list-style: none; background-color: #cccccc">
13 <& /elements/radio.html,
19 <label for="when_now"><% emt('Immediately') %></label>
21 % if ( $next_bill_date ) {
23 <& /elements/radio.html,
25 id => 'when_next_bill_date',
26 value => 'next_bill_date',
29 <label for="when_next_bill_date">
30 <% emt('On the next bill date: [_1]',
31 time2str($date_format, $next_bill_date) ) %>
36 <& /elements/radio.html,
42 <label for="when_date"> <% emt('On this date:') %> </label>
43 <& /elements/input-date-field.html,
44 { name => 'start_date',
45 value => scalar($cgi->param('start_date')),
50 <INPUT TYPE="submit" NAME="submit" VALUE="<% emt('Start billing') %>">
58 my $curuser = $FS::CurrentUser::CurrentUser;
60 unless $curuser->access_right('Unsuspend customer package');
63 if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
66 die "illegal query ". $cgi->keywords;
69 my $conf = new FS::Conf;
70 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
72 my $title = 'Start billing package';
74 my $cust_pkg = qsearchs({
76 addl_from => ' JOIN cust_main USING (custnum) ',
77 hashref => { 'pkgnum' => $pkgnum },
78 extra_sql => ' AND '. $curuser->agentnums_sql,
79 }) or die "Unknown pkgnum: $pkgnum";
81 my $next_bill_date = $cust_pkg->cust_main->next_bill_date;
83 my $part_pkg = $cust_pkg->part_pkg;
85 my $when = $cgi->param('when'); # on error
87 if ($next_bill_date) {
88 $when = 'next_bill_date';