X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_pkg_detail.html;fp=httemplate%2Fedit%2Fcust_pkg_detail.html;h=009ed5c6e34d80cb92f362d76d468754686e6d2d;hb=b96629eb08231f78f334f78c0bd6c277c60844fa;hp=0000000000000000000000000000000000000000;hpb=2c90d42ca355e77804fbd0d4fe158dcdc38392c6;p=freeside.git diff --git a/httemplate/edit/cust_pkg_detail.html b/httemplate/edit/cust_pkg_detail.html new file mode 100644 index 000000000..009ed5c6e --- /dev/null +++ b/httemplate/edit/cust_pkg_detail.html @@ -0,0 +1,142 @@ +<% include("/elements/header-popup.html", $title, '', + ( $cgi->param('error') ? '' : 'onload="addRow()"' ), + ) +%> + +%# <% include('/elements/error.html') %> + +
+ + + + + + +% if ( $curuser->option('show_pkgnum') ) { + + + + + + +% } + + + + + + + + + + + + + + + + + + + + +% my $row = 0; +% for ( @details ) { + + + + + + +% } + +
Package #<% $pkgnum %>
Package<% $part_pkg->pkg %>
Comment<% $part_pkg->comment %>
Status<% ucfirst($cust_pkg->status) %>
<% ucfirst($name{$detailtype}) %>:
+ +
+ +
+ + +
+ + + + + +<%init> + +my %access_right = ( + 'I' => 'Edit customer package invoice details', + 'C' => 'Edit customer package comments', +); + +my %name = ( + 'I' => 'invoice details', + 'C' => 'package comments', +); + +my $curuser = $FS::CurrentUser::CurrentUser; + +$cgi->param('detailtype') =~ /^(\w)$/ or die 'illegal detailtype'; +my $detailtype = $1; + +my $right = $access_right{$detailtype}; +die "access denied" + unless $curuser->access_right($right); + +$cgi->param('pkgnum') =~ /^(\d+)$/ or die 'illegal pkgnum'; +my $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, +}); + +my $part_pkg = $cust_pkg->part_pkg; + +my @details = $cust_pkg->cust_pkg_detail($detailtype); + +my $title = ( scalar(@details) ? 'Edit ' : 'Add ' ). $name{$detailtype}; + +