diff options
author | Mark Wells <mark@freeside.biz> | 2013-07-15 18:37:26 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-07-15 18:37:26 -0700 |
commit | 2c62268f304f1ec6e8baf89043eb1bd1197bb9a6 (patch) | |
tree | 0be3cca186ab9b682181555c8602b1be30d2e670 /httemplate/misc/change_pkg.cgi | |
parent | 53fbfad948c15a03e1939e3b81e2b5fca5796015 (diff) |
future package change, #20687
Diffstat (limited to 'httemplate/misc/change_pkg.cgi')
-rwxr-xr-x | httemplate/misc/change_pkg.cgi | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index 03e336cba..7425fbfaf 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -1,7 +1,6 @@ -<& /elements/header-popup.html, mt("Change Package") &> +<& /elements/header-popup.html, mt($title) &> <SCRIPT TYPE="text/javascript" SRC="../elements/order_pkg.js"></SCRIPT> - <& /elements/error.html &> <FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST> @@ -30,6 +29,21 @@ </TABLE> +<TABLE> + <TR> + <TD> Apply this change: </TD> + <TD> <INPUT TYPE="radio" NAME="delay" VALUE="0" \ + <% !$cgi->param('delay') ? 'CHECKED' : '' %>> now </TD> + <TD> <INPUT TYPE="radio" NAME="delay" VALUE="1" \ + <% $cgi->param('delay') ? 'CHECKED' : '' %>> in the future + <& /elements/input-date-field.html, { + 'name' => 'start_date', + 'value' => ($cgi->param('start_date') || $cust_main->next_bill_date), + } &> + </TD> + </TR> +</TABLE> + <& /elements/standardize_locations.html, 'form' => "OrderPkgForm", 'callback' => 'document.OrderPkgForm.submit();', @@ -74,4 +88,15 @@ my $cust_main = $cust_pkg->cust_main my $part_pkg = $cust_pkg->part_pkg; +my $title = "Change Package"; + +# if there's already a package change ordered, preload it +if ( $cust_pkg->change_to_pkgnum ) { + my $change_to = FS::cust_pkg->by_key($cust_pkg->change_to_pkgnum); + $cgi->param('delay', 1); + foreach(qw( start_date pkgpart locationnum )) { + $cgi->param($_, $change_to->get($_)); + } + $title = "Edit Scheduled Package Change"; +} </%init> |