[freeside-commits] freeside/FS/FS Mason.pm, 1.31, 1.32 cust_main.pm, 1.500, 1.501
Mark Wells
mark at wavetail.420.am
Mon Mar 29 02:18:24 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv3249/FS/FS
Modified Files:
Mason.pm cust_main.pm
Log Message:
RT#884: search customers by signup time of day
Index: Mason.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Mason.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -w -d -r1.31 -r1.32
--- Mason.pm 25 Mar 2010 01:37:19 -0000 1.31
+++ Mason.pm 29 Mar 2010 09:18:21 -0000 1.32
@@ -102,6 +102,7 @@
use String::Approx qw(amatch);
use Chart::LinesPoints;
use Chart::Mountain;
+ use Chart::Bars;
use Color::Scheme;
use HTML::Widgets::SelectLayers 0.07; #should go away in favor of
#selectlayers.html
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.500
retrieving revision 1.501
diff -u -w -d -r1.500 -r1.501
--- cust_main.pm 29 Mar 2010 00:23:07 -0000 1.500
+++ cust_main.pm 29 Mar 2010 09:18:22 -0000 1.501
@@ -8522,6 +8522,15 @@
}
##
+ # do the same for user
+ ##
+
+ if ( $params->{'usernum'} =~ /^(\d+)$/ and $1 ) {
+ push @where,
+ "cust_main.usernum = $1";
+ }
+
+ ##
# parse status
##
@@ -8556,13 +8565,23 @@
next unless exists($params->{$field});
- my($beginning, $ending) = @{$params->{$field}};
+ my($beginning, $ending, $hour) = @{$params->{$field}};
push @where,
"cust_main.$field IS NOT NULL",
"cust_main.$field >= $beginning",
"cust_main.$field <= $ending";
+ # XXX: do this for mysql and/or pull it out of here
+ if(defined $hour) {
+ if ($dbh->{Driver}->{Name} eq 'Pg') {
+ push @where, "extract(hour from to_timestamp(cust_main.$field)) = $hour";
+ }
+ else {
+ warn "search by time of day not supported on ".$dbh->{Driver}->{Name}." databases";
+ }
+ }
+
$orderby ||= "ORDER BY cust_main.$field";
}
More information about the freeside-commits
mailing list