)
%>
+ <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %>
+
% unless ( $cust_pkg->get('setup') ) {
<% pkg_status_row_colspan( $cust_pkg, 'Never billed', '', 'colspan'=>$colspan, %opt ) %>
% } else {
%
% unless ( $cust_pkg->get('setup') ) { #not setup
%
-% unless ( $part_pkg->freq ) {
+% unless ( $part_pkg->freq ) {
<% pkg_status_row_colspan( $cust_pkg, 'Not yet billed (one-time charge)', '', 'colspan'=>$colspan, %opt ) %>
+ <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %>
+
<% pkg_status_row_if(
$cust_pkg,
( $part_pkg->freq ? 'Start billing' : 'Bill on' ),
% } else {
- <% pkg_status_row_colspan($cust_pkg, "Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')', '', 'colspan'=>$colspan, %opt ) %>
+ <% pkg_status_row_colspan($cust_pkg, "Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')', '', 'colspan'=>$colspan, %opt ) %>
+
+ <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %>
<% pkg_status_row_if($cust_pkg, 'Start billing', 'start_date', %opt) %>
<% pkg_status_row($cust_pkg, 'Billed', 'setup', %opt) %>
+ <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %>
+
% } else {
%
% if (scalar($cust_pkg->overlimit)) {
%>
% }
+ <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %>
+
<% pkg_status_row($cust_pkg, 'Setup', 'setup', %opt) %>
% }
'size' => '-1',
'align' => 'right',
'colspan' => $opt{'colspan'},
+ #%opt,
+ );
+ }
+
+ $html;
+}
+
+sub pkg_status_row_discount {
+ my( $cust_pkg, %opt ) = @_;
+
+ my $html;
+
+ foreach my $cust_pkg_discount ( $cust_pkg->cust_pkg_discount_active ) {
+
+ my $discount = $cust_pkg_discount->discount;
+
+ my $label = '<B>Discount</B>: '. $discount->description;
+ $label .= ' ('. ( $discount->months - $cust_pkg_discount->months_used ).
+ ' months remaining)'
+ if $discount->months;
+
+ $label .= ' <FONT SIZE="-1">('.
+ '<A HREF="../misc/delete-cust_pkg_discount.html?'.
+ $cust_pkg_discount->pkgdiscountnum.
+ '">remove discount</A>)</FONT>';
+
+ $html .= pkg_status_row_colspan( $cust_pkg, $label, '',
+ 'colspan' => $opt{'colspan'},
+ #%opt,
);
+
}
$html;