1 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
2 <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
5 <A NAME="cust_pkg<% $cust_pkg->pkgnum %>"
6 ID ="cust_pkg<% $cust_pkg->pkgnum %>"
7 ><% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B></A>
9 <% $part_pkg->custom_comment |h %>
13 % if ( $cust_pkg->quantity > 1 ) {
16 Quantity:
17 <B><% $cust_pkg->quantity %></B>
26 % unless ( $cust_pkg->get('cancel') ) {
29 % if ( $curuser->access_right('Change customer package') ) {
31 ( <%pkg_change_link($cust_pkg)%> )
34 % if ( $curuser->access_right('Edit customer package dates') ) {
36 ( <%pkg_dates_link($cust_pkg)%> )
39 % if ( $curuser->access_right('Customize customer package') ) {
41 ( <%pkg_customize_link($cust_pkg,$part_pkg)%> )
44 <% $br ? '<BR>' : '' %>
47 % if ( $cust_pkg->num_cust_event
48 % && ( $curuser->access_right('Billing event reports')
49 % || $curuser->access_right('View customer billing events')
52 ( <%pkg_event_link($cust_pkg)%> )
59 % my $editi = $curuser->access_right('Edit customer package invoice details');
60 % my $editc = $curuser->access_right('Edit customer package comments');
61 % my @cust_pkg_detail = $cust_pkg->cust_pkg_detail;
62 % my @invoice_detail = grep { $_->detailtype eq 'I' } @cust_pkg_detail;
63 % my @comments = grep { $_->detailtype eq 'C' } @cust_pkg_detail;
65 % if ( scalar(@invoice_detail) || scalar(@comments) || $editi || $editc ) {
67 % my $editlink = $p. 'edit/cust_pkg_detail?pkgnum='. $cust_pkg->pkgnum.
72 % if ( @invoice_detail ) {
74 <% include('/elements/table-grid.html') %>
76 <TH BGCOLOR="#dddddd" STYLE="border-bottom: dashed 1px black; padding-bottom: 1px">
79 % if ( $editi && ! $cust_pkg->get('cancel') ) {
80 (<% include('/elements/popup_link.html', {
81 'action' => $editlink. 'I',
83 'actionlabel' => 'Edit invoice details',
92 % foreach my $cust_pkg_detail ( @invoice_detail ) {
94 <TD><FONT SIZE="-1"> - <% $cust_pkg_detail->detail |h %></FONT></TD>
101 % if ( $editi && ! $cust_pkg->get('cancel') ) {
103 ( <% include('/elements/popup_link.html', {
104 'action' => $editlink. 'I',
105 'label' => 'Add invoice details',
106 'actionlabel' => 'Add invoice details',
107 'color' => '#333399',
118 <% include('/elements/table-grid.html') %>
120 <TH BGCOLOR="#dddddd" STYLE="border-bottom: dashed 1px black; padding-bottom: 1px">
124 (<% include('/elements/popup_link.html', {
125 'action' => $editlink. 'C',
127 'actionlabel' => 'Edit comments',
128 'color' => '#333399',
136 % foreach my $cust_pkg_detail ( @comments ) {
138 <TD><FONT SIZE="-1"> - <% $cust_pkg_detail->detail |h %></FONT></TD>
147 ( <% include('/elements/popup_link.html', {
148 'action' => $editlink. 'C',
149 'label' => 'Add comments',
150 'actionlabel' => 'Add comments',
151 'color' => '#333399',
171 my $bgcolor = $opt{'bgcolor'};
172 my $cust_pkg = $opt{'cust_pkg'};
173 my $part_pkg = $opt{'part_pkg'};
175 my $curuser = $FS::CurrentUser::CurrentUser;
179 #false laziness w/status.html
181 my($action, $label, $cust_pkg) = @_;
182 return '' unless $cust_pkg;
183 qq!<a href="$p$action.cgi?!. $cust_pkg->pkgnum. qq!">$label</a>!;
186 sub pkg_change_link {
187 my $cust_pkg = shift;
188 my $locationnum = $cust_pkg->locationnum;
189 include( '/elements/popup_link-cust_pkg.html',
190 'action' => $p. "misc/change_pkg.cgi?locationnum=$locationnum",
191 'label' => 'Change package',
192 'actionlabel' => 'Change',
193 'cust_pkg' => $cust_pkg,
197 sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); }
199 sub pkg_customize_link {
200 my $cust_pkg = shift or return '';
201 my $part_pkg = shift;
202 my $custnum = $cust_pkg->custnum;
203 qq!<A HREF="${p}edit/part_pkg.cgi?!.
204 "clone=". $part_pkg->pkgpart. ';'.
205 "pkgnum=". $cust_pkg->pkgnum.
211 qq!<a href="${p}search/cust_event.html?pkgnum=!. $cust_pkg->pkgnum. qq!">!.
212 'View package events'.