summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorlevinse <levinse>2011-02-12 04:58:35 +0000
committerlevinse <levinse>2011-02-12 04:58:35 +0000
commit5fa2ec5b24f52ddb14e569970ccb8a24cadbc6b1 (patch)
tree7a94b354798ec354e239bcbf826b682017161a99 /FS
parent5d1c873c38990030fc082294ff728518460ccead (diff)
show package pricing details on customer view, RT11372
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_pkg.pm2
-rw-r--r--FS/FS/part_pkg/base_rate.pm14
-rw-r--r--FS/FS/part_pkg/bulk.pm17
-rw-r--r--FS/FS/part_pkg/flat.pm13
-rw-r--r--FS/FS/part_pkg/flat_comission.pm8
-rw-r--r--FS/FS/part_pkg/rt_time.pm8
-rw-r--r--FS/FS/part_pkg/sesmon_hour.pm7
-rw-r--r--FS/FS/part_pkg/sesmon_minute.pm6
-rw-r--r--FS/FS/part_pkg/sql_external.pm7
-rw-r--r--FS/FS/part_pkg/sql_generic.pm7
-rw-r--r--FS/FS/part_pkg/sqlradacct_hour.pm7
-rw-r--r--FS/FS/part_pkg/torrus_Common.pm7
-rw-r--r--FS/FS/part_pkg/voip_cdr.pm7
-rw-r--r--FS/FS/part_pkg/voip_inbound.pm7
-rw-r--r--FS/FS/part_pkg/voip_sqlradacct.pm7
15 files changed, 123 insertions, 1 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
index f4aacaeec..9f231780a 100644
--- a/FS/FS/part_pkg.pm
+++ b/FS/FS/part_pkg.pm
@@ -607,7 +607,7 @@ sub pkg_comment {
sub custom_comment {
my $self = shift;
- ( $self->custom ? '(CUSTOM) ' : '' ). $self->comment;
+ ( $self->custom ? '(CUSTOM) ' : '' ). $self->comment . ' ' . $self->price_info;
}
=item pkg_class
diff --git a/FS/FS/part_pkg/base_rate.pm b/FS/FS/part_pkg/base_rate.pm
index 678197799..43a050610 100644
--- a/FS/FS/part_pkg/base_rate.pm
+++ b/FS/FS/part_pkg/base_rate.pm
@@ -22,6 +22,20 @@ use FS::part_pkg;
'weight' => 52,
);
+sub price_info {
+ my $self = shift;
+ my $conf = new FS::Conf;
+ my $money_char = $conf->config('money_char') || '$';
+ my $setup = $self->option('setup_fee') || 0;
+ my $recur = $self->option('recur_fee', 1) || 0;
+ my $str = '';
+ $str = $money_char . $setup . ' one-time' if $setup;
+ $str .= ', ' if ($setup && $recur);
+ $str .= $money_char . $recur . ' recurring per unit ' if $recur;
+ $str;
+}
+
+
sub calc_setup {
my($self, $cust_pkg, $sdate, $details ) = @_;
diff --git a/FS/FS/part_pkg/bulk.pm b/FS/FS/part_pkg/bulk.pm
index beee06913..4ac73892c 100644
--- a/FS/FS/part_pkg/bulk.pm
+++ b/FS/FS/part_pkg/bulk.pm
@@ -4,6 +4,7 @@ use strict;
use vars qw(@ISA $DEBUG $me %info);
use Date::Format;
use FS::part_pkg::flat;
+use FS::Conf;
@ISA = qw(FS::part_pkg::flat);
@@ -34,6 +35,22 @@ $me = '[FS::part_pkg::bulk]';
'weight' => 50,
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ my $svc_setup_fee = $self->option('svc_setup_fee');
+ my $svc_recur_fee = $self->option('svc_recur_fee');
+ my $conf = new FS::Conf;
+ my $money_char = $conf->config('money_char') || '$';
+ $str .= " , bulk" if $str;
+ $str .= ": $money_char" . $svc_setup_fee . " one-time per service"
+ if $svc_setup_fee;
+ $str .= ", " if ($svc_setup_fee && $svc_recur_fee);
+ $str .= $money_char . $svc_recur_fee . " recurring per service"
+ if $svc_recur_fee;
+ $str;
+}
+
#some false laziness-ish w/agent.pm... not a lot
sub calc_recur {
my($self, $cust_pkg, $sdate, $details ) = @_;
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index 60a2346ac..f5a2100b9 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -82,6 +82,19 @@ tie my %contract_years, 'Tie::IxHash', (
'weight' => 10,
);
+sub price_info {
+ my $self = shift;
+ my $conf = new FS::Conf;
+ my $money_char = $conf->config('money_char') || '$';
+ my $setup = $self->option('setup_fee') || 0;
+ my $recur = $self->option('recur_fee', 1) || 0;
+ my $str = '';
+ $str = $money_char . $setup . ' one-time' if $setup;
+ $str .= ', ' if ($setup && $recur);
+ $str .= $money_char . $recur . ' recurring ' if $recur;
+ $str;
+}
+
sub calc_setup {
my($self, $cust_pkg, $sdate, $details ) = @_;
diff --git a/FS/FS/part_pkg/flat_comission.pm b/FS/FS/part_pkg/flat_comission.pm
index ec8c8ebbc..0bc1e7cb4 100644
--- a/FS/FS/part_pkg/flat_comission.pm
+++ b/FS/FS/part_pkg/flat_comission.pm
@@ -32,6 +32,14 @@ use FS::part_pkg::flat;
'weight' => 62,
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ my $com = $self->option('comission_amount');
+ $str .= ", $com commission" if $com;
+ $str;
+}
+
sub calc_recur {
my($self, $cust_pkg ) = @_;
diff --git a/FS/FS/part_pkg/rt_time.pm b/FS/FS/part_pkg/rt_time.pm
index 03ed1cde7..37891e245 100644
--- a/FS/FS/part_pkg/rt_time.pm
+++ b/FS/FS/part_pkg/rt_time.pm
@@ -24,6 +24,14 @@ our %info = (
'fieldorder' => [ 'base_rate' ],
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ my $rate = $self->option('base_rate');
+ $str .= " plus $rate/min" if $rate;
+ $str;
+}
+
sub calc_setup {
my($self, $cust_pkg ) = @_;
$self->option('setup_fee');
diff --git a/FS/FS/part_pkg/sesmon_hour.pm b/FS/FS/part_pkg/sesmon_hour.pm
index a57b1591a..8d019c306 100644
--- a/FS/FS/part_pkg/sesmon_hour.pm
+++ b/FS/FS/part_pkg/sesmon_hour.pm
@@ -26,6 +26,13 @@ use FS::part_pkg::flat;
'weight' => 80,
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus usage" if $str;
+ $str;
+}
+
sub calc_recur {
my($self, $cust_pkg ) = @_;
diff --git a/FS/FS/part_pkg/sesmon_minute.pm b/FS/FS/part_pkg/sesmon_minute.pm
index 8c9ef03cf..b86cffd76 100644
--- a/FS/FS/part_pkg/sesmon_minute.pm
+++ b/FS/FS/part_pkg/sesmon_minute.pm
@@ -26,6 +26,12 @@ use FS::part_pkg::flat;
'weight' => 80,
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus usage" if $str;
+ $str;
+}
sub calc_recur {
my( $self, $cust_pkg ) = @);
diff --git a/FS/FS/part_pkg/sql_external.pm b/FS/FS/part_pkg/sql_external.pm
index 718548771..c0c57251b 100644
--- a/FS/FS/part_pkg/sql_external.pm
+++ b/FS/FS/part_pkg/sql_external.pm
@@ -45,6 +45,13 @@ use DBI;
'weight' => '58',
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus per-service charges" if $str;
+ $str;
+}
+
sub calc_recur {
my $self = shift;
my($cust_pkg, $sdate, $details, $param ) = @_;
diff --git a/FS/FS/part_pkg/sql_generic.pm b/FS/FS/part_pkg/sql_generic.pm
index cf38257fa..e323d8b5b 100644
--- a/FS/FS/part_pkg/sql_generic.pm
+++ b/FS/FS/part_pkg/sql_generic.pm
@@ -40,6 +40,13 @@ use FS::part_pkg::flat;
'weight' => '56',
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus per-service charges" if $str;
+ $str;
+}
+
sub calc_recur {
my($self, $cust_pkg ) = @_;
diff --git a/FS/FS/part_pkg/sqlradacct_hour.pm b/FS/FS/part_pkg/sqlradacct_hour.pm
index 3cc46acc4..1c198a1c2 100644
--- a/FS/FS/part_pkg/sqlradacct_hour.pm
+++ b/FS/FS/part_pkg/sqlradacct_hour.pm
@@ -73,6 +73,13 @@ use FS::part_pkg::flat;
'weight' => 40,
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus usage" if $str;
+ $str;
+}
+
sub calc_recur {
my($self, $cust_pkg, $sdate, $details ) = @_;
diff --git a/FS/FS/part_pkg/torrus_Common.pm b/FS/FS/part_pkg/torrus_Common.pm
index 66624ada0..2eda725f7 100644
--- a/FS/FS/part_pkg/torrus_Common.pm
+++ b/FS/FS/part_pkg/torrus_Common.pm
@@ -7,6 +7,13 @@ our %info = ( 'disabled' => 1 ); #torrus_Common not a usable price plan directly
our $DEBUG = 1;
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus usage" if $str;
+ $str;
+}
+
sub calc_recur {
my $self = shift;
my($cust_pkg, $sdate, $details, $param ) = @_;
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index 942ac6a5e..0ca319c2f 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -278,6 +278,13 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
'weight' => 40,
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus usage" if $str;
+ $str;
+}
+
sub calc_setup {
my($self, $cust_pkg ) = @_;
$self->option('setup_fee');
diff --git a/FS/FS/part_pkg/voip_inbound.pm b/FS/FS/part_pkg/voip_inbound.pm
index 1b91575d4..36efad1ae 100644
--- a/FS/FS/part_pkg/voip_inbound.pm
+++ b/FS/FS/part_pkg/voip_inbound.pm
@@ -160,6 +160,13 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
'weight' => 40,
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus usage" if $str;
+ $str;
+}
+
sub calc_setup {
my($self, $cust_pkg ) = @_;
$self->option('setup_fee');
diff --git a/FS/FS/part_pkg/voip_sqlradacct.pm b/FS/FS/part_pkg/voip_sqlradacct.pm
index 538876712..b856b5cda 100644
--- a/FS/FS/part_pkg/voip_sqlradacct.pm
+++ b/FS/FS/part_pkg/voip_sqlradacct.pm
@@ -29,6 +29,13 @@ $DEBUG = 1;
'weight' => 40,
);
+sub price_info {
+ my $self = shift;
+ my $str = $self->SUPER::price_info;
+ $str .= " plus usage" if $str;
+ $str;
+}
+
sub calc_setup {
my($self, $cust_pkg ) = @_;
$self->option('setup_fee');