1 <A NAME="cust_pkg"><FONT SIZE="+2">Packages</FONT></A><BR>
3 % if ( $curuser->access_right('One-time charge') ) {
5 <SCRIPT TYPE="text/javascript">
7 function taxproductmagic(which) {
9 var elements = which.form.elements;
10 for (var i = 0; i<elements.length; i++) {
11 if (elements[i].name == 'taxproductnum'){
12 document.getElementById('taxproductnum').value = elements[i].value;
15 if (elements[i].name == 'taxproductnum_description'){
18 if (str.length){str += ';';}
19 str += elements[i].name + '=' + escape(elements[i].value);
21 document.getElementById('charge_storage').value = str;
23 overlib( OLiframeContent('<% $p %>/browse/part_pkg_taxproduct.cgi?_type=select&id=taxproductnum&onclick=taxproductquickchargemagic&taxproductnum='+document.getElementById('taxproductnum').value, 1000, 400, 'tax_product_popup'), CAPTION, 'Select product', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK);
26 function taxproductquickchargemagic() {
27 var str = document.getElementById('charge_storage').value;
28 if (str.length){str += ';';}
29 str += 'magic=taxproductnum;taxproductnum=';
30 str += escape(document.getElementById('taxproductnum').value);
32 overlib( OLiframeContent('<% $p %>/edit/quick-charge.html?'+str, 545, 336, 'One-time charge'), CAPTION, 'One-time charge', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '#333399', CGCOLOR, '#333399', CLOSETEXT, 'Close');
36 function taxoverridemagic(which) {
38 var elements = which.ownerDocument.QuickChargeForm.elements;
39 for (var i = 0; i<elements.length; i++) {
40 if (elements[i].name == 'tax_override'){
41 document.getElementById('tax_override').value = elements[i].value;
44 if (str.length){str += ';';}
45 str += elements[i].name + '=' + escape(elements[i].value);
47 document.getElementById('charge_storage').value = str;
49 overlib( OLiframeContent('<% $p %>/edit/part_pkg_taxoverride.html?element_name=tax_override;onclick=taxoverridequickchargemagic;selected='+document.getElementById('tax_override').value, 1100, 600, 'tax_product_popup'), CAPTION, 'Edit product tax overrides', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK);
52 function taxoverridequickchargemagic() {
53 var str = document.getElementById('charge_storage').value;
54 if (str.length){str += ';';}
55 str += 'magic=taxoverride;tax_override=';
56 str += document.getElementById('tax_override').value;
58 overlib( OLiframeContent('<% $p %>/edit/quick-charge.html?'+str, 545, 336, 'One-time charge'), CAPTION, 'One-time charge', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '#333399', CGCOLOR, '#333399', CLOSETEXT, 'Close');
63 <FORM NAME='quickcharge'>
64 <INPUT NAME="taxproductnum" ID="taxproductnum" TYPE="hidden">
65 <INPUT NAME="tax_override" ID="tax_override" TYPE="hidden">
66 <INPUT NAME="charge_storage" ID="charge_storage" TYPE="hidden">
67 <INPUT NAME="taxproductnum_description" ID="taxproductnum_description" TYPE="hidden">
72 % if ( $curuser->access_right('Order customer package') ) {
73 <% $s++ ? ' | ' : '' %>
74 <% order_pkg_link($cust_main) %>
77 % if ( $curuser->access_right('One-time charge')
78 % && $conf->config('payby-default') ne 'HIDE'
81 <% $s++ ? ' | ' : '' %>
82 <% include('/elements/popup_link.html',
84 'action' => $p. 'edit/quick-charge.html?custnum='. $cust_main->custnum,
85 'label' => 'One-time charge',
86 'actionlabel' => 'One-time charge',
93 % if ( $curuser->access_right('Bulk change customer packages') ) {
94 <% $s++ ? ' | ' : '' %>
95 <A HREF="<% $p %>edit/cust_pkg.cgi?<% $cust_main->custnum %>">Bulk order and cancel packages</A> (preserves services)
100 % if ( @$packages ) {
104 % if ( $cust_main->num_cancelled_pkgs ) {
105 % if ( $cgi->param('showcancelledpackages') eq '0' #see if it was set by me
106 % || ( $conf->exists('hidecancelledpackages')
107 % && ! $cgi->param('showcancelledpackages')
111 % $cgi->param('showcancelledpackages', 1);
114 ( <a href="<% $cgi->self_url %>">show
116 % $cgi->param('showcancelledpackages', 0);
119 ( <a href="<% $cgi->self_url %>">hide
122 cancelled packages</a> )
124 % if ( @$packages ) {
127 <% include('/elements/table-grid.html') %>
128 % my $bgcolor1 = '#eeeeee';
129 % my $bgcolor2 = '#ffffff';
133 <TH CLASS="grid" BGCOLOR="#cccccc">Package</TH>
134 <TH CLASS="grid" BGCOLOR="#cccccc">Status</TH>
135 <TH CLASS="grid" BGCOLOR="#cccccc">Services</TH>
138 %foreach my $cust_pkg (@$packages) {
140 % my $part_pkg = $cust_pkg->part_pkg;
142 % if ( $bgcolor eq $bgcolor1 ) {
143 % $bgcolor = $bgcolor2;
145 % $bgcolor = $bgcolor1;
149 <!--pkgnum: <% $cust_pkg->pkgnum %>-->
152 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
153 <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
156 <A NAME="cust_pkg<% $cust_pkg->pkgnum %>"
157 ID ="cust_pkg<% $cust_pkg->pkgnum %>"
158 ><% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><% $part_pkg->pkg %></A>
160 <% $part_pkg->comment %>
164 % if ( $cust_pkg->quantity > 1 ) {
167 Quantity:
168 <B><% $cust_pkg->quantity %></B>
178 % unless ( $cust_pkg->get('cancel') ) {
180 % if ( $curuser->access_right('Change customer package') ) { $br=1;
182 ( <%pkg_change_link($cust_pkg)%> )
184 % if ( $curuser->access_right('Edit customer package dates') ) { $br=1;
186 ( <%pkg_dates_link($cust_pkg)%> )
188 % if ( $curuser->access_right('Customize customer package') ) { $br=1;
190 ( <%pkg_customize_link($cust_pkg,$cust_main->custnum)%> )
192 <% $br ? '<BR>' : '' %>
195 % if ( $cust_pkg->num_cust_event
196 % && ( $curuser->access_right('Billing event reports')
197 % || $curuser->access_right('View customer billing events')
200 ( <%pkg_event_link($cust_pkg)%> )
208 % my $editi = $curuser->access_right('Edit customer package invoice details');
209 % my $editc = $curuser->access_right('Edit customer package comments');
211 % if ( $cust_pkg->cust_pkg_detail('I') || $cust_pkg->cust_pkg_detail('C')
212 % || $editi || $editc ) {
214 % my $editlink = $p. 'edit/cust_pkg_detail?pkgnum='. $cust_pkg->pkgnum.
219 % if ( $cust_pkg->cust_pkg_detail('I') ) {
221 <% include('/elements/table-grid.html') %>
223 <TH BGCOLOR="#dddddd" STYLE="border-bottom: dashed 1px black; padding-bottom: 1px">
226 % if ( $editi && ! $cust_pkg->get('cancel') ) {
227 (<% include('/elements/popup_link.html', {
228 'action' => $editlink. 'I',
230 'actionlabel' => 'Edit invoice details',
231 'color' => '#333399',
239 % foreach my $cust_pkg_detail ( $cust_pkg->cust_pkg_detail('I') ) {
241 <TD><FONT SIZE="-1"> - <% $cust_pkg_detail->detail |h %></FONT></TD>
248 % if ( $editi && ! $cust_pkg->get('cancel') ) {
250 ( <% include('/elements/popup_link.html', {
251 'action' => $editlink. 'I',
252 'label' => 'Add invoice details',
253 'actionlabel' => 'Add invoice details',
254 'color' => '#333399',
263 % if ( $cust_pkg->cust_pkg_detail('C') ) {
265 <% include('/elements/table-grid.html') %>
267 <TH BGCOLOR="#dddddd" STYLE="border-bottom: dashed 1px black; padding-bottom: 1px">
271 (<% include('/elements/popup_link.html', {
272 'action' => $editlink. 'C',
274 'actionlabel' => 'Edit comments',
275 'color' => '#333399',
283 % foreach my $cust_pkg_detail ( $cust_pkg->cust_pkg_detail('C') ) {
285 <TD><FONT SIZE="-1"> - <% $cust_pkg_detail->detail |h %></FONT></TD>
294 ( <% include('/elements/popup_link.html', {
295 'action' => $editlink. 'C',
296 'label' => 'Add comments',
297 'actionlabel' => 'Add comments',
298 'color' => '#333399',
314 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
315 <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
318 % my $part_pkg = shift;
319 % my $freq = $part_pkg->freq_pretty;
320 % $freq =~ s/ / /g;
324 % #this should use cust_pkg->status and cust_pkg->statuscolor eventually
325 % #my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4;
326 % #my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%';
328 % #false laziness w/edit/REAL_cust_pkg.cgi
329 % my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until );
330 % unless ( $part_pkg->is_prepaid ) {
331 % $billed_or_prepaid = 'billed';
332 % $last_bill_or_renewed = 'Last bill';
333 % $next_bill_or_prepaid_until = 'Next bill';
335 % $billed_or_prepaid = 'prepaid';
336 % $last_bill_or_renewed = 'Renewed';
337 % $next_bill_or_prepaid_until = 'Prepaid until';
341 % if ( $cust_pkg->get('cancel') ) { #status: cancelled
342 % my $cpr = $cust_pkg->last_cust_pkg_reason('cancel');
344 <% pkg_status_row($cust_pkg, 'Cancelled', 'cancel', 'color'=>'FF0000', conf=>$conf ) %>
346 <% pkg_status_row_colspan(
347 ( $cpr ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '',
348 'align' => 'right', 'color' => 'ff0000', 'size' => '-2',
352 % unless ( $cust_pkg->get('setup') ) {
354 <% pkg_status_row_colspan('Never billed') %>
358 <% pkg_status_row( $cust_pkg, 'Setup', 'setup', conf=>$conf ) %>
359 <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %>
360 <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf, curuser=>$curuser ) %>
361 <% pkg_status_row_if( $cust_pkg, 'Suspended', 'susp', conf=>$conf, curuser=>$curuser ) %>
367 % if ( $cust_pkg->get('susp') ) { #status: suspended
368 % my $cpr = $cust_pkg->last_cust_pkg_reason('susp');
370 <% pkg_status_row( $cust_pkg, 'Suspended', 'susp', 'color'=>'FF9900', conf=>$conf ) %>
372 <% pkg_status_row_colspan(
373 ( $cpr ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '',
374 'align' => 'right', 'color' => 'FF9900', 'size' => '-2',
378 % unless ( $cust_pkg->get('setup') ) {
379 <% pkg_status_row_colspan('Never billed') %>
381 <% pkg_status_row($cust_pkg, 'Setup', 'setup', conf=>$conf ) %>
384 <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %>
385 <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf, curuser=>$curuser ) %>
386 % # pkg_status_row($cust_pkg, 'Next bill', 'bill', conf=>$conf)
387 <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', conf=>$conf, curuser=>$curuser ) %>
390 <TD COLSPAN=<%$colspan%>>
392 % if ( $curuser->access_right('Unsuspend customer package') ) {
393 ( <% pkg_unsuspend_link($cust_pkg) %> )
395 % if ( $curuser->access_right('Cancel customer package immediately') ) {
396 ( <% pkg_cancel_link($cust_pkg) %> )
402 % } else { #status: active
404 % unless ( $cust_pkg->get('setup') ) { #not setup
406 % unless ( $part_pkg->freq ) {
408 <% pkg_status_row_colspan('Not yet billed (one-time charge)') %>
411 <TD COLSPAN=<%$colspan%>>
413 % if ( $curuser->access_right('Cancel customer package immediately') ) {
414 ( <% pkg_cancel_link($cust_pkg) %> )
422 <% pkg_status_row_colspan("Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')' ) %>
428 % unless ( $part_pkg->freq ) {
430 <% pkg_status_row_colspan('One-time charge') %>
432 <% pkg_status_row($cust_pkg, 'Billed', 'setup', conf=>$conf) %>
436 % if (scalar($cust_pkg->overlimit)) {
438 <% pkg_status_row_colspan(
440 $billed_or_prepaid. ' '. myfreq($part_pkg),
446 <% pkg_status_row_colspan(
448 $billed_or_prepaid. ' '. myfreq($part_pkg),
454 <% pkg_status_row($cust_pkg, 'Setup', 'setup', conf=>$conf) %>
460 <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %>
461 <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf, curuser=>$curuser ) %>
462 <% pkg_status_row_if( $cust_pkg, $next_bill_or_prepaid_until, 'bill', conf=>$conf, curuser=>$curuser ) %>
463 <% pkg_status_row_if( $cust_pkg, 'Will suspend on', 'adjourn', conf=>$conf, curuser=>$curuser ) %>
464 <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', conf=>$conf, curuser=>$curuser ) %>
466 % if ( $part_pkg->freq ) {
469 <TD COLSPAN=<%$colspan%>>
471 % if ( $curuser->access_right('Suspend customer package') ) {
472 ( <% pkg_suspend_link($cust_pkg) %> )
474 % if ( $curuser->access_right('Suspend customer package later') ) {
475 ( <% pkg_adjourn_link($cust_pkg) %> )
477 % if ( $curuser->access_right('Cancel customer package immediately') ) {
478 ( <% pkg_cancel_link($cust_pkg) %> )
480 % if ( $curuser->access_right('Cancel customer package later') ) {
481 ( <% pkg_expire_link($cust_pkg) %> )
495 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
496 <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
498 % #foreach my $svcpart (sort {$a->{svcpart} <=> $b->{svcpart}} @{$pkg->{svcparts}}) {
499 % foreach my $part_svc ( $cust_pkg->part_svc ) {
501 % #foreach my $service (@{$svcpart->{services}}) {
502 % foreach my $cust_svc ( @{ $part_svc->cust_pkg_svc } ) {
505 <TD ALIGN="right" VALIGN="top"><% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %></TD>
506 <TD STYLE="padding-bottom:0px"><B><% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %></B></TD>
507 <TD><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %></TD>
511 <TD ALIGN="right" COLSPAN="3" VALIGN="top" STYLE="padding-bottom:1px;padding-top:0px"><FONT SIZE="-2" COLOR="#FFD000">
513 <% $cust_svc->overlimit ? "Overlimit: ". time2str('%b %o %Y' . ($conf->exists('cust_pkg-display_times') ? ' %l:%M %P' : ''), $cust_svc->overlimit) : '' %>
518 <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px;padding-top:0px"><FONT SIZE="-2">
520 % if ( $curuser->access_right('Recharge customer service')
521 % && $part_svc->svcdb eq 'svc_acct'
522 % && ( $cust_svc->svc_x->seconds ne ''
523 % || $cust_svc->svc_x->upbytes ne ''
524 % || $cust_svc->svc_x->downbytes ne ''
525 % || $cust_svc->svc_x->totalbytes ne ''
528 ( <%svc_recharge_link($cust_svc)%> )
532 <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px;padding-top:0px"><FONT SIZE="-2">
534 % if ( $curuser->access_right('Unprovision customer service') ) {
535 ( <%svc_unprovision_link($cust_svc)%> )
541 % if ( ! $cust_pkg->get('cancel')
542 % && $curuser->access_right('Provision customer service')
543 % && $part_svc->num_avail
547 <TD COLSPAN=3 ALIGN="center" STYLE="padding-bottom:4px;padding-top:0px">
548 <B><% svc_provision_link($cust_pkg, $part_svc, $conf, $curuser) %></B>
558 % } #end display packages
567 % if ( $cgi->param('fragment') =~ /^cust_pkg(\d+)$/ ) {
569 // IE-specific hack. other browsers listen to #fragments
570 // is this even working? or is the #target redirection just working cause
571 // we set the URL params differently?
572 var el = document.getElementById( 'cust_pkg<% $1 %>' );
573 if ( el ) el.scrollIntoView(true);
578 my( $cust_main ) = @_;
579 my $conf = new FS::Conf;
581 my $curuser = $FS::CurrentUser::CurrentUser;
583 my $packages = get_packages($cust_main, $conf);
585 my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4;
586 my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%';
589 my( $cust_pkg, $title, $field, %opt ) = @_;
591 my $color = $opt{'color'};
593 my $html = qq(<TR><TD WIDTH="<%$width%>" ALIGN="right">);
594 $html .= qq(<FONT COLOR="#$color"><B>) if length($color);
595 $html .= qq($title );
596 $html .= qq(</B></FONT>) if length($color);
598 $html .= pkg_datestr($cust_pkg, $field, $opt{conf}).'</TR>';
603 sub pkg_status_row_if {
604 my( $cust_pkg, $title, $field, %opt ) = @_;
606 $title = '<FONT SIZE=-1>( '. pkg_unadjourn_link($cust_pkg). ' ) </FONT>'. $title
607 if ( $field eq 'adjourn' &&
608 $opt{curuser}->access_right('Suspend customer package later')
611 $title = '<FONT SIZE=-1>( '. pkg_unexpire_link($cust_pkg). ' ) </FONT>'. $title
612 if ( $field eq 'expire' &&
613 $opt{curuser}->access_right('Cancel customer package later')
616 $cust_pkg->get($field) ? pkg_status_row($cust_pkg, $title, $field, %opt) : '';
619 sub pkg_status_row_changed {
620 my( $cust_pkg, %opt ) = @_;
621 return '' unless $cust_pkg->change_date;
622 my $html = pkg_status_row( $cust_pkg, 'Package changed', 'change_date', conf=>$opt{'conf'} );
623 my $old = $cust_pkg->old_cust_pkg;
625 my $part_pkg = $old->part_pkg;
626 my $label = 'Changed from '. $cust_pkg->change_pkgnum. ': '.
627 $part_pkg->pkg. ' - '. $part_pkg->comment;
628 $html .= pkg_status_row_colspan( $label, '', size=>'-1', align=>'right' );
633 sub pkg_status_row_colspan {
634 my($title, $addl, %opt) = @_;
636 my $align = $opt{'align'} ? 'ALIGN="'. $opt{'align'}.'"' : '';
637 my $color = $opt{'color'} ? 'COLOR="#'.$opt{'color'}.'"' : '';
638 my $size = $opt{'size'} ? 'SIZE="'. $opt{'size'}. '"' : '';
640 my $html = qq(<TR><TD COLSPAN=$colspan $align>);
641 $html .= qq(<FONT $color $size>) if length($color) || $size;
642 $html .= qq(<B>) if $color && !$size;
644 $html .= qq(</B>) if $color && !$size;
645 $html .= qq(</FONT>) if length($color) || $size;
646 $html .= ", $addl" if length($addl);
647 $html .= qq(</TD></TR>);
656 my $cust_main = shift or return undef;
661 if ( $cgi->param('showcancelledpackages') eq '0' #see if it was set by me
662 || ( $conf->exists('hidecancelledpackages')
663 && ! $cgi->param('showcancelledpackages') )
666 $method = 'ncancelled_pkgs';
668 $method = 'all_pkgs';
671 [ $cust_main->$method() ];
674 sub svc_provision_link {
675 my ($cust_pkg, $part_svc, $conf, $curuser) = @_;
676 ( my $svc_nbsp = $part_svc->svc ) =~ s/\s+/ /g;
677 my $num_avail = $part_svc->num_avail;
678 my $pkgnum_svcpart = "pkgnum=". $cust_pkg->pkgnum. ';'.
679 "svcpart=". $part_svc->svcpart;
681 if ( $part_svc->svcdb eq 'svc_external' #could be generalized
682 && $conf->exists('svc_external-skip_manual')
684 $url = "${p}edit/process/". $part_svc->svcdb. ".cgi?$pkgnum_svcpart";
689 'part_svc' => $part_svc,
690 'query' => $pkgnum_svcpart,
692 #$url = "${p}edit/$svcpart->{svcdb}.cgi?$pkgnum_svcpart";
695 my $link = qq!<A CLASS="provision" HREF="$url">!.
696 "Provision $svc_nbsp ($num_avail)</A>";
697 if ( $conf->exists('legacy_link')
698 && $curuser->access_right('View/link unlinked services')
702 qq!<A CLASS="provision" HREF="${p}misc/link.cgi?!.
703 qq!$pkgnum_svcpart">!.
704 "Link to legacy $svc_nbsp ($num_avail)</A>";
709 sub svc_unprovision_link {
710 my $cust_svc = shift or return '';
711 qq!<A HREF="javascript:areyousure('${p}misc/unprovision.cgi?!. $cust_svc->svcnum.
712 qq!', 'Permanently unprovision and delete this service?')">Unprovision</A>!;
716 my($cust_pkg, $field, $conf) = @_ or return '';
717 return ' ' unless $cust_pkg->get($field);
718 my $format = '<TD align="left"><B>%b</B></TD>'.
719 '<TD align="right"><B> %o,</B></TD>'.
720 '<TD align="right"><B> %Y</B></TD>';
721 #$format .= ' <FONT SIZE=-3>%l:%M:%S%P %z</FONT>'
722 $format .= '<TD ALIGN="right"><B> %l</TD>'.
723 '<TD ALIGN="center"><B>:</B></TD>'.
724 '<TD ALIGN="left"><B>%M</B></TD>'.
725 '<TD ALIGN="left"><B> %P</B></TD>'
726 if $conf->exists('cust_pkg-display_times');
727 my $strip = time2str($format, $cust_pkg->get($field) );
728 $strip =~ s/ (\d)/$1/g;
732 sub pkg_change_link { include( '/elements/popup_link-cust_pkg.html',
733 { 'action' => $p. 'misc/change_pkg.cgi?dummy=value',
734 'label' => 'Change package',
735 'actionlabel' => 'Change',
741 sub pkg_suspend_link { include( '/elements/popup_link-cust_pkg.html',
742 { 'action' => $p. 'misc/cancel_pkg.html?method=suspend',
743 'label' => 'Suspend now',
744 'actionlabel' => 'Suspend',
745 'color' => '#FF9900',
752 sub pkg_adjourn_link { include( '/elements/popup_link-cust_pkg.html',
753 { 'action' => $p. 'misc/cancel_pkg.html?method=adjourn',
754 'label' => 'Suspend later',
755 'actionlabel' => 'Adjourn',
756 'color' => '#CC6600',
762 sub pkg_unsuspend_link { pkg_link('misc/unsusp_pkg', 'Unsuspend', @_ ); }
763 sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); }
764 sub pkg_unadjourn_link { pkg_link('misc/unadjourn_pkg', 'Abort', @_ ); }
765 sub pkg_unexpire_link { pkg_link('misc/unexpire_pkg', 'Abort', @_ ); }
767 sub pkg_cancel_link { include( '/elements/popup_link-cust_pkg.html',
768 { 'action' => $p. 'misc/cancel_pkg.html?method=cancel',
769 'label' => 'Cancel now',
770 'actionlabel' => 'Cancel',
771 'color' => '#ff0000',
777 sub pkg_expire_link { include( '/elements/popup_link-cust_pkg.html',
778 { 'action' => $p. 'misc/cancel_pkg.html?method=expire',
779 'label' => 'Cancel later',
780 'actionlabel' => 'Expire', #"Cancel package $num later"
781 'color' => '#CC0000',
787 sub svc_recharge_link { include( '/elements/popup_link-cust_svc.html',
788 { 'action' => $p. 'misc/recharge_svc.html',
789 'label' => 'Recharge',
790 'actionlabel' => 'Recharge',
791 'color' => '#333399',
797 sub order_pkg_link { include( '/elements/popup_link-cust_main.html',
798 { 'action' => $p. 'misc/order_pkg.html',
799 'label' => 'Order new package',
800 'actionlabel' => 'Order new package',
801 'color' => '#333399',
802 'cust_main' => shift,
803 'closetext' => 'Close',
810 qq!<a href="${p}search/cust_event.html?pkgnum=!. $cust_pkg->pkgnum. qq!">!.
811 'View package events'.
816 my($action, $label, $cust_pkg) = @_;
817 return '' unless $cust_pkg;
818 qq!<a href="$p$action.cgi?!. $cust_pkg->pkgnum. qq!">$label</a>!;
821 sub pkg_customize_link {
822 my $cust_pkg = shift or return '';
823 my $custnum = $cust_pkg->custnum;
824 qq!<A HREF="${p}edit/part_pkg.cgi?!.
825 "clone=". $cust_pkg->part_pkg->pkgpart. ';'.
826 "pkgnum=". $cust_pkg->pkgnum.