[freeside-commits] freeside/FS/FS cust_bill_event.pm, 1.16, 1.17 cust_bill.pm, 1.272, 1.273 cust_event.pm, 1.8, 1.9 cust_main.pm, 1.480, 1.481 cust_pkg.pm, 1.144, 1.145
Ivan,,,
ivan at wavetail.420.am
Thu Dec 3 20:40:30 PST 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv29572/FS/FS
Modified Files:
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.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cust_event.pm 30 Oct 2009 23:29:18 -0000 1.8
+++ cust_event.pm 4 Dec 2009 04:40:28 -0000 1.9
@@ -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.272
retrieving revision 1.273
diff -u -d -r1.272 -r1.273
--- cust_bill.pm 1 Dec 2009 19:16:39 -0000 1.272
+++ cust_bill.pm 4 Dec 2009 04:40:27 -0000 1.273
@@ -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.480
retrieving revision 1.481
diff -u -d -r1.480 -r1.481
--- cust_main.pm 30 Nov 2009 00:38:10 -0000 1.480
+++ cust_main.pm 4 Dec 2009 04:40:28 -0000 1.481
@@ -8264,7 +8264,7 @@
}
-=item search_sql HASHREF
+=item search HASHREF
(Class method)
@@ -8307,7 +8307,7 @@
=cut
-sub search_sql {
+sub search {
my ($class, $params) = @_;
my $dbh = dbh;
@@ -8522,13 +8522,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
@@ -8562,7 +8562,7 @@
=cut
-sub email_search_sql {
+sub email_search_result {
my($class, $params) = @_;
my $from = delete $params->{from};
@@ -8575,7 +8575,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)
@@ -8627,7 +8627,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;
@@ -8639,7 +8639,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;
}
@@ -8918,7 +8918,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.144
retrieving revision 1.145
diff -u -d -r1.144 -r1.145
--- cust_pkg.pm 4 Dec 2009 03:23:20 -0000 1.144
+++ cust_pkg.pm 4 Dec 2009 04:40:28 -0000 1.145
@@ -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.17
diff -u -d -r1.16 -r1.17
--- cust_bill_event.pm 19 Feb 2008 02:25:19 -0000 1.16
+++ cust_bill_event.pm 4 Dec 2009 04:40:27 -0000 1.17
@@ -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