e48bfb8c5cbb98c92422651a8d9d979f05cd6bd6
[freeside.git] / httemplate / view / cust_main / packages.html
1 <A NAME="cust_pkg"><FONT SIZE="+2">Packages</FONT></A>
2 % if ( $curuser->access_right('Order customer package') ) { 
3
4   <% include('order_pkg.html', $cust_main ) %>
5 % } 
6 % if ( $curuser->access_right('One-time charge')
7 %        && $conf->config('payby-default') ne 'HIDE'
8 %      ) {
9 %
10
11   <% include('/elements/popup_link.html',
12      { 
13        'action'      => $p. 'edit/quick-charge.html?custnum='. $cust_main->custnum,
14        'label'       => 'One-time charge',
15        'actionlabel' => 'One-time charge',
16        'width'       => 545,
17      })
18   %>
19   <BR>
20 % } 
21 % if ( $curuser->access_right('Bulk change customer packages') ) { 
22
23   <A HREF="<% $p %>edit/cust_pkg.cgi?<% $cust_main->custnum %>">Bulk order and cancel packages</A> (preserves services)
24 % } 
25
26
27 <BR><BR>
28 % if ( @$packages ) { 
29
30 Current packages
31 % } 
32 % if ( $cust_main->num_cancelled_pkgs ) {
33 %     if ( $cgi->param('showcancelledpackages') eq '0' #see if it was set by me
34 %          || ( $conf->exists('hidecancelledpackages')
35 %               && ! $cgi->param('showcancelledpackages')
36 %             )
37 %        )
38 %     {
39 %       $cgi->param('showcancelledpackages', 1);
40 %
41
42   ( <a href="<% $cgi->self_url %>">show
43 %   } else {
44 %       $cgi->param('showcancelledpackages', 0);
45 %
46
47   ( <a href="<% $cgi->self_url %>">hide
48 %   } 
49
50  cancelled packages</a> )
51 % } 
52 % if ( @$packages ) { 
53
54
55 <% include('/elements/table-grid.html') %>
56 % my $bgcolor1 = '#eeeeee';
57 %   my $bgcolor2 = '#ffffff';
58 %   my $bgcolor = '';
59
60 <TR>
61   <TH CLASS="grid" BGCOLOR="#cccccc">Package</TH>
62   <TH CLASS="grid" BGCOLOR="#cccccc">Status</TH>
63   <TH CLASS="grid" BGCOLOR="#cccccc">Services</TH>
64 </TR>
65
66 %foreach my $cust_pkg (@$packages) {
67 %
68 %  my $part_pkg = $cust_pkg->part_pkg;
69 %
70 %  if ( $bgcolor eq $bgcolor1 ) {
71 %    $bgcolor = $bgcolor2;
72 %  } else {
73 %    $bgcolor = $bgcolor1;
74 %  }
75
76
77 <!--pkgnum: <% $cust_pkg->pkgnum %>-->
78 <TR>
79   <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
80     <A NAME="cust_pkg<% $cust_pkg->pkgnum %>"><% $cust_pkg->pkgnum %></A>:
81     <% $part_pkg->pkg %> - <% $part_pkg->comment %>
82     <BR>
83
84 %   if ( $cust_pkg->quantity > 1 ) {
85         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Quantity: <B><% $cust_pkg->quantity %></B><BR>
86 %   }
87
88     <FONT SIZE=-1>
89 % unless ( $cust_pkg->get('cancel') ) { 
90 % if ( $curuser->access_right('Change customer package') ) { 
91
92             (&nbsp;<%pkg_change_link($cust_pkg)%>&nbsp;)
93 % } 
94 % if ( $curuser->access_right('Edit customer package dates') ) { 
95
96             (&nbsp;<%pkg_dates_link($cust_pkg)%>&nbsp;)
97 % } 
98 % if ( $curuser->access_right('Customize customer package') ) { 
99
100             (&nbsp;<%pkg_customize_link($cust_pkg,$cust_main->custnum)%>&nbsp;)
101 % } 
102 % } 
103
104     </FONT>
105   </TD>
106   <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
107     <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
108 %
109 %  sub myfreq {
110 %    my $part_pkg = shift;
111 %    my $freq = $part_pkg->freq_pretty;
112 %    $freq =~ s/ /&nbsp;/g;
113 %    $freq;
114 %  }
115 %
116 %  #this should use cust_pkg->status and cust_pkg->statuscolor eventually
117 %  #my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4;
118 %  #my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%';
119 %
120 %  #false laziness w/edit/REAL_cust_pkg.cgi
121 %  my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until );
122 %  unless ( $part_pkg->is_prepaid ) {
123 %    $billed_or_prepaid = 'billed';
124 %    $last_bill_or_renewed = 'Last&nbsp;bill';
125 %    $next_bill_or_prepaid_until = 'Next&nbsp;bill';
126 %  } else {
127 %    $billed_or_prepaid = 'prepaid';
128 %    $last_bill_or_renewed = 'Renewed';
129 %    $next_bill_or_prepaid_until = 'Prepaid&nbsp;until';
130 %  }
131 %
132 %
133 % if ( $cust_pkg->get('cancel') ) { #status: cancelled
134 %   my $cpr = $cust_pkg->last_cust_pkg_reason;
135
136     <% pkg_status_row($cust_pkg, 'Cancelled', 'cancel', 'color'=>'FF0000', conf=>$conf ) %>
137
138     <% pkg_status_row_colspan(
139          ( ( $cpr && ( $cpr->date == $cust_pkg->get('cancel') ||
140                        $cpr->date == $cust_pkg->expire
141                      )
142            ) ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '',
143          'align' => 'right', 'color' => 'ff0000', 'size' => '-2',
144        )
145     %>
146
147
148     <% pkg_status_row( $cust_pkg, 'Suspended', 'susp', 'color'=>'FF9900', conf=>$conf ) %>
149
150 %   unless ( $cust_pkg->get('setup') ) { 
151
152         <% pkg_status_row_colspan('Never billed') %>
153
154 %   } else { 
155
156        <% pkg_status_row( $cust_pkg, 'Setup', 'setup', conf=>$conf ) %>
157        <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %>
158        <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf ) %>
159        <% pkg_status_row_if( $cust_pkg, 'Suspended', 'susp', conf=>$conf ) %>
160
161 %   } 
162 %
163 % } else { 
164 %
165 %   if ( $cust_pkg->get('susp') ) { #status: suspended
166 %     my $cpr = $cust_pkg->last_cust_pkg_reason;
167
168     <% pkg_status_row( $cust_pkg, 'Suspended', 'susp', 'color'=>'FF9900', conf=>$conf ) %>
169
170     <% pkg_status_row_colspan(
171          ( ( $cpr && ( $cpr->date == $cust_pkg->susp ||
172                        $cpr->date == $cust_pkg->adjourn
173                      )
174            ) ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '',
175          'align' => 'right', 'color' => 'FF9900', 'size' => '-2',
176        )
177     %>
178
179 %   unless ( $cust_pkg->get('setup') ) { 
180       <% pkg_status_row_colspan('Never billed') %>
181 %   } else { 
182       <% pkg_status_row($cust_pkg, 'Setup', 'setup', conf=>$conf ) %>
183 %   } 
184
185     <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %>
186     <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf ) %>
187 %   # pkg_status_row($cust_pkg, 'Next bill', 'bill', conf=>$conf)
188     <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', conf=>$conf ) %>
189
190     <TR>
191       <TD COLSPAN=<%$colspan%>>
192         <FONT SIZE=-1>
193 %         if ( $curuser->access_right('Unsuspend customer package') ) { 
194             (&nbsp;<% pkg_unsuspend_link($cust_pkg) %>&nbsp;)
195 %         } 
196 %         if ( $curuser->access_right('Cancel customer package immediately') ) {
197             (&nbsp;<% pkg_cancel_link($cust_pkg) %>&nbsp;)
198 %         } 
199         </FONT>
200       </TD>
201     </TR>
202
203 %   } else { #status: active
204 %
205 %     unless ( $cust_pkg->get('setup') ) { #not setup
206 %
207 %       unless ( $part_pkg->freq ) { 
208
209           <% pkg_status_row_colspan('Not&nbsp;yet&nbsp;billed&nbsp;(one-time&nbsp;charge)') %>
210
211           <TR>
212             <TD COLSPAN=<%$colspan%>>
213               <FONT SIZE=-1>
214 %               if ( $curuser->access_right('Cancel customer package immediately') ) { 
215                   (&nbsp;<% pkg_cancel_link($cust_pkg) %>&nbsp;)
216 %               } 
217               </FONT>
218             </TD>
219           </TR>
220
221 %       } else { 
222
223          <% pkg_status_row_colspan("Not&nbsp;yet&nbsp;billed&nbsp;($billed_or_prepaid&nbsp;". myfreq($part_pkg). ')' ) %>
224
225 %       } 
226 %
227 %     } else { #setup
228 %
229 %       unless ( $part_pkg->freq ) { 
230
231           <% pkg_status_row_colspan('One-time&nbsp;charge') %>
232
233           <% pkg_status_row($cust_pkg, 'Billed', 'setup', conf=>$conf) %>
234
235 %       } else { 
236 %
237 %         if (scalar($cust_pkg->overlimit)) {
238
239             <% pkg_status_row_colspan(
240                  'Overlimit',
241                  $billed_or_prepaid. '&nbsp;'. myfreq($part_pkg),
242                  'color' => 'FFD000',
243                )
244             %>
245
246 %         } else {
247             <% pkg_status_row_colspan(
248                  'Active',
249                  $billed_or_prepaid. '&nbsp;'. myfreq($part_pkg),
250                  'color' => '00CC00',
251                )
252             %>
253 %         } 
254
255           <% pkg_status_row($cust_pkg, 'Setup', 'setup', conf=>$conf) %>
256
257 %       } 
258 %
259 %     } 
260
261       <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %>
262       <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf ) %>
263       <% pkg_status_row_if( $cust_pkg, $next_bill_or_prepaid_until, 'bill', conf=>$conf ) %>
264       <% pkg_status_row_if( $cust_pkg, 'Will suspend on', 'adjourn', conf=>$conf ) %>
265       <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', conf=>$conf ) %>
266
267 %     if ( $part_pkg->freq ) { 
268
269         <TR>
270           <TD COLSPAN=<%$colspan%>>
271             <FONT SIZE=-1>
272 %             if ( $curuser->access_right('Suspend customer package') ) { 
273                 (&nbsp;<% pkg_suspend_link($cust_pkg) %>&nbsp;)
274 %             } 
275 %             if ( $curuser->access_right('Suspend customer package later') ) { 
276                 (&nbsp;<% pkg_adjourn_link($cust_pkg) %>&nbsp;)
277 %             } 
278 %             if ( $curuser->access_right('Cancel customer package immediately') ) { 
279                 (&nbsp;<% pkg_cancel_link($cust_pkg) %>&nbsp;)
280 %             } 
281 %             if ( $curuser->access_right('Cancel customer package later') ) { 
282                 (&nbsp;<% pkg_expire_link($cust_pkg) %>&nbsp;)
283 %             } 
284
285             <FONT>
286           </TD>
287         </TR>
288 %     }
289 %
290 %   } 
291 % } 
292
293 </TABLE>
294 </TD>
295
296 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
297   <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
298
299 %  #foreach my $svcpart (sort {$a->{svcpart} <=> $b->{svcpart}} @{$pkg->{svcparts}}) {
300 %  foreach my $part_svc ( $cust_pkg->part_svc ) {
301
302 %    #foreach my $service (@{$svcpart->{services}}) {
303 %    foreach my $cust_svc ( @{ $part_svc->cust_pkg_svc } ) {
304
305       <TR>
306         <TD ALIGN="right" VALIGN="top"><% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %></TD>
307         <TD STYLE="padding-bottom:0px"><B><% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %></B></TD>
308         <TD><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %></TD>
309       </TR>
310
311       <TR>
312         <TD ALIGN="right" COLSPAN="3" VALIGN="top" STYLE="padding-bottom:1px;padding-top:0px"><FONT SIZE="-2" COLOR="#FFD000">
313
314             <% $cust_svc->overlimit ? "Overlimit: ". time2str('%b %o %Y' . ($conf->exists('cust_pkg-display_times') ? ' %l:%M %P' : ''), $cust_svc->overlimit) : '' %>
315           </FONT></TD>
316       </TR>
317
318       <TR>
319         <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px;padding-top:0px"><FONT SIZE="-2">
320
321 %         if ( $curuser->access_right('Recharge customer service')
322 %              && $part_svc->svcdb eq 'svc_acct'
323 %              && (    $cust_svc->svc_x->seconds    ne ''
324 %                   || $cust_svc->svc_x->upbytes    ne ''
325 %                   || $cust_svc->svc_x->downbytes  ne ''
326 %                   || $cust_svc->svc_x->totalbytes ne ''
327 %                 )
328 %         ) { 
329             (&nbsp;<%svc_recharge_link($cust_svc)%>&nbsp;)
330 %         } 
331           </FONT></TD>
332
333           <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px;padding-top:0px"><FONT SIZE="-2">
334
335 %         if ( $curuser->access_right('Unprovision customer service') ) { 
336             (&nbsp;<%svc_unprovision_link($cust_svc)%>&nbsp;)
337 %         } 
338           </FONT></TD>
339         </TR>
340 %   } 
341
342 %   if (    ! $cust_pkg->get('cancel')
343 %        && $curuser->access_right('Provision customer service') 
344 %        && $part_svc->num_avail
345 %      ) {
346
347       <TR>
348         <TD COLSPAN=3 ALIGN="center" STYLE="padding-bottom:4px;padding-top:0px">
349           <B><% svc_provision_link($cust_pkg, $part_svc, $conf, $curuser) %></B>
350         </TD>
351       </TR>
352
353 %   } 
354
355 % } 
356
357 </TABLE>
358 </TD>
359 % } #end display packages
360 %
361
362
363 </TABLE>
364 % } else { 
365
366 <BR>
367 % } 
368 <%init>
369
370 my( $cust_main ) = @_;
371 my $conf = new FS::Conf;
372
373 my $curuser = $FS::CurrentUser::CurrentUser;
374
375 my $packages = get_packages($cust_main, $conf);
376
377 my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4;
378 my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%';
379
380 sub pkg_status_row {
381   my( $cust_pkg, $title, $field, %opt ) = @_;
382
383   my $color = $opt{'color'};
384
385   my $html = qq(<TR><TD WIDTH="<%$width%>" ALIGN="right">);
386   $html   .= qq(<FONT COLOR="#$color"><B>) if length($color);
387   $html   .= qq($title&nbsp;);
388   $html   .= qq(</B></FONT>) if length($color);
389   $html   .= qq(</TD>);
390   $html   .= pkg_datestr($cust_pkg, $field, $opt{conf}).'</TR>';
391
392   $html;
393 }
394
395 sub pkg_status_row_if {
396   my( $cust_pkg, $title, $field, %opt ) = @_;
397   $cust_pkg->get($field) ? pkg_status_row(@_) : '';
398 }
399
400 sub pkg_status_row_changed {
401   my( $cust_pkg, %opt ) = @_;
402   return '' unless $cust_pkg->change_date;
403   my $html = pkg_status_row( $cust_pkg, 'Package&nbsp;changed', 'change_date', conf=>$opt{'conf'} );
404   my $old = $cust_pkg->old_cust_pkg;
405   if ( $old ) {
406     my $part_pkg = $old->part_pkg;
407     my $label = 'Changed from '. $cust_pkg->change_pkgnum. ': '.
408                 $part_pkg->pkg. ' - '. $part_pkg->comment;
409     $html .= pkg_status_row_colspan( $label, '', size=>'-1', align=>'right' );
410   }
411   $html;
412 }
413
414 sub pkg_status_row_colspan {
415   my($title, $addl, %opt) = @_;
416
417   my $align = $opt{'align'} ? 'ALIGN="'. $opt{'align'}.'"' : '';
418   my $color = $opt{'color'} ? 'COLOR="#'.$opt{'color'}.'"' : '';
419   my $size  = $opt{'size'}  ? 'SIZE="'.  $opt{'size'}. '"' : '';
420
421   my $html = qq(<TR><TD COLSPAN=$colspan $align>);
422   $html   .= qq(<FONT $color $size>) if length($color) || $size;
423   $html   .= qq(<B>) if $color && !$size;
424   $html   .= $title;
425   $html   .= qq(</B>) if $color && !$size;
426   $html   .= qq(</FONT>) if length($color) || $size;
427   $html   .= ",&nbsp;$addl" if length($addl);
428   $html   .= qq(</TD></TR>);
429
430   $html;
431
432 }
433
434 #subroutines
435
436 sub get_packages {
437   my $cust_main = shift or return undef;
438   my $conf = shift;
439   
440   my @packages = ();
441   my $method;
442   if (  $cgi->param('showcancelledpackages') eq '0' #see if it was set by me
443      || ( $conf->exists('hidecancelledpackages')
444            && ! $cgi->param('showcancelledpackages') )
445      )
446   {
447     $method = 'ncancelled_pkgs';
448   } else {
449     $method = 'all_pkgs';
450   }
451
452   [ $cust_main->$method() ];
453 }
454   
455 sub svc_provision_link {
456   my ($cust_pkg, $part_svc, $conf, $curuser) = @_;
457   ( my $svc_nbsp = $part_svc->svc ) =~ s/\s+/&nbsp;/g;
458   my $num_avail = $part_svc->num_avail;
459   my $pkgnum_svcpart = "pkgnum=". $cust_pkg->pkgnum. ';'.
460                        "svcpart=". $part_svc->svcpart;
461   my $url;
462   if ( $part_svc->svcdb eq 'svc_external' #could be generalized
463        && $conf->exists('svc_external-skip_manual')
464   ) {
465     $url = "${p}edit/process/". $part_svc->svcdb. ".cgi?$pkgnum_svcpart";
466   } else {
467     $url = svc_url(
468                     'm'        => $m,
469                     'action'   => 'edit',
470                     'part_svc' => $part_svc, 
471                     'query'    => $pkgnum_svcpart,
472                   );
473     #$url = "${p}edit/$svcpart->{svcdb}.cgi?$pkgnum_svcpart";
474   }
475
476   my $link = qq!<A CLASS="provision" HREF="$url">!.
477              "Provision&nbsp;$svc_nbsp&nbsp;($num_avail)</A>";
478   if ( $conf->exists('legacy_link')
479        && $curuser->access_right('View/link unlinked services')
480      )
481   {
482     $link .= '<BR>'.
483              qq!<A CLASS="provision" HREF="${p}misc/link.cgi?!.
484              qq!$pkgnum_svcpart">!.
485             "Link&nbsp;to&nbsp;legacy&nbsp;$svc_nbsp&nbsp;($num_avail)</A>";
486   }
487   $link;
488 }
489
490 sub svc_unprovision_link {
491   my $cust_svc = shift or return '';
492   qq!<A HREF="javascript:areyousure('${p}misc/unprovision.cgi?!. $cust_svc->svcnum.
493   qq!', 'Permanently unprovision and delete this service?')">Unprovision</A>!;
494 }
495
496 sub pkg_datestr {
497   my($cust_pkg, $field, $conf) = @_ or return '';
498   return '&nbsp;' unless $cust_pkg->get($field);
499   my $format = '<TD align="left"><B>%b</B></TD>'.
500                '<TD align="right"><B>&nbsp;%o,</B></TD>'.
501                '<TD align="right"><B>&nbsp;%Y</B></TD>';
502   #$format .= '&nbsp;<FONT SIZE=-3>%l:%M:%S%P&nbsp;%z</FONT>'
503   $format .= '<TD ALIGN="right"><B>&nbsp;%l</TD>'.
504              '<TD ALIGN="center"><B>:</B></TD>'.
505              '<TD ALIGN="left"><B>%M</B></TD>'.
506              '<TD ALIGN="left"><B>&nbsp;%P</B></TD>'
507     if $conf->exists('cust_pkg-display_times');
508   my $strip = time2str($format, $cust_pkg->get($field) );
509   $strip =~ s/ (\d)/$1/g;
510   $strip;
511 }
512
513 sub pkg_change_link { include( '/elements/popup_link-cust_pkg.html',
514                                { 'action'      => $p. 'misc/change_pkg.cgi?dummy=value',
515                                  'label'       => 'Change&nbsp;package',
516                                  'actionlabel' => 'Change',
517                                  'cust_pkg'    => shift,
518                                }
519                              )
520                      }
521
522 sub pkg_suspend_link { include( '/elements/popup_link-cust_pkg.html',
523                                 { 'action'      => $p. 'misc/cancel_pkg.html?method=suspend',
524                                   'label'       => 'Suspend&nbsp;now',
525                                   'actionlabel' => 'Suspend',
526                                   'cust_pkg'    => shift,
527                                 }
528                               )
529                      }
530
531 sub pkg_unsuspend_link { pkg_link('misc/unsusp_pkg',    'Unsuspend',           @_ ); }
532 sub pkg_expire_link    { pkg_link('misc/expire_pkg',    'Cancel&nbsp;later',   @_ ); }
533 sub pkg_dates_link     { pkg_link('edit/REAL_cust_pkg', 'Edit&nbsp;dates',     @_ ); }
534
535 sub pkg_cancel_link { include( '/elements/popup_link-cust_pkg.html',
536                                { 'action'      => $p. 'misc/cancel_pkg.html?method=cancel',
537                                  'label'       => 'Cancel&nbsp;now',
538                                  'actionlabel' => 'Cancel',
539                                  'cust_pkg'    => shift,
540                                }
541                              )
542                     }
543
544 sub pkg_adjourn_link { include( '/elements/popup_link-cust_pkg.html',
545                                 { 'action'      => $p. 'misc/cancel_pkg.html?method=adjourn',
546                                   'label'       => 'Suspend&nbsp;later',
547                                   'actionlabel' => 'Adjourn',
548                                   'cust_pkg'    => shift,
549                                 }
550                               )
551                      }
552
553 sub pkg_expire_link { include( '/elements/popup_link-cust_pkg.html',
554                                { 'action'      => $p. 'misc/cancel_pkg.html?method=expire',
555                                  'label'       => 'Cancel&nbsp;later',
556                                  'actionlabel' => 'Expire',
557                                  'cust_pkg'    => shift,
558                                }
559                              )
560                     }
561
562 sub svc_recharge_link { include( '/elements/popup_link-cust_svc.html',
563                                  { 'action'      => $p. 'misc/recharge_svc.html',
564                                    'label'       => 'Recharge',
565                                    'actionlabel' => 'Recharge',
566                                    'cust_svc'    => shift,
567                                  }
568                                )
569                       }
570
571 sub pkg_link {
572   my($action, $label, $cust_pkg) = @_;
573   return '' unless $cust_pkg;
574   qq!<a href="$p$action.cgi?!. $cust_pkg->pkgnum. qq!">$label</a>!;
575 }
576
577 sub pkg_customize_link {
578   my $cust_pkg = shift or return '';
579   my $custnum = $cust_pkg->custnum;
580   qq!<A HREF="${p}edit/part_pkg.cgi?!.
581     "keywords=$custnum;".
582     "clone=". $cust_pkg->part_pkg->pkgpart. ';'.
583     "pkgnum=". $cust_pkg->pkgnum.
584     qq!">Customize</A>!;
585 }
586
587 </%init>