X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fchange_pkg.cgi;h=b562d24cd9f5b60d4b749b8547904d4e74a867c7;hb=8eeac13d3a8b231efd786eca0555087de5dbb17e;hp=7b08f7b108680bc563e3ea9576d8b54cd49aceae;hpb=468c9e660eb0edb2033f0f8dbb4458f20280082c;p=freeside.git diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index 7b08f7b10..b562d24cd 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -1,49 +1,115 @@ -<& /elements/header-popup.html, mt("Change Package") &> +<& /elements/header-popup.html, mt($title) &> - <& /elements/error.html &>
@@ -77,4 +143,20 @@ my $cust_main = $cust_pkg->cust_main my $part_pkg = $cust_pkg->part_pkg; +my $title = "Change Package"; + +my $use_contract_end = $cust_pkg->get('contract_end') ? 1 : 0; + +# 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 quantity )) { + $cgi->param($_, $change_to->get($_)); + } + if ($use_contract_end) { + $cgi->param('contract_end', $change_to->get('contract_end')); + } + $title = "Edit Scheduled Package Change"; +} %init>