1 <TD CLASS="inv" BGCOLOR="<% $bgcolor %>" VALIGN="top">
2 <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
4 %#this should use cust_pkg->status and cust_pkg->statuscolor eventually
6 % if ( $supplemental ) {
7 <% pkg_status_row_colspan($cust_pkg, emt('Supplemental'), '', 'color' => '7777FF', %opt) %>
8 % } elsif ( $cust_pkg->order_date ) {
9 <% pkg_status_row($cust_pkg, emt('Ordered'), 'order_date', %opt ) %>
12 % if ( $cust_pkg->get('cancel') ) { #status: cancelled
13 % my $cpr = $cust_pkg->last_cust_pkg_reason('cancel');
15 <% pkg_status_row($cust_pkg, emt('Cancelled'), 'cancel', 'color'=>'FF0000', %opt ) %>
17 <% pkg_status_row_detached($cust_pkg, %opt) %>
19 <% pkg_reason_row($cust_pkg, $cpr, color => 'ff0000', %opt) %>
21 % unless ( $cust_pkg->get('setup') ) {
23 <% pkg_status_row_colspan( $cust_pkg, emt('Never billed'), '', %opt, ) %>
27 <% pkg_status_row( $cust_pkg, emt('Setup'), 'setup', %opt ) %>
28 <% pkg_status_row_changed( $cust_pkg, %opt ) %>
29 <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %>
30 <% pkg_status_row_if( $cust_pkg, emt('Suspended'), 'susp', %opt, curuser=>$curuser ) %>
34 % if ( $part_pkg->freq && !$supplemental && !$cust_pkg->change_custnum ) { #?
37 <TD COLSPAN=<%$opt{colspan}%>>
39 % if ( $curuser->access_right('Un-cancel customer package') && ! $opt{no_links} ) {
40 ( <% pkg_uncancel_link($cust_pkg) %> )
47 % } else { # not canceled
49 % if ( $cust_pkg->get('susp') ) { #suspended or on hold
51 % #if ( $cust_pkg->order_date eq $cust_pkg->get('susp') ) # inconsistent with FS::cust_pkg::status
52 % if ( ! $cust_pkg->setup ) { #status: on hold
54 <% pkg_status_row( $cust_pkg, emt('On Hold'), '', 'color'=>'7E0079', %opt ) %>
56 % } else { #status: suspended
57 % my ($cpr,$susplabel);
58 % if ($cust_pkg->is_status_delay_cancel(%opt)) {
59 % $cpr = $cust_pkg->last_cust_pkg_reason('expire');
60 % $susplabel = 'Suspended (Cancelled)';
62 % $cpr = $cust_pkg->last_cust_pkg_reason('susp');
63 % $susplabel = 'Suspended';
65 <% pkg_status_row( $cust_pkg, emt($susplabel), 'susp', 'color'=>'FF9900', %opt ) %>
66 <% pkg_reason_row( $cust_pkg, $cpr, 'color' => 'FF9900', %opt ) %>
70 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
72 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
74 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
76 % unless ( $cust_pkg->order_date eq $cust_pkg->get('susp') ) { #on hold
77 % unless ( $cust_pkg->get('setup') ) {
78 <% pkg_status_row_colspan( $cust_pkg, emt('Never billed'), '', %opt ) %>
80 <% pkg_status_row($cust_pkg, emt('Setup'), 'setup', %opt ) %>
84 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
86 <% pkg_status_row_changed( $cust_pkg, %opt ) %>
87 <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %>
88 % if ( $cust_pkg->option('suspend_bill', 1)
89 % || ( $part_pkg->option('suspend_bill', 1)
90 % && ! $cust_pkg->option('no_suspend_bill',1)
94 <% pkg_status_row_if( $cust_pkg, emt('Next bill'), 'bill', %opt, curuser=>$curuser ) %>
96 <% pkg_status_row_if( $cust_pkg, emt('Will resume'), 'resume', %opt, curuser=>$curuser ) %>
97 <% pkg_status_row_expire($cust_pkg, %opt, curuser=>$curuser) %>
98 <% pkg_status_row_if( $cust_pkg, emt('Contract ends'), 'contract_end', %opt ) %>
100 % # Status changes for suspended packages: can unsuspend, future-unsuspend,
101 % # or future-change. If this package is a future change or is supplemental
102 % # disable them all.
103 % if ( !$supplemental && ! $opt{no_links} && !$change_from ) {
105 <TD COLSPAN=<%$opt{colspan}%>>
107 % if ( $cust_pkg->change_to_pkgnum ) {
108 % # then you can modify the package change
109 % if ( $curuser->access_right('Change customer package') ) {
110 ( <% pkg_change_now_link($cust_pkg) %> )
111 ( <% pkg_change_later_link($cust_pkg) %> )
112 ( <% pkg_unchange_link($cust_pkg) %> )
116 % if ( $curuser->access_right('Unsuspend customer package') ) {
117 % if ( $cust_pkg->order_date eq $cust_pkg->get('susp') ) { #on hold
118 ( <% pkg_link('misc/unsusp_pkg', emt('Start billing now'), $cust_pkg) %> )
120 ( <% pkg_unsuspend_link($cust_pkg) %> )
121 ( <% pkg_resume_link($cust_pkg) %> )
124 % if ( !$cust_pkg->change_to_pkgnum and
125 % $curuser->access_right('Cancel customer package immediately')
127 ( <% pkg_cancel_link($cust_pkg) %> )
134 % } else { #status: active
136 % if ( $change_from ) { # future change
138 <% pkg_status_row_colspan( $cust_pkg, emt('Waiting for package change'), '', %opt ) %>
139 <% pkg_status_row( $cust_pkg,
140 emt('Will be activated on'),
144 % } elsif ( ! $cust_pkg->get('setup') ) { # not setup
146 % unless ( $part_pkg->freq ) { # one-time charge
148 <% pkg_status_row_colspan( $cust_pkg, emt('Not yet billed (one-time charge)'), '', %opt ) %>
150 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
152 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
154 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
156 <% pkg_status_row_if(
158 ( $part_pkg->freq ? emt('Start billing') : emt('Bill on') ),
164 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
166 % if ( !$supplemental && ! $opt{no_links} ) {
168 <TD COLSPAN=<%$opt{colspan}%>>
170 % if ( $curuser->access_right('Cancel customer package immediately') ) {
171 ( <% pkg_cancel_link($cust_pkg) %> )
180 <% pkg_status_row_colspan($cust_pkg, emt("Not yet billed ($billed_or_prepaid [_1])", myfreq($part_pkg) ), '', %opt ) %>
182 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
184 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
186 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
188 <% pkg_status_row_if($cust_pkg, emt('Start billing'), 'start_date', %opt) %>
189 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
195 % unless ( $part_pkg->freq ) {
197 <% pkg_status_row_colspan($cust_pkg, emt('One-time charge'), '', %opt ) %>
199 <% pkg_status_row($cust_pkg, emt('Billed'), 'setup', %opt) %>
201 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
203 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
205 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
207 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
209 % } else { # recurring package
211 % my $num_cust_svc = $cust_pkg->num_cust_svc;
212 % my $summarize = $opt{'cust_pkg-large_pkg_size'} > 0
213 % && $opt{'cust_pkg-large_pkg_size'} <= $num_cust_svc;
215 % #overlimit process is expensive with many services, so skip w/summary
216 % if ( !$summarize && scalar($cust_pkg->overlimit) ) {
218 <% pkg_status_row_colspan( $cust_pkg,
220 $billed_or_prepaid. ' '. myfreq($part_pkg),
227 <% pkg_status_row_colspan( $cust_pkg,
229 $billed_or_prepaid. ' '. myfreq($part_pkg),
236 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
238 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
240 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
242 <% pkg_status_row($cust_pkg, emt('Setup'), 'setup', %opt) %>
244 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
250 % if ( $opt{'cust_pkg-show_autosuspend'} ) {
251 % my $autosuspend = pkg_autosuspend_time( $cust_pkg );
252 % $cust_pkg->set('autosuspend', $autosuspend) if $autosuspend;
255 <% pkg_status_row_changed( $cust_pkg, %opt ) %>
256 <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %>
257 <% pkg_status_row_if( $cust_pkg, $next_bill_or_prepaid_until, 'bill', %opt, curuser=>$curuser ) %>
258 <% pkg_status_row_if($cust_pkg, emt('Will automatically suspend by'), 'autosuspend', %opt) %>
259 <% pkg_status_row_if($cust_pkg, emt('Automatic suspension delayed until'), 'dundate', %opt) %>
260 <% pkg_status_row_if( $cust_pkg, emt('Will suspend on'), 'adjourn', %opt, curuser=>$curuser ) %>
261 <% pkg_status_row_if( $cust_pkg, emt('Will resume on'), 'resume', %opt, curuser=>$curuser ) %>
262 <% pkg_status_row_expire($cust_pkg, %opt, curuser=>$curuser) %>
263 <% pkg_status_row_if( $cust_pkg, emt('Contract ends'), 'contract_end', %opt ) %>
265 % # Status changes for active recurring packages. If it has a future
266 % # package change scheduled, let that be modified. If it's supplemental,
267 % # then that's the only allowed action. Otherwise allow suspend, future
268 % # suspend, do-not-suspend, and immediate and future cancel.
269 % if ( $part_pkg->freq and ! $opt{no_links} ) {
272 <TD COLSPAN=<%$opt{colspan}%>>
275 % if ( $change_from ) {
277 % } elsif ( $cust_pkg->change_to_pkgnum ) {
278 % # then you can modify the package change
279 % if ( $curuser->access_right('Change customer package') ) {
280 ( <% pkg_change_now_link($cust_pkg) %> )
281 ( <% pkg_change_later_link($cust_pkg) %> )
282 ( <% pkg_unchange_link($cust_pkg) %> )
287 % if ( !$supplemental ) {
288 % # suspension actions--always available
289 % if ( $curuser->access_right('Suspend customer package') ) {
290 ( <% pkg_suspend_link($cust_pkg) %> )
292 % if ( $curuser->access_right('Suspend customer package later') ) {
293 ( <% pkg_adjourn_link($cust_pkg) %> )
295 % if ( $curuser->access_right('Delay suspension events') ) {
296 ( <% pkg_delay_link($cust_pkg) %> )
299 % if ( $change_from or $cust_pkg->change_to_pkgnum ) {
300 % # you can't cancel the package while in this state
301 % } else { # the normal case: links to cancel the package
303 % if ( $curuser->access_right('Cancel customer package immediately') ) {
304 ( <% pkg_cancel_link($cust_pkg) %> )
306 % if ( $curuser->access_right('Cancel customer package later') ) {
307 ( <% pkg_expire_link($cust_pkg) %> )
326 my $bgcolor = $opt{'bgcolor'};
327 my $cust_pkg = $opt{'cust_pkg'};
328 my $part_pkg = $opt{'part_pkg'};
329 my $curuser = $FS::CurrentUser::CurrentUser;
330 my $width = $opt{'cust_pkg-display_times'} ? '38%' : '56%';
331 my $supplemental = $opt{'supplemental'};
332 my $change_from = $opt{'change_from'};
334 $opt{colspan} = $opt{'cust_pkg-display_times'} ? 8 : 4;
336 #false laziness w/edit/REAL_cust_pkg.cgi
337 my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until );
338 unless ( $part_pkg->is_prepaid ) {
339 $billed_or_prepaid = 'billed';
340 $last_bill_or_renewed = 'Last bill';
341 $next_bill_or_prepaid_until = 'Next bill';
343 $billed_or_prepaid = 'prepaid';
344 $last_bill_or_renewed = 'Renewed';
345 $next_bill_or_prepaid_until = 'Prepaid until';
351 my $part_pkg = shift;
352 my $freq = $part_pkg->freq_pretty;
353 #$freq =~ s/ / /g;
357 #false laziness w/package.html
359 my($action, $label, $cust_pkg) = @_;
360 return '' unless $cust_pkg;
361 qq!<a href="$p$action.cgi?!. $cust_pkg->pkgnum. qq!">$label</a>!;
365 my( $cust_pkg, $title, $field, %opt ) = @_;
367 if ( $field and $cust_pkg->main_pkgnum ) {
368 # for supplemental packages, we mostly only show these if they're
369 # different from the main package
370 my $main_pkg = $cust_pkg-> main_pkg;
371 if ( $main_pkg->get($field) ne $cust_pkg->get($field)
372 # with some exceptions
374 or $field eq 'last_bill'
377 or $field eq 'cancel'
385 my $color = $opt{'color'};
387 my $html = qq(<TR><TD WIDTH="$width" ALIGN="right">);
388 $html .= qq(<FONT COLOR="#$color"><B>) if length($color);
389 $html .= qq($title );
390 $html .= qq(</B></FONT>) if length($color);
392 if ( $opt{'pkg_balances'} && ! $cust_pkg->{_printed_balance}++ ) { #kludge
393 $html .= ' (Balance: <B>'. $opt{'money_char'}.
394 $cust_pkg->cust_main->balance_pkgnum($cust_pkg->pkgnum).
399 $html .= pkg_datestr($cust_pkg, $field, %opt). '</TR>';
404 sub pkg_status_row_if {
405 my( $cust_pkg, $title, $field, %opt ) = @_;
407 $title = '<FONT SIZE=-1>( '. pkg_unadjourn_link($cust_pkg). ' ) </FONT>'. $title
408 if ( $field eq 'adjourn' &&
409 $opt{curuser}->access_right('Suspend customer package later')
412 $cust_pkg->get($field) ? pkg_status_row($cust_pkg, $title, $field, %opt) : '';
415 sub pkg_status_row_expire {
416 my $cust_pkg = shift;
418 return unless $cust_pkg->get('expire');
422 if ( $cust_pkg->get('change_to_pkg') ) {
423 if ( $cust_pkg->change_to_pkg->pkgpart != $cust_pkg->pkgpart ) {
424 $title = mt('Will change to <b>[_1]</b> on',
425 $cust_pkg->change_to_pkg->part_pkg->pkg);
426 } elsif ( $cust_pkg->change_to_pkg->locationnum != $cust_pkg->locationnum )
428 $title = mt('Will <b>change location</b> on');
429 } elsif (( $cust_pkg->change_to_pkg->quantity != $cust_pkg->quantity ) ||
430 ( $cust_pkg->change_to_pkg->contract_end != $cust_pkg->contract_end ))
432 $title = mt('Will change on');
434 # FS::cust_pkg->change_later should have prevented this, but
435 # just so that we can display _something_
436 $title = '<font color="#ff0000">Unknown package change</font>';
441 $title = emt('Expires');
442 if ( $opt{curuser}->access_right('Cancel customer package later')) {
443 $title = '<FONT SIZE=-1>( '. pkg_unexpire_link($cust_pkg). ' ) </FONT>'. $title;
448 pkg_status_row( $cust_pkg, $title, 'expire', %opt );
451 sub pkg_status_row_changed {
452 my( $cust_pkg, %opt ) = @_;
454 return '' unless $cust_pkg->change_date;
457 pkg_status_row( $cust_pkg, emt('Package changed'), 'change_date', %opt );
459 my $old = $cust_pkg->old_cust_pkg;
461 my $part_pkg = $old->part_pkg;
462 $html .= pkg_status_row_colspan(
464 # emt("Changed from [_1]: [_2]",
465 # $cust_pkg->change_pkgnum,
466 # $part_pkg->pkg_comment(cust_pkg=>$old, nopartpkg=>1)
478 sub pkg_status_row_detached {
479 my( $cust_pkg, %opt ) = @_;
481 return '' unless $cust_pkg->change_custnum;
485 my $cust_main = $cust_pkg->change_cust_main;
488 my $cust_link = '<A HREF="cust_main.cgi?'. $cust_pkg->change_custnum. '">'.
489 encode_entities( $cust_main->name ).
492 my $what = $opt{'pkg_attached'} ? 'Attached' : 'Detached';
494 $html .= pkg_status_row_colspan( $cust_pkg,
495 emt("$what to customer #[_1]: ",
496 $cust_pkg->change_custnum
509 sub pkg_status_row_noauto {
510 my( $cust_pkg, %opt ) = @_;
512 return '' unless ( $cust_pkg->no_auto || $opt{'part_pkg'}->no_auto )
513 && $opt{'has_cust_payby_auto'};
515 pkg_status_row_colspan( $cust_pkg, emt("No automatic charge"), '');
518 sub pkg_status_row_separate_bill {
519 my $cust_pkg = shift;
520 return '' unless $cust_pkg->separate_bill;
521 pkg_status_row_colspan( $cust_pkg, emt("Invoiced separately") );
524 sub pkg_status_row_discount {
525 my( $cust_pkg, %opt ) = @_;
529 foreach my $cust_pkg_discount (@{ $cust_pkg->{_cust_pkg_discount_active} }) {
531 my $discount = $cust_pkg_discount->discount;
533 my $label = '<SPAN STYLE="font-size: small"><B>';
534 if ( $cust_pkg_discount->setuprecur eq 'setup' ) {
535 $label .= emt('Setup Discount');
537 $label .= emt('Recurring Discount');
539 $label .= '</B>: '. $discount->description;
540 warn Dumper $cust_pkg_discount;
541 if ( $discount->months > 0 and $cust_pkg_discount->months_used > 0 ) {
542 my $remaining = $discount->months - $cust_pkg_discount->months_used;
543 $remaining = sprintf('%.2f', $remaining) if $remaining =~ /\./;
544 $label .= <br> . emt("([_1] months remaining)",$remaining);
548 #$label .= ' <FONT SIZE="-1">('.
549 # '<A HREF="../misc/delete-cust_pkg_discount.html?'.
550 # $cust_pkg_discount->pkgdiscountnum.
551 # '">'.emt('remove discount').'</A>)</FONT>';
553 $html .= pkg_status_row_colspan( $cust_pkg, $label, '', %opt );
561 my ($cust_pkg, $cpr, %opt) = @_;
562 return '' if $cust_pkg->main_pkgnum;
565 $reasontext = $cpr->reasontext . ' by ' . $cpr->otaker if $cpr;
566 pkg_status_row_colspan( $cust_pkg, $reasontext, '',
567 'align'=>'right', 'size'=>'-2', %opt
571 sub pkg_status_row_colspan {
572 my($cust_pkg, $title, $addl, %opt) = @_;
574 my $colspan = $opt{'colspan'};
576 my $align = $opt{'align'} ? 'ALIGN="'. $opt{'align'}.'"' : '';
577 my $color = $opt{'color'} ? 'COLOR="#'.$opt{'color'}.'"' : '';
578 my $size = $opt{'size'} ? 'SIZE="'. $opt{'size'}. '"' : '';
580 my $html = qq(<TR><TD COLSPAN=$colspan $align>);
581 $html .= qq(<FONT $color $size>) if length($color) || $size;
582 $html .= qq(<B>) if $color && !$size;
584 $html .= qq(</B>) if $color && !$size;
585 $html .= qq(</FONT>) if length($color) || $size;
586 $html .= ", $addl" if length($addl);
588 if ( $opt{'pkg-balances'} && ! $cust_pkg->{_printed_balance}++ ) { #kludge
589 $html .= ' (Balance: <B>'. $opt{'money_char'}.
590 $cust_pkg->cust_main->balance_pkgnum($cust_pkg->pkgnum).
594 $html .= qq(</TD></TR>);
601 my($cust_pkg, $field, %opt) = @_ or return '';
602 return ' ' unless $cust_pkg->get($field);
603 my $format = '<TD align="left"><B>%b</B></TD>'.
604 '<TD align="right"><B> %o,</B></TD>'.
605 '<TD align="right"><B> %Y</B></TD>';
606 #$format .= ' <FONT SIZE=-3>%l:%M:%S%P %z</FONT>'
607 $format .= '<TD ALIGN="right"><B> %l</TD>'.
608 '<TD ALIGN="center"><B>:</B></TD>'.
609 '<TD ALIGN="left"><B>%M</B></TD>'.
610 '<TD ALIGN="left"><B> %P</B></TD>'
611 if $opt{'cust_pkg-display_times'};
612 my $strip = time2str($format, $cust_pkg->get($field) );
613 $strip =~ s/ (\d)/$1/g;
617 sub pkg_suspend_link {
618 include( '/elements/popup_link-cust_pkg.html',
619 'action' => $p. 'misc/cancel_pkg.html?method=suspend',
620 'label' => emt('Suspend now'),
621 'actionlabel' => emt('Suspend'),
622 'color' => '#FF9900',
628 sub pkg_adjourn_link {
629 include( '/elements/popup_link-cust_pkg.html',
630 'action' => $p. 'misc/cancel_pkg.html?method=adjourn',
631 'label' => emt('Suspend later'),
632 'actionlabel' => emt('Adjourn'),
633 'color' => '#CC6600',
640 my($cust_pkg) = shift;
641 include( '/elements/popup_link-cust_pkg.html',
642 'action' => $p. 'misc/delay_susp_pkg.html',
643 'label' => ( $cust_pkg->dundate
644 ? emt('Edit suspension delay')
645 : emt('Delay suspend')
647 'actionlabel' => emt('Delay suspend for'),
648 'cust_pkg' => $cust_pkg,
652 sub pkg_resume_link {
653 include( '/elements/popup_link-cust_pkg.html',
654 'action' => $p. 'misc/cancel_pkg.html?method=resume',
655 'label' => emt('Unsuspend later'),
656 'actionlabel' => emt('Resume'),
657 'color' => '#00CC00',
662 sub pkg_unsuspend_link { pkg_link('misc/unsusp_pkg', emt('Unsuspend now'), @_ ); }
663 sub pkg_unadjourn_link { pkg_link('misc/unadjourn_pkg', emt('Abort'), @_ ); }
664 sub pkg_unexpire_link { pkg_link('misc/unexpire_pkg', emt('Abort'), @_ ); }
665 sub pkg_unchange_link { pkg_link('misc/do_not_change_pkg', emt('Abort change'), @_ ); }
666 sub pkg_change_now_link { pkg_link('misc/change_pkg_now', emt('Change now'), @_ ); }
668 sub pkg_cancel_link {
669 include( '/elements/popup_link-cust_pkg.html',
670 'action' => $p. 'misc/cancel_pkg.html?method=cancel',
671 'label' => emt('Cancel now'),
672 'actionlabel' => emt('Cancel'),
673 'color' => '#ff0000',
678 sub pkg_uncancel_link {
679 include( '/elements/popup_link-cust_pkg.html',
680 'action' => $p. 'misc/cancel_pkg.html?method=uncancel',
681 'label' => emt('Un-cancel'),
682 'actionlabel' => emt('Un-cancel'),
688 sub pkg_expire_link {
689 include( '/elements/popup_link-cust_pkg.html',
690 'action' => $p. 'misc/cancel_pkg.html?method=expire',
691 'label' => emt('Cancel later'),
692 'actionlabel' => emt('Expire'),
693 'color' => '#CC0000',
698 sub pkg_change_later_link {
699 my $cust_pkg = shift;
700 include( '/elements/popup_link-cust_pkg.html',
701 'action' => $p . 'misc/change_pkg.cgi?',
702 'label' => emt('Reschedule'),
703 'actionlabel' => emt('Edit scheduled change for'),
704 'cust_pkg' => $cust_pkg,
710 sub svc_recharge_link {
711 include( '/elements/popup_link-cust_svc.html',
712 'action' => $p. 'misc/recharge_svc.html',
713 'label' => emt('Recharge'),
714 'actionlabel' => emt('Recharge'),
715 'color' => '#333399',
720 sub pkg_autosuspend_time {
721 my $cust_pkg = shift or return '';
724 my $pending_suspend = 0;
725 #this seems to be extremely inefficient... and is slowing down all customer
729 grep { $_->part_event->action eq 'suspend' }
730 @{$cust_pkg->cust_main->due_cust_event( time => $time + 86400*$days,
736 $pending_suspend = 1;
740 $pending_suspend ? time + ($days + 1) * 86400 : '';