projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3cc1613
)
modify invoice DID summary date range calculation, RT10886
author
levinse
<levinse>
Sun, 24 Apr 2011 15:09:11 +0000
(15:09 +0000)
committer
levinse
<levinse>
Sun, 24 Apr 2011 15:09:11 +0000
(15:09 +0000)
FS/FS/cust_bill.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
5d38512
..
3fbf03b
100644
(file)
--- a/
FS/FS/cust_bill.pm
+++ b/
FS/FS/cust_bill.pm
@@
-4062,10
+4062,12
@@
sub _items_extra_usage_sections {
sub _did_summary {
my $self = shift;
my $end = $self->_date;
sub _did_summary {
my $self = shift;
my $end = $self->_date;
- my @cust_bill = sort { $a->_date <=> $b->_date }
- grep { $_->_date < $self->_date }
- qsearch( 'cust_bill', { 'custnum' => $self->custnum } );
- my $start = $cust_bill[-1]->_date+1; # since last invoice
+
+ # start at date of previous invoice + 1 second or 0 if no previous invoice
+ my $start = $self->scalar_sql("SELECT max(_date) FROM cust_bill WHERE custnum = ? and invnum != ?",$self->custnum,$self->invnum);
+ $start = 0 if !$start;
+ $start++;
+
my $cust_main = $self->cust_main;
my @pkgs = $cust_main->all_pkgs;
my($num_activated,$num_deactivated,$num_portedin,$num_portedout,$minutes)
my $cust_main = $self->cust_main;
my @pkgs = $cust_main->all_pkgs;
my($num_activated,$num_deactivated,$num_portedin,$num_portedout,$minutes)