X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fchange_pkg.cgi;h=e3ef4b7a85ed6bffd60194ed3ebde527151f9aec;hb=b9c9835fc3a990958b21bed560f1ff758735add0;hp=03e336cba070460d339b7d34626ddab0c5ebe1a0;hpb=a65d16767bcaa1077be0f41568a4349c9db18990;p=freeside.git diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index 03e336cba..e3ef4b7a8 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -1,46 +1,114 @@ -<& /elements/header-popup.html, mt("Change Package") &> +<& /elements/header-popup.html, mt($title) &> - <& /elements/error.html &>
@@ -74,4 +142,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>