diff options
author | ivan <ivan> | 2010-01-30 08:55:12 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-01-30 08:55:12 +0000 |
commit | 2d5f9e43a60773a9b079e96c330cb9e0e089800a (patch) | |
tree | 999756a0c9f3b1f6db2347925091f7e6d0e54ce5 /httemplate/view/cust_main/packages/status.html | |
parent | 76722f634186b9e6f164640700029e6f1bee5722 (diff) |
discounts, RT#6679
Diffstat (limited to 'httemplate/view/cust_main/packages/status.html')
-rw-r--r-- | httemplate/view/cust_main/packages/status.html | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 6667a554d..40d6438f3 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -42,6 +42,8 @@ ) %> + <% 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 { @@ -70,10 +72,12 @@ % % 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' ), @@ -94,7 +98,9 @@ % } 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) %> @@ -108,6 +114,8 @@ <% pkg_status_row($cust_pkg, 'Billed', 'setup', %opt) %> + <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %> + % } else { % % if (scalar($cust_pkg->overlimit)) { @@ -130,6 +138,8 @@ %> % } + <% pkg_status_row_discount( $cust_pkg, %opt, 'colspan'=>$colspan ) %> + <% pkg_status_row($cust_pkg, 'Setup', 'setup', %opt) %> % } @@ -273,12 +283,37 @@ sub pkg_status_row_changed { '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; + + $html .= pkg_status_row_colspan( $cust_pkg, $label, '', + 'colspan' => $opt{'colspan'}, + #%opt, + ); + + } + + $html; +} + sub pkg_status_row_colspan { my($cust_pkg, $title, $addl, %opt) = @_; |