X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fchange_pkg.cgi;h=243da93089c47b004c819aa0733bc54d840e7da4;hb=929783d1045757abbe5c84ff2439547b0f8eca23;hp=01b283d7a4365739643968d333df2a508ae439e0;hpb=8ef00c68688492b2afa3dde8d3d467f89f238c40;p=freeside.git diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index 01b283d7a..243da9308 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -1,48 +1,124 @@ -<& /elements/header-popup.html, mt("Change Package") &> +<& /elements/header-popup.html, mt($title) &> - <& /elements/error.html &>
@@ -76,4 +152,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>