[freeside-commits] freeside/FS/FS cust_bill_event.pm, 1.16, 1.16.4.1 cust_bill.pm, 1.263.2.9, 1.263.2.10 cust_event.pm, 1.7.2.1, 1.7.2.2 cust_main.pm, 1.464.2.10, 1.464.2.11 cust_pkg.pm, 1.139.2.4, 1.139.2.5
Ivan,,,
ivan at wavetail.420.am
Thu Dec 3 20:40:46 PST 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv29580/FS/FS
Modified Files:
Tag: FREESIDE_1_9_BRANCH
cust_bill_event.pm cust_bill.pm cust_event.pm cust_main.pm
cust_pkg.pm
Log Message:
customer-specific account report (and some small refactoring of method names to clash less), RT#6180
Index: cust_event.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_event.pm,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -u -d -r1.7.2.1 -r1.7.2.2
--- cust_event.pm 30 Oct 2009 23:30:13 -0000 1.7.2.1
+++ cust_event.pm 4 Dec 2009 04:40:43 -0000 1.7.2.2
@@ -315,7 +315,7 @@
}
-=item search_sql HASHREF
+=item search_sql_where HASHREF
Class method which returns an SQL WHERE fragment to search for parameters
specified in HASHREF. Valid parameters are
@@ -347,10 +347,10 @@
#Note: validates all passed-in data; i.e. safe to use with unchecked CGI params.
#sub
-sub search_sql {
+sub search_sql_where {
my($class, $param) = @_;
if ( $DEBUG ) {
- warn "$me search_sql called with params: \n".
+ warn "$me search_sql_where called with params: \n".
join("\n", map { " $_: ". $param->{$_} } keys %$param ). "\n";
}
@@ -448,7 +448,7 @@
sub re_X {
my($method, $param, $job) = @_;
- my $search_sql = FS::cust_event->search_sql($param);
+ my $search_sql = FS::cust_event->search_sql_where($param);
#maybe not...? we do want the "re-" action to match the search more closely
# # yuck! hardcoded *AND* sequential scans!
Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.263.2.9
retrieving revision 1.263.2.10
diff -u -d -r1.263.2.9 -r1.263.2.10
--- cust_bill.pm 1 Dec 2009 19:17:37 -0000 1.263.2.9
+++ cust_bill.pm 4 Dec 2009 04:40:43 -0000 1.263.2.10
@@ -4223,7 +4223,7 @@
my $distinct = '';
my $orderby = 'ORDER BY cust_bill._date';
- my $extra_sql = ' WHERE '. FS::cust_bill->search_sql(\%param);
+ my $extra_sql = ' WHERE '. FS::cust_bill->search_sql_where(\%param);
my $addl_from = 'LEFT JOIN cust_main USING ( custnum )';
@@ -4313,7 +4313,7 @@
WHERE cust_bill.invnum = cust_credit_bill.invnum )";
}
-=item search_sql HASHREF
+=item search_sql_where HASHREF
Class method which returns an SQL WHERE fragment to search for parameters
specified in HASHREF. Valid parameters are
@@ -4356,10 +4356,10 @@
=cut
-sub search_sql {
+sub search_sql_where {
my($class, $param) = @_;
if ( $DEBUG ) {
- warn "$me search_sql called with params: \n".
+ warn "$me search_sql_where called with params: \n".
join("\n", map { " $_: ". $param->{$_} } keys %$param ). "\n";
}
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.464.2.10
retrieving revision 1.464.2.11
diff -u -d -r1.464.2.10 -r1.464.2.11
--- cust_main.pm 30 Nov 2009 00:38:11 -0000 1.464.2.10
+++ cust_main.pm 4 Dec 2009 04:40:43 -0000 1.464.2.11
@@ -8153,7 +8153,7 @@
}
-=item search_sql HASHREF
+=item search HASHREF
(Class method)
@@ -8196,7 +8196,7 @@
=cut
-sub search_sql {
+sub search {
my ($class, $params) = @_;
my $dbh = dbh;
@@ -8396,13 +8396,13 @@
}
-=item email_search_sql HASHREF
+=item email_search_result HASHREF
(Class method)
Emails a notice to the specified customers.
-Valid parameters are those of the L<search_sql> method, plus the following:
+Valid parameters are those of the L<search> method, plus the following:
=over 4
@@ -8436,7 +8436,7 @@
=cut
-sub email_search_sql {
+sub email_search_result {
my($class, $params) = @_;
my $from = delete $params->{from};
@@ -8449,7 +8449,7 @@
$params->{'payby'} = [ split(/\0/, $params->{'payby'}) ]
unless ref($params->{'payby'});
- my $sql_query = $class->search_sql($params);
+ my $sql_query = $class->search($params);
my $count_query = delete($sql_query->{'count_query'});
my $count_sth = dbh->prepare($count_query)
@@ -8501,7 +8501,7 @@
use Storable qw(thaw);
use Data::Dumper;
use MIME::Base64;
-sub process_email_search_sql {
+sub process_email_search_result {
my $job = shift;
#warn "$me process_re_X $method for job $job\n" if $DEBUG;
@@ -8513,7 +8513,7 @@
$param->{'payby'} = [ split(/\0/, $param->{'payby'}) ]
unless ref($param->{'payby'});
- my $error = FS::cust_main->email_search_sql( $param );
+ my $error = FS::cust_main->email_search_result( $param );
die $error if $error;
}
@@ -8792,7 +8792,7 @@
#getting complaints searches are not returning enough
unless ( @cust_main && $skip_fuzzy || $conf->exists('disable-fuzzy') ) {
- #still some false laziness w/search_sql (was search/cust_main.cgi)
+ #still some false laziness w/search (was search/cust_main.cgi)
#substring
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.139.2.4
retrieving revision 1.139.2.5
diff -u -d -r1.139.2.4 -r1.139.2.5
--- cust_pkg.pm 29 Nov 2009 23:18:09 -0000 1.139.2.4
+++ cust_pkg.pm 4 Dec 2009 04:40:44 -0000 1.139.2.5
@@ -2291,7 +2291,7 @@
"cust_pkg.cancel IS NOT NULL AND cust_pkg.cancel != 0";
}
-=item search_sql HASHREF
+=item search HASHREF
(Class method)
@@ -2364,7 +2364,7 @@
=cut
-sub search_sql {
+sub search {
my ($class, $params) = @_;
my @where = ();
@@ -2593,10 +2593,10 @@
if ($access_user) {
push @where, $access_user->agentnums_sql('table'=>'cust_main');
- }else{
+ } else {
push @where, "1=0";
}
- }else{
+ } else {
push @where, $FS::CurrentUser::CurrentUser->agentnums_sql('table'=>'cust_main');
}
Index: cust_bill_event.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill_event.pm,v
retrieving revision 1.16
retrieving revision 1.16.4.1
diff -u -d -r1.16 -r1.16.4.1
--- cust_bill_event.pm 19 Feb 2008 02:25:19 -0000 1.16
+++ cust_bill_event.pm 4 Dec 2009 04:40:43 -0000 1.16.4.1
@@ -201,7 +201,7 @@
$self->replace($old);
}
-=item search_sql HASHREF
+=item search_sql_where HASHREF
Class method which returns an SQL WHERE fragment to search for parameters
specified in HASHREF. Valid parameters are
@@ -236,7 +236,7 @@
=cut
-sub search_sql {
+sub search_sql_where {
my ($class, $params) = @_;
my @search = ();
@@ -324,7 +324,7 @@
sub re_X {
my($method, $param, $job) = @_;
- my $where = FS::cust_bill_event->search_sql($param);
+ my $where = FS::cust_bill_event->search_sql_where($param);
$where = " WHERE plan LIKE 'send%'". ( $where ? " AND $where" : "" );
my $from = 'LEFT JOIN part_bill_event USING ( eventpart )'.
More information about the freeside-commits
mailing list