projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
98901e4
)
add ability to report on packages w/status "not yet billed" as well, RT#5409
author
ivan
<ivan>
Fri, 22 May 2009 03:02:54 +0000
(
03:02
+0000)
committer
ivan
<ivan>
Fri, 22 May 2009 03:02:54 +0000
(
03:02
+0000)
FS/FS/cust_pkg.pm
patch
|
blob
|
history
httemplate/search/report_cust_pkg.html
patch
|
blob
|
history
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
2589936
..
93aec6d
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-1683,8
+1683,8
@@
tie my %statuscolor, 'Tie::IxHash',
sub statuses {
my $self = shift; #could be class...
sub statuses {
my $self = shift; #could be class...
- grep { $_ !~ /^(not yet billed)$/ } #this is a dumb status anyway
- # mayble split btw one-time vs. recur
+
#
grep { $_ !~ /^(not yet billed)$/ } #this is a dumb status anyway
+
#
# mayble split btw one-time vs. recur
keys %statuscolor;
}
keys %statuscolor;
}
@@
-2087,6
+2087,18
@@
sub active_sql { "
AND ( cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
"; }
AND ( cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
"; }
+=item not_yet_billed_sql
+
+Returns an SQL expression identifying packages which have not yet been billed.
+
+=cut
+
+sub not_yet_billed_sql { "
+ ( cust_pkg.setup IS NULL OR cust_pkg.setup = 0 )
+ AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
+ AND ( cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
+"; }
+
=item inactive_sql
Returns an SQL expression identifying inactive packages (one-time packages
=item inactive_sql
Returns an SQL expression identifying inactive packages (one-time packages
@@
-2096,6
+2108,7
@@
that are otherwise unsuspended/uncancelled).
sub inactive_sql { "
". $_[0]->onetime_sql(). "
sub inactive_sql { "
". $_[0]->onetime_sql(). "
+ AND cust_pkg.setup IS NOT NULL AND cust_pkg.setup != 0
AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
AND ( cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
"; }
AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
AND ( cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
"; }
@@
-2220,8
+2233,13
@@
sub search_sql {
push @where, FS::cust_pkg->active_sql();
push @where, FS::cust_pkg->active_sql();
- } elsif ( $params->{'magic'} eq 'inactive'
- || $params->{'status'} eq 'inactive' ) {
+ } elsif ( $params->{'magic'} eq 'not yet billed'
+ || $params->{'status'} eq 'not yet billed' ) {
+
+ push @where, FS::cust_pkg->not_yet_billed_sql();
+
+ } elsif ( $params->{'magic'} =~ /^(one-time charge|inactive)/
+ || $params->{'status'} =~ /^(one-time charge|inactive)/ ) {
push @where, FS::cust_pkg->inactive_sql();
push @where, FS::cust_pkg->inactive_sql();
@@
-2235,10
+2253,6
@@
sub search_sql {
push @where, FS::cust_pkg->cancelled_sql();
push @where, FS::cust_pkg->cancelled_sql();
- } elsif ( $params->{'status'} =~ /^(one-time charge|inactive)$/ ) {
-
- push @where, FS::cust_pkg->inactive_sql();
-
}
###
}
###
diff --git
a/httemplate/search/report_cust_pkg.html
b/httemplate/search/report_cust_pkg.html
index
aef1c24
..
b5d2d8b
100755
(executable)
--- a/
httemplate/search/report_cust_pkg.html
+++ b/
httemplate/search/report_cust_pkg.html
@@
-129,6
+129,7
@@
my %label = (
#false laziness w/cust_pkg.cgi
my %disable = (
'all' => {},
#false laziness w/cust_pkg.cgi
my %disable = (
'all' => {},
+ 'not yet billed' => { 'setup'=>1, 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
'active' => { 'susp'=>1, 'cancel'=>1 },
'suspended' => { 'cancel' => 1 },
'one-time charge' => { 'last_bill'=>1, 'bill'=>1, 'adjourn'=>1, 'susp'=>1, 'expire'=>1, 'cancel'=>1, },
'active' => { 'susp'=>1, 'cancel'=>1 },
'suspended' => { 'cancel' => 1 },