<& /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; <% emt('Name') %> <% $cust_pkg->contact_obj->line |h %> % #} <% emt('Address') %> <% $loc->location_label( 'join_string' => '
', 'double_space' => '   ', 'escape_function' => \&encode_entities, 'countrydefault' => $countrydefault, ) %> % if ( $conf->config_bool('cust_main-require_phone') ) { % #XXX should be sticky on errors % my $ph_cust_main = FS::cust_main->new({}); % foreach my $contact_phone ( $cust_contact->contact_phone ) { % my $t = $contact_phone->typename; % #countrycodes? interface doesn't parse/take em yet % $ph_cust_main->daytime( $contact_phone->phonenum ) if $t eq 'Work'; % $ph_cust_main->night( $contact_phone->phonenum ) if $t eq 'Home'; % $ph_cust_main->mobile( $contact_phone->phonenum ) if $t eq 'Mobile'; % $ph_cust_main->fax( $contact_phone->phonenum ) if $t eq 'Fax'; % } <& /elements/tr-cust_main-phones.html, 'cust_main' => $ph_cust_main, &> % } %#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;