summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-10-27 12:19:32 -0700
committerMark Wells <mark@freeside.biz>2016-10-27 12:19:49 -0700
commit40f3374957a5b709df2a54a69f7c9883d4b9ca38 (patch)
tree68c542dfb9f5d64a74ade33f1267a8ce731422a0 /FS/FS/part_pkg
parent840c45f3ae5661130f9a6068ae5c9e03c47c9f39 (diff)
add calc_units to plans other than voip_cdr, #39639
Diffstat (limited to 'FS/FS/part_pkg')
-rw-r--r--FS/FS/part_pkg/global_Mixin.pm11
-rw-r--r--FS/FS/part_pkg/voip_cdr.pm25
-rw-r--r--FS/FS/part_pkg/voip_inbound.pm10
3 files changed, 12 insertions, 34 deletions
diff --git a/FS/FS/part_pkg/global_Mixin.pm b/FS/FS/part_pkg/global_Mixin.pm
index e82602e..59eaaaa 100644
--- a/FS/FS/part_pkg/global_Mixin.pm
+++ b/FS/FS/part_pkg/global_Mixin.pm
@@ -30,6 +30,10 @@ sub validate_moneyn {
return '';
}
+tie my %count_available_phones, 'Tie::IxHash', (
+ 0 => 'Provisioned phone services',
+ 1 => 'All available phone services',
+);
%info = (
'disabled' => 1,
@@ -63,6 +67,11 @@ sub validate_moneyn {
'name' => 'Automatic suspension period before cancelling (configuration setting part_pkg-delay_cancel-days)',
'type' => 'checkbox',
},
+ 'count_available_phones' => { 'name' => 'Count taxable phone lines',
+ 'type' => 'radio',
+ 'options' => \%count_available_phones,
+ 'default' => 0,
+ },
# miscellany--maybe put this in a separate module?
@@ -134,6 +143,8 @@ sub validate_moneyn {
unused_credit_change
delay_cancel
+ count_available_phones
+
a2billing_tariff
a2billing_type
a2billing_simultaccess
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index 420026d..9ecdba6 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -289,10 +289,6 @@ tie my %accountcode_tollfree_field, 'Tie::IxHash',
'type' => 'checkbox',
},
- 'count_available_phones' => { 'name' => 'Consider for tax purposes the number of lines to be svc_phones that may be provisioned rather than those that actually are.',
- 'type' => 'checkbox',
- },
-
#XXX also have option for an external db? these days we suck them into ours
# 'cdr_location' => { 'name' => 'CDR database location'
# 'type' => 'select',
@@ -353,7 +349,7 @@ tie my %accountcode_tollfree_field, 'Tie::IxHash',
usage_mandate usage_section summarize_usage
usage_showzero bill_every_call bill_inactive_svcs
bill_only_pkg_dates
- count_available_phones suspend_bill
+ suspend_bill
)
],
'weight' => 41,
@@ -656,25 +652,6 @@ sub is_free {
0;
}
-# This equates svc_phone records; perhaps svc_phone should have a field
-# to indicate it represents a line
-sub calc_units {
- my($self, $cust_pkg ) = @_;
- my $count = 0;
- if ( $self->option('count_available_phones', 1)) {
- foreach my $pkg_svc ($cust_pkg->part_pkg->pkg_svc) {
- if ($pkg_svc->part_svc->svcdb eq 'svc_phone') { # svc_pbx?
- $count += $pkg_svc->quantity || 0;
- }
- }
- $count *= $cust_pkg->quantity;
- } else {
- $count =
- scalar(grep { $_->part_svc->svcdb eq 'svc_phone' } $cust_pkg->cust_svc);
- }
- $count;
-}
-
sub reset_usage {
my ($self, $cust_pkg, %opt) = @_;
my @part_pkg_usage = $self->part_pkg_usage or return '';
diff --git a/FS/FS/part_pkg/voip_inbound.pm b/FS/FS/part_pkg/voip_inbound.pm
index e911439..15af706 100644
--- a/FS/FS/part_pkg/voip_inbound.pm
+++ b/FS/FS/part_pkg/voip_inbound.pm
@@ -399,15 +399,5 @@ sub is_free {
0;
}
-# This equates svc_phone records; perhaps svc_phone should have a field
-# to indicate it represents a line
-# #XXX no count_available_phones?
-sub calc_units {
- my($self, $cust_pkg ) = @_;
- my $count =
- scalar(grep { $_->part_svc->svcdb eq 'svc_phone' } $cust_pkg->cust_svc);
- $count;
-}
-
1;