From 0b07c1da9b37ce82bf505f0a860bb0693cedb264 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Sat, 28 Nov 2015 16:48:35 -0800 Subject: when unholding a package, optionally set it to start on the next bill date, #38921 --- httemplate/misc/unhold_pkg.html | 93 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100755 httemplate/misc/unhold_pkg.html (limited to 'httemplate/misc/unhold_pkg.html') diff --git a/httemplate/misc/unhold_pkg.html b/httemplate/misc/unhold_pkg.html new file mode 100755 index 000000000..0c110b4f9 --- /dev/null +++ b/httemplate/misc/unhold_pkg.html @@ -0,0 +1,93 @@ +<& /elements/header-popup.html, mt($title) &> + +<& /elements/error.html &> + +%# use unsusp_pkg.cgi, the same target as a direct "unsuspend package" link +
+ + +
+<% emt('Start billing [_1]', $part_pkg->pkg_comment(cust_pkg => $cust_pkg)) %> + + + +
+ + + +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" + unless $curuser->access_right('Unsuspend customer package'); + +my $pkgnum; +if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) { + $pkgnum = $1; +} else { + die "illegal query ". $cgi->keywords; +} + +my $conf = new FS::Conf; +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; + +my $title = 'Start billing package'; + +my $cust_pkg = qsearchs({ + table => 'cust_pkg', + addl_from => ' JOIN cust_main USING (custnum) ', + hashref => { 'pkgnum' => $pkgnum }, + extra_sql => ' AND '. $curuser->agentnums_sql, +}) or die "Unknown pkgnum: $pkgnum"; + +my $next_bill_date = $cust_pkg->cust_main->next_bill_date; + +my $part_pkg = $cust_pkg->part_pkg; + +my $when = $cgi->param('when'); # on error +if (!$when) { + if ($next_bill_date) { + $when = 'next_bill_date'; + } else { + $when = 'now'; + } +} + -- cgit v1.2.1