X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fchange_pkg.cgi;h=9729c6b5fa5faebdbe8f19a4c8a8d02c849e2155;hb=37e92c220a54636ebc7900cd59ec6ce56790ede8;hp=ce83480006f99245fdcccfcae566f8a86197fee4;hpb=6db14d0fe65daec3d136edaa33a32a1fb24ba06a;p=freeside.git diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index ce8348000..9729c6b5f 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -8,7 +8,7 @@ <% mt('Package') |h %> -<% ntable('#cccccc') %> + @@ -19,21 +19,33 @@ <& /elements/tr-select-cust-part_pkg.html, 'pre_label' => emt('New'), - 'curr_value' => scalar($cgi->param('pkgpart')), + 'curr_value' => scalar($cgi->param('pkgpart')) || $cust_pkg->pkgpart, 'classnum' => $part_pkg->classnum, 'cust_main' => $cust_main, &> <& /elements/tr-input-pkg-quantity.html, - 'curr_value' => $cust_pkg->quantity + 'curr_value' => scalar($cgi->param('quantity')) || $cust_pkg->quantity &> +% if ($use_contract_end) { + <& /elements/tr-input-date-field.html, { + 'name' => 'contract_end', + 'value' => ($cgi->param('contract_end') || $cust_pkg->get('contract_end')), + 'label' => 'Contract End', + } &> +% } +
<% mt('Current package') |h %>

+<& /elements/table-cust_pkg_usageprice.html, + 'pkgpart' => (scalar($cgi->param('pkgpart')) || $cust_pkg->pkgpart), + 'pkgnum' => ($cust_pkg->change_to_pkgnum || $pkgnum), +&> <% mt('Change') |h %> -<% ntable('#cccccc') %> + + " onClick = "this.disabled=true; standardize_new_location();" - <% scalar($cgi->param('pkgpart')) ? '' : 'DISABLED' %> + <% #scalar($cgi->param('pkgpart')) ? '' : 'DISABLED' %> > @@ -124,6 +174,8 @@ 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); @@ -131,6 +183,19 @@ if ( $cust_pkg->change_to_pkgnum ) { 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"; } + +# Get current values of discounts for selectboxes +my %discount = (setup => undef, recur => undef); +$discount{$_->setuprecur} = $_->discountnum + for qsearch('cust_pkg_discount', { + pkgnum => $cust_pkg->pkgnum, + disabled => '', + }); +$discount{setup} = '-2' if $cust_pkg->waive_setup; +