1 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>" VALIGN="top">
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('Discount customer package')
40 % && $part_pkg->can_discount
41 % && ! scalar($cust_pkg->cust_pkg_discount_active)
45 ( <%pkg_discount_link($cust_pkg)%> )
48 % if ( $curuser->access_right('Customize customer package') ) {
50 ( <%pkg_customize_link($cust_pkg,$part_pkg)%> )
53 <% $br ? '<BR>' : '' %>
56 % if ( $cust_pkg->num_cust_event
57 % && ( $curuser->access_right('Billing event reports')
58 % || $curuser->access_right('View customer billing events')
61 ( <%pkg_event_link($cust_pkg)%> )
68 % my $editi = $curuser->access_right('Edit customer package invoice details');
69 % my $editc = $curuser->access_right('Edit customer package comments');
70 % my @cust_pkg_detail = $cust_pkg->cust_pkg_detail;
71 % my @invoice_detail = grep { $_->detailtype eq 'I' } @cust_pkg_detail;
72 % my @comments = grep { $_->detailtype eq 'C' } @cust_pkg_detail;
74 % if ( scalar(@invoice_detail) || scalar(@comments) || $editi || $editc ) {
76 % my $editlink = $p. 'edit/cust_pkg_detail?pkgnum='. $cust_pkg->pkgnum.
81 % if ( @invoice_detail ) {
83 <% include('/elements/table-grid.html') %>
85 <TH BGCOLOR="#dddddd" STYLE="border-bottom: dashed 1px black; padding-bottom: 1px">
88 % if ( $editi && ! $cust_pkg->get('cancel') ) {
89 (<% include('/elements/popup_link.html', {
90 'action' => $editlink. 'I',
92 'actionlabel' => 'Edit invoice details',
101 % foreach my $cust_pkg_detail ( @invoice_detail ) {
103 <TD><FONT SIZE="-1"> - <% $cust_pkg_detail->detail |h %></FONT></TD>
110 % if ( $editi && ! $cust_pkg->get('cancel') ) {
112 ( <% include('/elements/popup_link.html', {
113 'action' => $editlink. 'I',
114 'label' => 'Add invoice details',
115 'actionlabel' => 'Add invoice details',
116 'color' => '#333399',
127 <% include('/elements/table-grid.html') %>
129 <TH BGCOLOR="#dddddd" STYLE="border-bottom: dashed 1px black; padding-bottom: 1px">
133 (<% include('/elements/popup_link.html', {
134 'action' => $editlink. 'C',
136 'actionlabel' => 'Edit comments',
137 'color' => '#333399',
145 % foreach my $cust_pkg_detail ( @comments ) {
147 <TD><FONT SIZE="-1"> - <% $cust_pkg_detail->detail |h %></FONT></TD>
156 ( <% include('/elements/popup_link.html', {
157 'action' => $editlink. 'C',
158 'label' => 'Add comments',
159 'actionlabel' => 'Add comments',
160 'color' => '#333399',
180 my $bgcolor = $opt{'bgcolor'};
181 my $cust_pkg = $opt{'cust_pkg'};
182 my $part_pkg = $opt{'part_pkg'};
184 my $curuser = $FS::CurrentUser::CurrentUser;
188 #false laziness w/status.html
190 my($action, $label, $cust_pkg) = @_;
191 return '' unless $cust_pkg;
192 qq!<a href="$p$action.cgi?!. $cust_pkg->pkgnum. qq!">$label</a>!;
195 sub pkg_change_link {
196 my $cust_pkg = shift;
197 my $locationnum = $cust_pkg->locationnum;
198 include( '/elements/popup_link-cust_pkg.html',
199 'action' => $p. "misc/change_pkg.cgi?locationnum=$locationnum",
200 'label' => 'Change package',
201 'actionlabel' => 'Change',
202 'cust_pkg' => $cust_pkg,
206 sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); }
208 sub pkg_discount_link {
209 my $cust_pkg = shift or return '';
210 #my $part_pkg = shift;
211 #my $custnum = $cust_pkg->custnum;
212 include( '/elements/popup_link-cust_pkg.html',
213 'action' => $p.'edit/cust_pkg_discount.html',
214 'label' => 'Discount',
215 'actionlabel' => 'Discount',
216 'cust_pkg' => $cust_pkg,
221 sub pkg_customize_link {
222 my $cust_pkg = shift or return '';
223 my $part_pkg = shift;
224 my $custnum = $cust_pkg->custnum;
225 qq!<A HREF="${p}edit/part_pkg.cgi?!.
226 "clone=". $part_pkg->pkgpart. ';'.
227 "pkgnum=". $cust_pkg->pkgnum.
233 qq!<a href="${p}search/cust_event.html?pkgnum=!. $cust_pkg->pkgnum. qq!">!.
234 'View package events'.