X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fdetach_pkg.html;fp=httemplate%2Fmisc%2Fdetach_pkg.html;h=64b3e6e3f79650f4a689618e06efdf7e17c2a96f;hb=51d26d73eb99d9f7f45591fa6a4b99c3a3429565;hp=0000000000000000000000000000000000000000;hpb=78710489c60a996222b4d37552f78f1ff0ec138f;p=freeside.git diff --git a/httemplate/misc/detach_pkg.html b/httemplate/misc/detach_pkg.html new file mode 100755 index 000000000..64b3e6e3f --- /dev/null +++ b/httemplate/misc/detach_pkg.html @@ -0,0 +1,104 @@ +<& /elements/header-popup.html, mt("Detach Package to New Customer") &> + + + +<& /elements/error.html &> + +
+ +% foreach my $f (qw( agentnum refnum )) { + +% } + +% foreach my $f (FS::cust_main->location_fields) { + +% } + +<% ntable('#cccccc') %> + + + <% mt('Package') |h %> + + <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><% $part_pkg->pkg |h %> - <% $part_pkg->comment |h %> + + + +% #always should be present for detaching, yes? #if ( $cust_pkg->contactnum ) { +% my $cust_contact = $cust_pkg->contact_obj; + + + + + + <% mt('Name') %> + + <% $cust_pkg->contact_obj->line |h %> + + +% #} + + + <% mt('Address') %> + + + <% $loc->location_label( 'join_string' => '
', + 'double_space' => '   ', + 'escape_function' => \&encode_entities, + 'countrydefault' => $countrydefault, + ) + %> + + + + + +%#XXX payment info +%#XXX should be sticky on errors... +<& /edit/cust_main/billing.html, FS::cust_main->new({}), + invoicing_list => [], + +&> + +
+
+" +> + +%#and a cancel button? or is the popup close sufficient? + +
+ + + +<%init> + +my $conf = new FS::Conf; +my $countrydefault = $conf->config('countrydefault') || 'US'; + +my $curuser = $FS::CurrentUser::CurrentUser; +die "access denied" + unless $curuser->access_right('Change customer package'); + +my $pkgnum = scalar($cgi->param('pkgnum')); +$pkgnum =~ /^(\d+)$/ or die "illegal pkgnum $pkgnum"; +$pkgnum = $1; + +my $cust_pkg = + qsearchs({ + 'table' => 'cust_pkg', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'pkgnum' => $pkgnum }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, + }) or die "unknown pkgnum $pkgnum"; + +my $loc = $cust_pkg->cust_location_or_main; + +my $cust_main = $cust_pkg->cust_main + or die "can't get cust_main record for custnum ". $cust_pkg->custnum. + " ( pkgnum ". cust_pkg->pkgnum. ")"; + +my $part_pkg = $cust_pkg->part_pkg; + +