summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg_usageprice.pm
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-01-07 22:55:58 -0800
committerIvan Kohler <ivan@freeside.biz>2014-01-07 22:55:58 -0800
commit4427ad71b12bf27eac2a05d88141a82f9372d03f (patch)
tree77c01abea411f601df63bc2bae722504e03ff5e1 /FS/FS/part_pkg_usageprice.pm
parent76275769ed7ea66b154aef4d2dd00120a53196df (diff)
time/data/etc. unit pricing add-ons, RT#24392
Diffstat (limited to 'FS/FS/part_pkg_usageprice.pm')
-rw-r--r--FS/FS/part_pkg_usageprice.pm33
1 files changed, 33 insertions, 0 deletions
diff --git a/FS/FS/part_pkg_usageprice.pm b/FS/FS/part_pkg_usageprice.pm
index 0fa6bca..88e3870 100644
--- a/FS/FS/part_pkg_usageprice.pm
+++ b/FS/FS/part_pkg_usageprice.pm
@@ -2,6 +2,7 @@ package FS::part_pkg_usageprice;
use base qw( FS::Record );
use strict;
+use Tie::IxHash;
#use FS::Record qw( qsearch qsearchs );
=head1 NAME
@@ -120,6 +121,38 @@ sub check {
$self->SUPER::check;
}
+=item targets
+
+Returns a hash reference. Keys are possible values for the "target" field.
+Values are hash references with "label" and "multiplier" keys.
+
+=cut
+
+sub targets {
+
+ tie my %targets, 'Tie::IxHash', # once?
+ #'svc_acct.totalbytes' => { label => 'Megabytes',
+ # multiplier => 1048576,
+ # },
+ 'svc_acct.totalbytes' => { label => 'Gigabytes',
+ multiplier => 1073741824,
+ },
+ 'svc_acct.seconds' => { label => 'Hours',
+ multiplier => 3600,
+ },
+ 'svc_conferencing.participants' => { label => 'Conference Participants',
+ multiplier=> 1,
+ },
+ #this will take more work: set action, not increment..
+ # and then value comes from a select, not a text field
+ # 'svc_conferencing.confqualitynum' => { label => 'Conference Quality',
+ # },
+ ;
+
+ \%targets;
+
+}
+
=back
=head1 BUGS