X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fchange_pkg.cgi;h=e3ef4b7a85ed6bffd60194ed3ebde527151f9aec;hb=a2c196921e984b7f1784fbb41c96a053ef68c9ee;hp=8f0067d2d19254805a2c4c79bb54ab6d5da746a1;hpb=990ffbe494523af17f1a3551a020e306ad9f8d7a;p=freeside.git diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index 8f0067d2d..e3ef4b7a8 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -1,52 +1,114 @@ -<% include('/elements/header-popup.html', "Change Package") %> +<& /elements/header-popup.html, mt($title) &> - -<% include('/elements/error.html') %> +<& /elements/error.html &>
@@ -80,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>