summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/Schema.pm1
-rw-r--r--FS/FS/cust_bill.pm4
-rw-r--r--FS/FS/cust_bill_pkg.pm5
-rw-r--r--FS/FS/cust_bill_pkg_detail.pm3
-rw-r--r--FS/FS/part_pkg/voip_cdr.pm2
-rw-r--r--FS/FS/part_pkg/voip_inbound.pm1
7 files changed, 20 insertions, 3 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 61cba34da..331645ec7 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -2908,6 +2908,13 @@ and customer address. Include units.',
},
{
+ 'key' => 'voip-cust_accountcode_cdr',
+ 'section' => 'telephony',
+ 'description' => 'Enable the per-customer option for CDR breakdown by accountcode.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'voip-cust_cdr_spools',
'section' => 'telephony',
'description' => 'Enable the per-customer option for individual CDR spools.',
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 983edec46..cc0f21ffc 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -691,6 +691,7 @@ sub tables_hashref {
'classnum', 'int', 'NULL', '', '', '',
'duration', 'int', 'NULL', '', 0, '',
'phonenum', 'varchar', 'NULL', 15, '', '',
+ 'accountcode', 'varchar', 'NULL', 20, '', '',
'regionname', 'varchar', 'NULL', $char_d, '', '',
'detail', 'varchar', '', 255, '', '',
],
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 3fbf03bf5..ba5ca2467 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -2829,6 +2829,9 @@ sub print_generic {
push @{$late_sections}, @$phone_sections;
push @detail_items, @$phone_lines;
}
+ if ($conf->exists('voip-cust_accountcode_cdr') && $cust_main->accountcode_cdr) {
+ # XXX: do something not unlike _items_svc_phone_sections, except generate only one section
+ }
}else{
push @sections, { 'description' => '', 'subtotal' => '' };
}
@@ -4700,7 +4703,6 @@ sub _items_cust_bill_pkg {
ext_description => \@d,
};
}
-
}
} # recurring or usage with recurring charge
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 791999c17..37c4a2735 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -153,8 +153,9 @@ sub insert {
'amount' => (ref($detail) ? $detail->[2] : '' ),
'classnum' => (ref($detail) ? $detail->[3] : '' ),
'phonenum' => (ref($detail) ? $detail->[4] : '' ),
- 'duration' => (ref($detail) ? $detail->[5] : '' ),
- 'regionname' => (ref($detail) ? $detail->[6] : '' ),
+ 'accountcode' => (ref($detail) ? $detail->[5] : '' ),
+ 'duration' => (ref($detail) ? $detail->[6] : '' ),
+ 'regionname' => (ref($detail) ? $detail->[7] : '' ),
};
$error = $cust_bill_pkg_detail->insert;
if ( $error ) {
diff --git a/FS/FS/cust_bill_pkg_detail.pm b/FS/FS/cust_bill_pkg_detail.pm
index 7badaa3b9..9ac164ced 100644
--- a/FS/FS/cust_bill_pkg_detail.pm
+++ b/FS/FS/cust_bill_pkg_detail.pm
@@ -55,6 +55,8 @@ inherits from FS::Record. The following fields are currently supported:
=item phonenum -
+=item accountcode - accountcode
+
=item detail - detail description
=back
@@ -137,6 +139,7 @@ sub check {
|| $self->ut_enum('format', [ '', 'C' ] )
|| $self->ut_numbern('duration')
|| $self->ut_textn('regionname')
+ || $self->ut_textn('accountcode')
|| $self->ut_text('detail')
|| $self->ut_foreign_keyn('classnum', 'usage_class', 'classnum')
|| $self->$phonenum_check_method('phonenum')
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index 2e165cd49..5ebe9ddc5 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -741,6 +741,7 @@ sub calc_usage {
$charge,
$classnum,
$phonenum,
+ $cdr->accountcode,
$seconds,
$regionname,
];
@@ -752,6 +753,7 @@ sub calc_usage {
$charge,
$classnum,
$phonenum,
+ $cdr->accountcode,
$seconds,
$regionname,
];
diff --git a/FS/FS/part_pkg/voip_inbound.pm b/FS/FS/part_pkg/voip_inbound.pm
index e3e6faaf7..d9938c79b 100644
--- a/FS/FS/part_pkg/voip_inbound.pm
+++ b/FS/FS/part_pkg/voip_inbound.pm
@@ -270,6 +270,7 @@ sub calc_usage {
$charge,
$cdr->calltypenum, #classnum
$self->phonenum,
+ $cdr->accountcode,
$seconds,
'', #regionname, not set for inbound calls
];