X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fchange_pkg.cgi;h=9729c6b5fa5faebdbe8f19a4c8a8d02c849e2155;hb=95cffb2e514c6117fc3eb111581d387b5d0b4e77;hp=1b4a94e81ea74814237c3ebe7272fa9b3c5bea81;hpb=a7d8494c57376bfc493fbaa234b250cc86a79a94;p=freeside.git
diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi
index 1b4a94e81..9729c6b5f 100755
--- a/httemplate/misc/change_pkg.cgi
+++ b/httemplate/misc/change_pkg.cgi
@@ -8,7 +8,7 @@
<% mt('Package') |h %>
-<% ntable('#cccccc') %>
+
<% mt('Current package') |h %> |
@@ -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',
+ } &>
+% }
+
+<& /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;
+
%init>