1 <& /elements/header-popup.html, $title &>
3 <FORM ACTION="process/cust_pkg_detail.html" NAME="DetailForm" ID="DetailForm" METHOD="POST">
5 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
6 <INPUT TYPE="hidden" NAME="detailtype" VALUE="<% $detailtype %>">
8 <TABLE ID="DetailTable" BGCOLOR="#cccccc" BORDER=0 CELLSPACING=1 STYLE="background-color: #cccccc">
10 % if ( $curuser->option('show_pkgnum') ) {
13 <TD ALIGN="right">Package #</TD>
14 <TD BGCOLOR="#ffffff"><% $pkgnum %></TD>
20 <TD ALIGN="right">Package</TD>
21 <TD BGCOLOR="#ffffff"><% $part_pkg->pkg %></TD>
25 <TD ALIGN="right">Comment</TD>
26 <TD BGCOLOR="#ffffff"><% $part_pkg->comment |h %></TD>
30 <TD ALIGN="right">Status</TD>
31 <TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_pkg->statuscolor %>"><B><% ucfirst($cust_pkg->status) %></B></FONT></TD>
35 <TD COLSPAN=2><% ucfirst($name{$detailtype}) %>: </TD>
38 <& elements/detail-table.html,
46 <INPUT TYPE="submit" ID="submit" NAME="submit" VALUE="<% $title %>">
55 'I' => 'Edit customer package invoice details',
56 'C' => 'Edit customer package comments',
60 'I' => 'invoice details',
61 'C' => 'package comments',
64 my $curuser = $FS::CurrentUser::CurrentUser;
66 $cgi->param('detailtype') =~ /^(\w)$/ or die 'illegal detailtype';
69 my $right = $access_right{$detailtype};
71 unless $curuser->access_right($right);
73 $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'illegal pkgnum';
76 my $cust_pkg = qsearchs({
77 'table' => 'cust_pkg',
78 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
79 'hashref' => { 'pkgnum' => $pkgnum },
80 'extra_sql' => ' AND '. $curuser->agentnums_sql,
83 my $part_pkg = $cust_pkg->part_pkg;
85 my @details = map { $_->detail } $cust_pkg->cust_pkg_detail($detailtype);
87 my $title = ( scalar(@details) ? 'Edit ' : 'Add ' ). $name{$detailtype};