+
+ $html;
+}
+
+sub pkg_status_row_detached {
+ my( $cust_pkg, %opt ) = @_;
+
+ return '' unless $cust_pkg->change_custnum;
+
+ my $html = '';
+
+ my $cust_main = $cust_pkg->change_cust_main;
+ if ( $cust_main ) {
+
+ my $cust_link = '<A HREF="cust_main.cgi?'. $cust_pkg->change_custnum. '">'.
+ encode_entities( $cust_main->name ).
+ '</A>';
+
+ my $what = $opt{'pkg_attached'} ? 'Attached' : 'Detached';
+
+ $html .= pkg_status_row_colspan( $cust_pkg,
+ emt("$what to customer #[_1]: ",
+ $cust_pkg->change_custnum
+ ).
+ $cust_link,
+ '',
+ 'size' => '-1',
+ 'align' => 'right',
+ 'colspan' => 4,
+ );
+ }
+
+ $html;
+}
+
+sub pkg_status_row_noauto {
+ my( $cust_pkg, %opt ) = @_;
+
+ return '' unless ( $cust_pkg->no_auto || $opt{'part_pkg'}->no_auto )
+ && $opt{'has_cust_payby_auto'};
+
+ pkg_status_row_colspan( $cust_pkg, emt("No automatic charge"), '');
+}
+
+sub pkg_status_row_separate_bill {
+ my $cust_pkg = shift;
+ return '' unless $cust_pkg->separate_bill;
+ pkg_status_row_colspan( $cust_pkg, emt("Invoiced separately") );
+}
+
+sub pkg_status_row_discount {
+ my( $cust_pkg, %opt ) = @_;
+
+ my $html;
+
+ if ( $cust_pkg->waive_setup ) {
+ my $label = '<SPAN STYLE="font-size: small;font-weight: bold">' .
+ emt('Setup fee waived') .
+ '</SPAN>';
+ $html .= pkg_status_row_colspan( $cust_pkg, $label, '', %opt );
+ }
+
+ foreach my $cust_pkg_discount (@{ $cust_pkg->{_cust_pkg_discount_active} }) {
+
+ my $discount = $cust_pkg_discount->discount;
+
+ my $label = '<SPAN STYLE="font-size: small"><B>';
+ if ( $cust_pkg_discount->setuprecur eq 'setup' ) {
+ $label .= emt('Setup Discount');
+ } else {
+ $label .= emt('Recurring Discount');
+ }
+ $label .= '</B>: '. $discount->description;
+ if ( $discount->months > 0 and $cust_pkg_discount->months_used > 0 ) {
+ my $remaining = $discount->months - $cust_pkg_discount->months_used;
+ $remaining = sprintf('%.2f', $remaining) if $remaining =~ /\./;
+ $label .= <br> . emt(" ([quant,_1,month,months] remaining)",$remaining);
+ }
+ $label .= '</SPAN>';
+
+ #$label .= ' <FONT SIZE="-1">('.
+ # '<A HREF="../misc/delete-cust_pkg_discount.html?'.
+ # $cust_pkg_discount->pkgdiscountnum.
+ # '">'.emt('remove discount').'</A>)</FONT>';
+
+ $html .= pkg_status_row_colspan( $cust_pkg, $label, '', %opt );
+
+ }
+