[freeside-commits] freeside/FS/FS/part_event/Condition balance_age.pm, 1.1, 1.2 cust_bill_age.pm, 1.1, 1.2
Ivan,,,
ivan at wavetail.420.am
Mon Oct 29 03:31:33 PDT 2007
Update of /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition
In directory wavetail:/tmp/cvs-serv24240/FS/FS/part_event/Condition
Modified Files:
balance_age.pm cust_bill_age.pm
Log Message:
mysql me 1.9 more times
Index: balance_age.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition/balance_age.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- balance_age.pm 1 Aug 2007 22:24:39 -0000 1.1
+++ balance_age.pm 29 Oct 2007 10:31:31 -0000 1.2
@@ -56,26 +56,20 @@
sub condition_sql {
my( $class, $table, %opt ) = @_;
- my $time = $opt{'time'};
-
- my $over = $class->condition_sql_option('balance');
- my $age = $class->condition_sql_option('age');
- my $age_sql =
- "$time - EXTRACT( EPOCH FROM REPLACE( $age, 'm', 'mon')::interval )";
+ my $over = $class->condition_sql_option('balance');
+ my $age = $class->condition_sql_option_age_from('age', $opt{'time'});
- my $balance_sql = FS::cust_main->balance_date_sql( $age_sql );
+ my $balance_sql = FS::cust_main->balance_date_sql( $age );
"$balance_sql > $over";
-
}
sub order_sql {
- my( $class ) = @_;
-
- my $age = $class->condition_sql_option('age');
- "EXTRACT( EPOCH FROM REPLACE( $age, 'm', 'mon')::interval )";
+ shift->condition_sql_option_age('age');
}
+use FS::UID qw( driver_name );
+
sub order_sql_weight {
10;
}
Index: cust_bill_age.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition/cust_bill_age.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cust_bill_age.pm 1 Aug 2007 22:24:39 -0000 1.1
+++ cust_bill_age.pm 29 Oct 2007 10:31:31 -0000 1.2
@@ -59,21 +59,13 @@
sub condition_sql {
my( $class, $table, %opt ) = @_;
- my $time = $opt{'time'};
-
- my $age = $class->condition_sql_option('age');
- my $age_sql =
- "$time - EXTRACT( EPOCH FROM REPLACE( $age, 'm', 'mon')::interval )";
-
- "cust_bill._date <= $age_sql";
+ my $age = $class->condition_sql_option_age_from('age', $opt{'time'} );
+ "cust_bill._date <= $age";
}
sub order_sql {
- my( $class ) = @_;
-
- my $age = $class->condition_sql_option('age');
- "EXTRACT( EPOCH FROM REPLACE( $age, 'm', 'mon')::interval )";
+ shift->condition_sql_option_age('age');
}
sub order_sql_weight {
More information about the freeside-commits
mailing list