diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2012-03-23 11:21:19 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2012-03-23 11:21:19 -0700 |
| commit | 879ad5135754ec2968e39cf98f7958f0db50d359 (patch) | |
| tree | b078db36bcaf89c11cdccdb755ff662807175c97 /FS | |
| parent | bf4e71db6af0d0a86edcec8b447d8b5444d45f6c (diff) | |
| parent | 9f97c81b19a3184ea68df32aaea43808b22e10f0 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/Report/Table.pm | 18 | ||||
| -rw-r--r-- | FS/FS/cust_main/Search.pm | 9 |
2 files changed, 27 insertions, 0 deletions
diff --git a/FS/FS/Report/Table.pm b/FS/FS/Report/Table.pm index e8971ec7a..3942543b5 100644 --- a/FS/FS/Report/Table.pm +++ b/FS/FS/Report/Table.pm @@ -32,6 +32,24 @@ options in %opt. =over 4 +=item signups: The number of customers signed up. + +=cut + +sub signups { + my( $self, $speriod, $eperiod, $agentnum, %opt ) = @_; + my @where = ( + $self->in_time_period_and_agent($speriod, $eperiod, $agentnum, 'signupdate') + ); + if ( $opt{'refnum'} ) { + push @where, "refnum = ".$opt{'refnum'}; + } + + $self->scalar_sql( + "SELECT COUNT(*) FROM cust_main WHERE ".join(' AND ', @where) + ); +} + =item invoiced: The total amount charged on all invoices. =cut diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index c5b5ff6d0..62464e4aa 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -447,6 +447,8 @@ HASHREF. Valid parameters are =item address +=item refnum + =item cancelled_pkgs bool @@ -553,6 +555,13 @@ sub search { ')'; } + ### + # refnum + ### + if ( $params->{'refnum'} =~ /^(\d+)$/ ) { + push @where, "refnum = $1"; + } + ## # parse cancelled package checkbox ## |
