diff options
| author | Mark Wells <mark@freeside.biz> | 2015-10-16 15:32:32 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2015-10-16 15:47:47 -0700 |
| commit | f641486e28214ad1eca18c47d2252701b83614f1 (patch) | |
| tree | bc52ae1fedb9e088d5690940480bddd0ea5c8b6c /httemplate/search | |
| parent | b6f16a22bd93ec66ffbb1da30e63f7e950b3b819 (diff) | |
separate setup and recur discounts, #14092
Diffstat (limited to 'httemplate/search')
| -rw-r--r-- | httemplate/search/cust_bill_pkg_discount.html | 11 | ||||
| -rw-r--r-- | httemplate/search/cust_pkg_discount.html | 9 |
2 files changed, 14 insertions, 6 deletions
diff --git a/httemplate/search/cust_bill_pkg_discount.html b/httemplate/search/cust_bill_pkg_discount.html index 6da5787a0..c63482827 100644 --- a/httemplate/search/cust_bill_pkg_discount.html +++ b/httemplate/search/cust_bill_pkg_discount.html @@ -20,9 +20,7 @@ sub { $_[0]->cust_pkg_discount->discount->description }, sub { $_[0]->cust_pkg_discount->discount->classname }, sub { sprintf($money_char.'%.2f', shift->amount ) }, - sub { my $m = shift->months; - $m =~ /\./ ? sprintf('%.2f', $m) : $m; - }, + $months_sub, 'pkg',#sub { $_[0]->cust_bill_pkg->cust_pkg->part_pkg->pkg }, 'invnum', sub { time2str('%b %d %Y', shift->_date ) }, @@ -218,4 +216,11 @@ my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ]; my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; +my $months_sub = sub { + my $cust_bill_pkg_discount = shift; + return 'Setup' + if $cust_bill_pkg_discount->cust_pkg_discount->setuprecur eq 'setup'; + sprintf('%.2f', $cust_bill_pkg_discount->months); +}; + </%init> diff --git a/httemplate/search/cust_pkg_discount.html b/httemplate/search/cust_pkg_discount.html index f0c7447a5..ab6ad2bd0 100644 --- a/httemplate/search/cust_pkg_discount.html +++ b/httemplate/search/cust_pkg_discount.html @@ -18,9 +18,7 @@ sub { ucfirst( shift->status ) }, sub { shift->discount->description }, sub { shift->discount->classname }, - sub { my $m = shift->months_used; - $m =~ /\./ ? sprintf('%.2f',$m) : $m; - }, + $months_used_sub, 'otaker', 'pkg', \&FS::UI::Web::cust_fields, @@ -165,4 +163,9 @@ my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ]; my $conf = new FS::Conf; +my $months_used_sub = sub { + my $cust_pkg_discount = shift; + return 'Setup only' if $cust_pkg_discount->setuprecur eq 'setup'; + return sprintf('%.2f', $cust_pkg_discount->months_used); +}; </%init> |
