X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages%2Fpackage.html;h=8cae5fdba0dbbd6933eb80b7cf54ced9e60eab94;hp=3b58f9ec0d064f5bc0e0638bca4fede79ab73d09;hb=f424f11eb366fe64f5f7bb42b21745e22537cab1;hpb=93f811c014058da26e734fc621028741b156c5d7
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 3b58f9ec0..8cae5fdba 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -168,8 +168,16 @@
% }
+% if ( $curuser->access_right('Change customer package') and
+% !$cust_pkg->get('cancel') and
+% !$opt{'show_location'}) {
+
+
+ ( <% pkg_change_location_link($cust_pkg) %> )
+ |
+
+% }
% }
-
@@ -184,6 +192,10 @@ my $part_pkg = $opt{'part_pkg'};
my $curuser = $FS::CurrentUser::CurrentUser;
+my $countrydefault = $opt{'countrydefault'} || 'US';
+my $statedefault = $opt{'statedefault'}
+ || ($countrydefault eq 'US' ? 'CA' : '');
+
#subroutines
#false laziness w/status.html
@@ -204,6 +216,19 @@ sub pkg_change_link {
);
}
+sub pkg_change_location_link {
+ my $cust_pkg = shift;
+ my $pkgpart = $cust_pkg->pkgpart;
+ include( '/elements/popup_link-cust_pkg.html',
+ 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;".
+ "address1=;address2=;city=;county=;state=$statedefault;".
+ "zip=;country=$countrydefault",
+ 'label' => 'Change location',
+ 'actionlabel' => 'Change',
+ 'cust_pkg' => $cust_pkg,
+ );
+}
+
sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); }
sub pkg_discount_link {