+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 );
+
+ }
+
+ $html;
+}
+
+sub pkg_reason_row {
+ my ($cust_pkg, $cpr, %opt) = @_;
+ return '' if $cust_pkg->main_pkgnum;
+
+ my $reasontext = '';
+ $reasontext = $cpr->reasontext . ' by ' . $cpr->otaker if $cpr;
+ pkg_status_row_colspan( $cust_pkg, $reasontext, '',
+ 'align'=>'right', 'size'=>'-2', %opt
+ );
+}
+