projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
69a17ed
)
taqua accountcode billing, part 1 of 2, RT12181
author
levinse
<levinse>
Wed, 27 Apr 2011 05:22:22 +0000
(
05:22
+0000)
committer
levinse
<levinse>
Wed, 27 Apr 2011 05:22:22 +0000
(
05:22
+0000)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/Schema.pm
patch
|
blob
|
history
FS/FS/cust_bill.pm
patch
|
blob
|
history
FS/FS/cust_bill_pkg.pm
patch
|
blob
|
history
FS/FS/cust_bill_pkg_detail.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_cdr.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_inbound.pm
patch
|
blob
|
history
httemplate/edit/cust_main/billing.html
patch
|
blob
|
history
httemplate/view/cust_main/billing.html
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
61cba34
..
331645e
100644
(file)
--- 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.',
'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
983edec
..
cc0f21f
100644
(file)
--- 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, '', '',
'classnum', 'int', 'NULL', '', '', '',
'duration', 'int', 'NULL', '', 0, '',
'phonenum', 'varchar', 'NULL', 15, '', '',
+ 'accountcode', 'varchar', 'NULL', 20, '', '',
'regionname', 'varchar', 'NULL', $char_d, '', '',
'detail', 'varchar', '', 255, '', '',
],
'regionname', 'varchar', 'NULL', $char_d, '', '',
'detail', 'varchar', '', 255, '', '',
],
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
3fbf03b
..
ba5ca24
100644
(file)
--- 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;
}
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' => '' };
}
}else{
push @sections, { 'description' => '', 'subtotal' => '' };
}
@@
-4700,7
+4703,6
@@
sub _items_cust_bill_pkg {
ext_description => \@d,
};
}
ext_description => \@d,
};
}
-
}
} # recurring or usage with recurring charge
}
} # recurring or usage with recurring charge
diff --git
a/FS/FS/cust_bill_pkg.pm
b/FS/FS/cust_bill_pkg.pm
index
791999c
..
37c4a27
100644
(file)
--- 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] : '' ),
'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 ) {
};
$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
7badaa3
..
9ac164c
100644
(file)
--- 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 phonenum -
+=item accountcode - accountcode
+
=item detail - detail description
=back
=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_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')
|| $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
2e165cd
..
5ebe9dd
100644
(file)
--- 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,
$charge,
$classnum,
$phonenum,
+ $cdr->accountcode,
$seconds,
$regionname,
];
$seconds,
$regionname,
];
@@
-752,6
+753,7
@@
sub calc_usage {
$charge,
$classnum,
$phonenum,
$charge,
$classnum,
$phonenum,
+ $cdr->accountcode,
$seconds,
$regionname,
];
$seconds,
$regionname,
];
diff --git
a/FS/FS/part_pkg/voip_inbound.pm
b/FS/FS/part_pkg/voip_inbound.pm
index
e3e6faa
..
d9938c7
100644
(file)
--- 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,
$charge,
$cdr->calltypenum, #classnum
$self->phonenum,
+ $cdr->accountcode,
$seconds,
'', #regionname, not set for inbound calls
];
$seconds,
'', #regionname, not set for inbound calls
];
diff --git
a/httemplate/edit/cust_main/billing.html
b/httemplate/edit/cust_main/billing.html
index
2301a0b
..
884d770
100644
(file)
--- a/
httemplate/edit/cust_main/billing.html
+++ b/
httemplate/edit/cust_main/billing.html
@@
-460,6
+460,20
@@
%>
</TD>
</TR>
%>
</TD>
</TR>
+
+% if ( $conf->exists('voip-cust_accountcode_cdr') ) {
+ <TR>
+ <TD COLSPAN="2">
+ <INPUT TYPE="checkbox"
+ NAME="accountcode_cdr"
+ VALUE="Y"
+ <% $cust_main->accountcode_cdr eq "Y" ? 'CHECKED' : '' %>
+ > Breakdown CDRs by accountcode</TD>
+ </TR>
+% } else {
+ <INPUT TYPE="hidden" NAME="accountcode_cdr" VALUE="<% $cust_main->accountcode_cdr %>">
+% }
+
<TR>
<TD ALIGN="right" WIDTH="200">Credit limit </TD>
<TD WIDTH="408">
<TR>
<TD ALIGN="right" WIDTH="200">Credit limit </TD>
<TD WIDTH="408">
diff --git
a/httemplate/view/cust_main/billing.html
b/httemplate/view/cust_main/billing.html
index
efff3ed
..
c770833
100644
(file)
--- a/
httemplate/view/cust_main/billing.html
+++ b/
httemplate/view/cust_main/billing.html
@@
-238,6
+238,13
@@
Billing information
</TR>
% }
</TR>
% }
+% if ( $conf->exists('voip-cust_accountcode_cdr') ) {
+ <TR>
+ <TD ALIGN="right">Breakdown CDRs by accountcode</TD>
+ <TD BGCOLOR="#ffffff"><% $cust_main->accountcode_cdr ? 'yes' : 'no' %></TD>
+ </TR>
+% }
+
% if ( $conf->exists('voip-cust_email_csv_cdr') ) {
<TR>
<TD ALIGN="right">Email CDRs as CSV</TD>
% if ( $conf->exists('voip-cust_email_csv_cdr') ) {
<TR>
<TD ALIGN="right">Email CDRs as CSV</TD>