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) %> )
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 % if ( $cust_pkg->order_date ne $cust_pkg->get('susp') ) { # not on hold
77 % if ( $cust_pkg->get('setup') ) {
78 <% pkg_status_row($cust_pkg, emt('Setup'), 'setup', %opt ) %>
80 <% pkg_status_row_colspan( $cust_pkg, emt('Never billed'), '', %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 % if ( !$supplemental && ! $opt{no_links} && !$change_from ) {
102 <TD COLSPAN=<%$opt{colspan}%>>
104 % if ( $cust_pkg->change_to_pkgnum ) {
105 % # then you can modify the package change
106 % if ( $curuser->access_right('Change customer package') ) {
107 ( <% pkg_change_now_link($cust_pkg) %> )
108 ( <% pkg_change_later_link($cust_pkg) %> )
109 ( <% pkg_unchange_link($cust_pkg) %> )
113 % if ( $curuser->access_right('Unsuspend customer package') ) {
114 % if ( $cust_pkg->order_date eq $cust_pkg->get('susp') ) { #on hold
115 ( <% pkg_unhold_link($cust_pkg) %> )
117 ( <% pkg_unsuspend_link($cust_pkg) %> )
118 ( <% pkg_resume_link($cust_pkg) %> )
121 % if ( !$cust_pkg->change_to_pkgnum and
122 % $curuser->access_right('Cancel customer package immediately')
124 ( <% pkg_cancel_link($cust_pkg) %> )
131 % } else { #status: active
133 % if ( $change_from ) { # future change
135 <% pkg_status_row_colspan( $cust_pkg, emt('Waiting for package change'), '', %opt ) %>
136 <% pkg_status_row_if( $cust_pkg,
137 emt('Will be activated on'),
141 % } elsif ( ! $cust_pkg->get('setup') ) { # not setup
143 % unless ( $part_pkg->freq ) { # one-time charge
145 <% pkg_status_row_colspan( $cust_pkg, emt('Not yet billed (one-time charge)'), '', %opt ) %>
147 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
149 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
151 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
153 <% pkg_status_row_if(
155 ( $part_pkg->freq ? emt('Start billing') : emt('Bill on') ),
161 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
163 % if ( !$supplemental && ! $opt{no_links} ) {
165 <TD COLSPAN=<%$opt{colspan}%>>
167 % if ( $curuser->access_right('Cancel customer package immediately') ) {
168 ( <% pkg_cancel_link($cust_pkg) %> )
177 <% pkg_status_row_colspan($cust_pkg, emt("Not yet billed ($billed_or_prepaid [_1])", myfreq($part_pkg) ), '', %opt ) %>
179 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
181 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
183 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
185 <% pkg_status_row_if($cust_pkg, emt('Start billing'), 'start_date', %opt) %>
186 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
192 % unless ( $part_pkg->freq ) {
194 <% pkg_status_row_colspan($cust_pkg, emt('One-time charge'), '', %opt ) %>
196 <% pkg_status_row($cust_pkg, emt('Billed'), 'setup', %opt) %>
198 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
200 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
202 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
204 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
208 % my $num_cust_svc = $cust_pkg->num_cust_svc;
209 % my $summarize = $opt{'cust_pkg-large_pkg_size'} > 0
210 % && $opt{'cust_pkg-large_pkg_size'} <= $num_cust_svc;
212 % #overlimit process is expensive with many services, so skip w/summary
213 % if ( !$summarize && scalar($cust_pkg->overlimit) ) {
215 <% pkg_status_row_colspan( $cust_pkg,
217 $billed_or_prepaid. ' '. myfreq($part_pkg),
224 <% pkg_status_row_colspan( $cust_pkg,
226 $billed_or_prepaid. ' '. myfreq($part_pkg),
233 <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
235 <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
237 <% pkg_status_row_discount( $cust_pkg, %opt ) %>
239 <% pkg_status_row($cust_pkg, emt('Setup'), 'setup', %opt) %>
241 <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
247 % if ( $opt{'cust_pkg-show_autosuspend'} ) {
248 % my $autosuspend = pkg_autosuspend_time( $cust_pkg );
249 % $cust_pkg->set('autosuspend', $autosuspend) if $autosuspend;
252 <% pkg_status_row_changed( $cust_pkg, %opt ) %>
253 <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %>
254 <% pkg_status_row_if( $cust_pkg, $next_bill_or_prepaid_until, 'bill', %opt, curuser=>$curuser ) %>
255 <% pkg_status_row_if($cust_pkg, emt('Will automatically suspend by'), 'autosuspend', %opt) %>
256 <% pkg_status_row_if($cust_pkg, emt('Automatic suspension delayed until'), 'dundate', %opt) %>
257 <% pkg_status_row_if( $cust_pkg, emt('Will suspend on'), 'adjourn', %opt, curuser=>$curuser ) %>
258 <% pkg_status_row_if( $cust_pkg, emt('Will resume on'), 'resume', %opt, curuser=>$curuser ) %>
259 <% pkg_status_row_expire($cust_pkg, %opt, curuser=>$curuser) %>
260 <% pkg_status_row_if( $cust_pkg, emt('Contract ends'), 'contract_end', %opt ) %>
262 % if ( $part_pkg->freq and !$supplemental && ! $opt{no_links} ) {
265 <TD COLSPAN=<%$opt{colspan}%>>
268 % if ( $change_from ) {
270 % } elsif ( $cust_pkg->change_to_pkgnum ) {
271 % # then you can modify the package change
272 % if ( $curuser->access_right('Change customer package') ) {
273 ( <% pkg_change_now_link($cust_pkg) %> )
274 ( <% pkg_change_later_link($cust_pkg) %> )
275 ( <% pkg_unchange_link($cust_pkg) %> )
280 % # suspension actions--always available
281 % if ( $curuser->access_right('Suspend customer package') ) {
282 ( <% pkg_suspend_link($cust_pkg) %> )
284 % if ( $curuser->access_right('Suspend customer package later') ) {
285 ( <% pkg_adjourn_link($cust_pkg) %> )
287 % if ( $curuser->access_right('Delay suspension events') ) {
288 ( <% pkg_delay_link($cust_pkg) %> )
291 % if ( $change_from or $cust_pkg->change_to_pkgnum ) {
292 % # you can't cancel the package while in this state
293 % } else { # the normal case: links to cancel the package
295 % if ( $curuser->access_right('Cancel customer package immediately') ) {
296 ( <% pkg_cancel_link($cust_pkg) %> )
298 % if ( $curuser->access_right('Cancel customer package later') ) {
299 ( <% pkg_expire_link($cust_pkg) %> )
317 my $bgcolor = $opt{'bgcolor'};
318 my $cust_pkg = $opt{'cust_pkg'};
319 my $part_pkg = $opt{'part_pkg'};
320 my $curuser = $FS::CurrentUser::CurrentUser;
321 my $width = $opt{'cust_pkg-display_times'} ? '38%' : '56%';
322 my $supplemental = $opt{'supplemental'};
323 my $change_from = $opt{'change_from'};
325 $opt{colspan} = $opt{'cust_pkg-display_times'} ? 8 : 4;
327 #false laziness w/edit/REAL_cust_pkg.cgi
328 my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until );
329 unless ( $part_pkg->is_prepaid ) {
330 $billed_or_prepaid = 'billed';
331 $last_bill_or_renewed = 'Last bill';
332 $next_bill_or_prepaid_until = 'Next bill';
334 $billed_or_prepaid = 'prepaid';
335 $last_bill_or_renewed = 'Renewed';
336 $next_bill_or_prepaid_until = 'Prepaid until';
342 my $part_pkg = shift;
343 my $freq = $part_pkg->freq_pretty;
344 #$freq =~ s/ / /g;
348 #false laziness w/package.html
350 my($action, $label, $cust_pkg) = @_;
351 return '' unless $cust_pkg;
352 qq!<a href="$p$action.cgi?!. $cust_pkg->pkgnum. qq!">$label</a>!;
356 my( $cust_pkg, $title, $field, %opt ) = @_;
358 if ( $field and $cust_pkg->main_pkgnum ) {
359 # for supplemental packages, we mostly only show these if they're
360 # different from the main package
361 my $main_pkg = $cust_pkg-> main_pkg;
362 if ( $main_pkg->get($field) ne $cust_pkg->get($field)
363 # with some exceptions
365 or $field eq 'last_bill'
368 or $field eq 'cancel'
376 my $color = $opt{'color'};
378 my $html = qq(<TR><TD WIDTH="$width" ALIGN="right">);
379 $html .= qq(<FONT COLOR="#$color"><B>) if length($color);
380 $html .= qq($title );
381 $html .= qq(</B></FONT>) if length($color);
383 if ( $opt{'pkg_balances'} && ! $cust_pkg->{_printed_balance}++ ) { #kludge
384 $html .= ' (Balance: <B>'. $opt{'money_char'}.
385 $cust_pkg->cust_main->balance_pkgnum($cust_pkg->pkgnum).
390 $html .= pkg_datestr($cust_pkg, $field, %opt). '</TR>';
395 sub pkg_status_row_if {
396 my( $cust_pkg, $title, $field, %opt ) = @_;
398 $title = '<FONT SIZE=-1>( '. pkg_unadjourn_link($cust_pkg). ' ) </FONT>'. $title
399 if ( $field eq 'adjourn' &&
400 $opt{curuser}->access_right('Suspend customer package later')
403 $cust_pkg->get($field) ? pkg_status_row($cust_pkg, $title, $field, %opt) : '';
406 sub pkg_status_row_expire {
407 my $cust_pkg = shift;
409 return unless $cust_pkg->get('expire');
413 if ( $cust_pkg->get('change_to_pkg') ) {
414 if ( $cust_pkg->change_to_pkg->pkgpart != $cust_pkg->pkgpart ) {
415 $title = mt('Will change to <b>[_1]</b> on',
416 $cust_pkg->change_to_pkg->part_pkg->pkg);
417 } elsif ( $cust_pkg->change_to_pkg->locationnum != $cust_pkg->locationnum )
419 $title = mt('Will <b>change location</b> on');
420 } elsif (( $cust_pkg->change_to_pkg->quantity != $cust_pkg->quantity ) ||
421 ( $cust_pkg->change_to_pkg->contract_end != $cust_pkg->contract_end ))
423 $title = mt('Will change on');
425 # FS::cust_pkg->change_later should have prevented this, but
426 # just so that we can display _something_
427 $title = '<font color="#ff0000">Unknown package change</font>';
432 $title = emt('Expires');
433 if ( $opt{curuser}->access_right('Cancel customer package later')) {
434 $title = '<FONT SIZE=-1>( '. pkg_unexpire_link($cust_pkg). ' ) </FONT>'. $title;
439 pkg_status_row( $cust_pkg, $title, 'expire', %opt );
442 sub pkg_status_row_changed {
443 my( $cust_pkg, %opt ) = @_;
445 return '' unless $cust_pkg->change_date;
448 pkg_status_row( $cust_pkg, emt('Package changed'), 'change_date', %opt );
450 my $old = $cust_pkg->old_cust_pkg;
452 my $part_pkg = $old->part_pkg;
453 $html .= pkg_status_row_colspan( $cust_pkg,
454 emt("Changed from [_1]: [_2]",
455 $cust_pkg->change_pkgnum,
456 $part_pkg->pkg_comment(nopartpkg => 1) ),
466 sub pkg_status_row_detached {
467 my( $cust_pkg, %opt ) = @_;
469 return '' unless $cust_pkg->change_custnum;
473 my $cust_main = $cust_pkg->change_cust_main;
476 my $cust_link = '<A HREF="cust_main.cgi?'. $cust_pkg->change_custnum. '">'.
477 encode_entities( $cust_main->name ).
480 my $what = $opt{'pkg_attached'} ? 'Attached' : 'Detached';
482 $html .= pkg_status_row_colspan( $cust_pkg,
483 emt("$what to customer #[_1]: ",
484 $cust_pkg->change_custnum
497 sub pkg_status_row_noauto {
498 my( $cust_pkg, %opt ) = @_;
499 my $part_pkg = $opt{'part_pkg'};
500 return '' unless $cust_pkg->no_auto || $part_pkg->no_auto;
502 #inefficient, should be passed in
503 my $cust_main = $cust_pkg->cust_main;
505 return '' unless $cust_main->payby =~ /^(CARD|CHEK)$/;
506 my $what = lc(FS::payby->shortname($cust_main->payby));
508 pkg_status_row_colspan( $cust_pkg, emt("No automatic $what charge"), '');
511 sub pkg_status_row_separate_bill {
512 my $cust_pkg = shift;
513 return '' unless $cust_pkg->separate_bill;
514 pkg_status_row_colspan( $cust_pkg, emt("Invoiced separately") );
517 sub pkg_status_row_discount {
518 my( $cust_pkg, %opt ) = @_;
522 foreach my $cust_pkg_discount (@{ $cust_pkg->{_cust_pkg_discount_active} }) {
524 my $discount = $cust_pkg_discount->discount;
526 my $label = '<B>'.emt('Discount').'</B>: '. $discount->description;
527 if ( $discount->months ) {
528 my $remaining = $discount->months - $cust_pkg_discount->months_used;
529 $remaining = sprintf('%.2f', $remaining) if $remaining =~ /\./;
530 $label .= emt(" ([quant,_1,month,months] remaining)",$remaining);
533 $label .= ' <FONT SIZE="-1">('.
534 '<A HREF="../misc/delete-cust_pkg_discount.html?'.
535 $cust_pkg_discount->pkgdiscountnum.
536 '">'.emt('remove discount').'</A>)</FONT>';
538 $html .= pkg_status_row_colspan( $cust_pkg, $label, '', %opt );
546 my ($cust_pkg, $cpr, %opt) = @_;
547 return '' if $cust_pkg->main_pkgnum;
550 $reasontext = $cpr->reasontext . ' by ' . $cpr->otaker if $cpr;
551 pkg_status_row_colspan( $cust_pkg, $reasontext, '',
552 'align'=>'right', 'size'=>'-2', %opt
556 sub pkg_status_row_colspan {
557 my($cust_pkg, $title, $addl, %opt) = @_;
559 my $colspan = $opt{'colspan'};
561 my $align = $opt{'align'} ? 'ALIGN="'. $opt{'align'}.'"' : '';
562 my $color = $opt{'color'} ? 'COLOR="#'.$opt{'color'}.'"' : '';
563 my $size = $opt{'size'} ? 'SIZE="'. $opt{'size'}. '"' : '';
565 my $html = qq(<TR><TD COLSPAN=$colspan $align>);
566 $html .= qq(<FONT $color $size>) if length($color) || $size;
567 $html .= qq(<B>) if $color && !$size;
569 $html .= qq(</B>) if $color && !$size;
570 $html .= qq(</FONT>) if length($color) || $size;
571 $html .= ", $addl" if length($addl);
573 if ( $opt{'pkg-balances'} && ! $cust_pkg->{_printed_balance}++ ) { #kludge
574 $html .= ' (Balance: <B>'. $opt{'money_char'}.
575 $cust_pkg->cust_main->balance_pkgnum($cust_pkg->pkgnum).
579 $html .= qq(</TD></TR>);
586 my($cust_pkg, $field, %opt) = @_ or return '';
587 return ' ' unless $cust_pkg->get($field);
588 my $format = '<TD align="left"><B>%b</B></TD>'.
589 '<TD align="right"><B> %o,</B></TD>'.
590 '<TD align="right"><B> %Y</B></TD>';
591 #$format .= ' <FONT SIZE=-3>%l:%M:%S%P %z</FONT>'
592 $format .= '<TD ALIGN="right"><B> %l</TD>'.
593 '<TD ALIGN="center"><B>:</B></TD>'.
594 '<TD ALIGN="left"><B>%M</B></TD>'.
595 '<TD ALIGN="left"><B> %P</B></TD>'
596 if $opt{'cust_pkg-display_times'};
597 my $strip = time2str($format, $cust_pkg->get($field) );
598 $strip =~ s/ (\d)/$1/g;
602 sub pkg_suspend_link {
603 include( '/elements/popup_link-cust_pkg.html',
604 'action' => $p. 'misc/cancel_pkg.html?method=suspend',
605 'label' => emt('Suspend now'),
606 'actionlabel' => emt('Suspend'),
607 'color' => '#FF9900',
613 sub pkg_adjourn_link {
614 include( '/elements/popup_link-cust_pkg.html',
615 'action' => $p. 'misc/cancel_pkg.html?method=adjourn',
616 'label' => emt('Suspend later'),
617 'actionlabel' => emt('Adjourn'),
618 'color' => '#CC6600',
625 my($cust_pkg) = shift;
626 include( '/elements/popup_link-cust_pkg.html',
627 'action' => $p. 'misc/delay_susp_pkg.html',
628 'label' => ( $cust_pkg->dundate
629 ? emt('Edit suspension delay')
630 : emt('Delay suspend')
632 'actionlabel' => emt('Delay suspend for'),
633 'cust_pkg' => $cust_pkg,
637 sub pkg_resume_link {
638 include( '/elements/popup_link-cust_pkg.html',
639 'action' => $p. 'misc/cancel_pkg.html?method=resume',
640 'label' => emt('Unsuspend later'),
641 'actionlabel' => emt('Resume'),
642 'color' => '#00CC00',
647 sub pkg_unhold_link {
648 include( '/elements/popup_link-cust_pkg.html',
649 'action' => $p. 'misc/unhold_pkg.html?',
650 'label' => emt('Start billing'),
651 'actionlabel' => emt('Start billing'),
652 'color' => '#00CC00',
659 sub pkg_unsuspend_link { pkg_link('misc/unsusp_pkg', emt('Unsuspend now'), @_ ); }
660 sub pkg_unadjourn_link { pkg_link('misc/unadjourn_pkg', emt('Abort'), @_ ); }
661 sub pkg_unexpire_link { pkg_link('misc/unexpire_pkg', emt('Abort'), @_ ); }
662 sub pkg_unchange_link { pkg_link('misc/do_not_change_pkg', emt('Abort change'), @_ ); }
663 sub pkg_change_now_link { pkg_link('misc/change_pkg_now', emt('Change now'), @_ ); }
665 sub pkg_cancel_link {
666 include( '/elements/popup_link-cust_pkg.html',
667 'action' => $p. 'misc/cancel_pkg.html?method=cancel',
668 'label' => emt('Cancel now'),
669 'actionlabel' => emt('Cancel'),
670 'color' => '#ff0000',
675 sub pkg_uncancel_link {
676 include( '/elements/popup_link-cust_pkg.html',
677 'action' => $p. 'misc/cancel_pkg.html?method=uncancel',
678 'label' => emt('Un-cancel'),
679 'actionlabel' => emt('Un-cancel'),
687 sub pkg_expire_link {
688 include( '/elements/popup_link-cust_pkg.html',
689 'action' => $p. 'misc/cancel_pkg.html?method=expire',
690 'label' => emt('Cancel later'),
691 'actionlabel' => emt('Expire'),
692 'color' => '#CC0000',
697 sub pkg_change_later_link {
698 my $cust_pkg = shift;
699 include( '/elements/popup_link-cust_pkg.html',
700 'action' => $p . 'misc/change_pkg.cgi?',
701 'label' => emt('Reschedule'),
702 'actionlabel' => emt('Edit scheduled change for'),
703 'cust_pkg' => $cust_pkg,
709 sub svc_recharge_link {
710 include( '/elements/popup_link-cust_svc.html',
711 'action' => $p. 'misc/recharge_svc.html',
712 'label' => emt('Recharge'),
713 'actionlabel' => emt('Recharge'),
714 'color' => '#333399',
719 sub pkg_autosuspend_time {
720 my $cust_pkg = shift or return '';
723 my $pending_suspend = 0;
724 #this seems to be extremely inefficient... and is slowing down all customer
728 grep { $_->part_event->action eq 'suspend' }
729 @{$cust_pkg->cust_main->due_cust_event( time => $time + 86400*$days,
735 $pending_suspend = 1;
739 $pending_suspend ? time + ($days + 1) * 86400 : '';