projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
31c1198
)
accountcode billing, RT12181
author
levinse
<levinse>
Tue, 26 Jul 2011 23:48:01 +0000
(23:48 +0000)
committer
levinse
<levinse>
Tue, 26 Jul 2011 23:48:01 +0000
(23:48 +0000)
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
diff --git
a/FS/FS/Schema.pm
b/FS/FS/Schema.pm
index
6fde8b1
..
49eddf6
100644
(file)
--- a/
FS/FS/Schema.pm
+++ b/
FS/FS/Schema.pm
@@
-701,6
+701,7
@@
sub tables_hashref {
'duration', 'int', 'NULL', '', 0, '',
'phonenum', 'varchar', 'NULL', 15, '', '',
'accountcode', 'varchar', 'NULL', 20, '', '',
'duration', 'int', 'NULL', '', 0, '',
'phonenum', 'varchar', 'NULL', 15, '', '',
'accountcode', 'varchar', 'NULL', 20, '', '',
+ 'startdate', @date_type, '', '',
'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
7669479
..
4ea67b6
100644
(file)
--- a/
FS/FS/cust_bill.pm
+++ b/
FS/FS/cust_bill.pm
@@
-2351,7
+2351,6
@@
notice_name - overrides "Invoice" as the name of the sent document (templates fr
# (alignment in text invoice?) problems to change them all to '%.2f' ?
# yes: fixed width (dot matrix) text printing will be borked
sub print_generic {
# (alignment in text invoice?) problems to change them all to '%.2f' ?
# yes: fixed width (dot matrix) text printing will be borked
sub print_generic {
-
my( $self, %params ) = @_;
my $today = $params{today} ? $params{today} : time;
warn "$me print_generic called on $self with suffix $params{template}\n"
my( $self, %params ) = @_;
my $today = $params{today} ? $params{today} : time;
warn "$me print_generic called on $self with suffix $params{template}\n"
@@
-4222,21
+4221,25
@@
sub _items_accountcode_cdr {
quantity => '',
product_code => 'N/A',
section => $section,
quantity => '',
product_code => 'N/A',
section => $section,
- ext_description => [],
+ ext_description => [ $section->{'header'} ],
+ detail_temp => [],
};
$section->{'amount'} += $amount;
$accountcodes{$accountcode}{'amount'} += $amount;
$accountcodes{$accountcode}{calls}++;
$accountcodes{$accountcode}{duration} += $detail->duration;
};
$section->{'amount'} += $amount;
$accountcodes{$accountcode}{'amount'} += $amount;
$accountcodes{$accountcode}{calls}++;
$accountcodes{$accountcode}{duration} += $detail->duration;
- push @{$accountcodes{$accountcode}{ext_description}},
- $detail->formatted('format' => $format);
+ push @{$accountcodes{$accountcode}{detail_temp}}, $detail;
}
}
foreach my $l ( values %accountcodes ) {
$l->{amount} = sprintf( "%.2f", $l->{amount} );
}
}
foreach my $l ( values %accountcodes ) {
$l->{amount} = sprintf( "%.2f", $l->{amount} );
- unshift @{$l->{ext_description}}, $section->{'header'};
+ my @sorted_detail = sort { $a->startdate <=> $b->startdate } @{$l->{detail_temp}};
+ foreach my $sorted_detail ( @sorted_detail ) {
+ push @{$l->{ext_description}}, $sorted_detail->formatted('format'=>$format);
+ }
+ delete $l->{detail_temp};
push @lines, $l;
}
push @lines, $l;
}
diff --git
a/FS/FS/cust_bill_pkg.pm
b/FS/FS/cust_bill_pkg.pm
index
d332e36
..
29663c5
100644
(file)
--- a/
FS/FS/cust_bill_pkg.pm
+++ b/
FS/FS/cust_bill_pkg.pm
@@
-154,8
+154,9
@@
sub insert {
'classnum' => (ref($detail) ? $detail->[3] : '' ),
'phonenum' => (ref($detail) ? $detail->[4] : '' ),
'accountcode' => (ref($detail) ? $detail->[5] : '' ),
'classnum' => (ref($detail) ? $detail->[3] : '' ),
'phonenum' => (ref($detail) ? $detail->[4] : '' ),
'accountcode' => (ref($detail) ? $detail->[5] : '' ),
- 'duration' => (ref($detail) ? $detail->[6] : '' ),
- 'regionname' => (ref($detail) ? $detail->[7] : '' ),
+ 'startdate' => (ref($detail) ? $detail->[6] : '' ),
+ 'duration' => (ref($detail) ? $detail->[7] : '' ),
+ 'regionname' => (ref($detail) ? $detail->[8] : '' ),
};
$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
9ac164c
..
eb0ae96
100644
(file)
--- a/
FS/FS/cust_bill_pkg_detail.pm
+++ b/
FS/FS/cust_bill_pkg_detail.pm
@@
-57,6
+57,8
@@
inherits from FS::Record. The following fields are currently supported:
=item accountcode - accountcode
=item accountcode - accountcode
+=item startdate - CDR startdate, if any
+
=item detail - detail description
=back
=item detail - detail description
=back
diff --git
a/FS/FS/part_pkg/voip_cdr.pm
b/FS/FS/part_pkg/voip_cdr.pm
index
8363873
..
5f191f2
100644
(file)
--- a/
FS/FS/part_pkg/voip_cdr.pm
+++ b/
FS/FS/part_pkg/voip_cdr.pm
@@
-774,6
+774,7
@@
sub calc_usage {
$classnum,
$phonenum,
$cdr->accountcode,
$classnum,
$phonenum,
$cdr->accountcode,
+ $cdr->startdate,
$seconds,
$regionname,
];
$seconds,
$regionname,
];
@@
-786,6
+787,7
@@
sub calc_usage {
$classnum,
$phonenum,
$cdr->accountcode,
$classnum,
$phonenum,
$cdr->accountcode,
+ $cdr->startdate,
$seconds,
$regionname,
];
$seconds,
$regionname,
];
diff --git
a/FS/FS/part_pkg/voip_inbound.pm
b/FS/FS/part_pkg/voip_inbound.pm
index
a96e978
..
15faf5b
100644
(file)
--- a/
FS/FS/part_pkg/voip_inbound.pm
+++ b/
FS/FS/part_pkg/voip_inbound.pm
@@
-285,6
+285,7
@@
sub calc_usage {
$cdr->calltypenum, #classnum
$self->phonenum,
$cdr->accountcode,
$cdr->calltypenum, #classnum
$self->phonenum,
$cdr->accountcode,
+ $cdr->startdate,
$seconds,
'', #regionname, not set for inbound calls
];
$seconds,
'', #regionname, not set for inbound calls
];