[freeside-commits] freeside/FS/FS/part_event/Condition times.pm, 1.3, 1.4 cust_bill_has_service.pm, 1.7, 1.8
Ivan,,,
ivan at wavetail.420.am
Mon Apr 11 10:22:40 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition
In directory wavetail.420.am:/tmp/cvs-serv13534/Condition
Modified Files:
times.pm cust_bill_has_service.pm
Log Message:
fix times condition vs. mysql (causes billing errors even if not using), RT#10574
Index: cust_bill_has_service.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition/cust_bill_has_service.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- cust_bill_has_service.pm 20 Jan 2011 05:34:46 -0000 1.7
+++ cust_bill_has_service.pm 11 Apr 2011 17:22:37 -0000 1.8
@@ -41,14 +41,14 @@
sub condition_sql {
my( $class, $table, %opt ) = @_;
- my $integer = $opt{'driver_name'} =~ /^mysql/ ? 'UNSIGNED INTEGER' : 'INTEGER';
+ my $servicenum =
+ $class->condition_sql_option_integer('has_service', $opt{'driver_name'});
- my $servicenum = $class->condition_sql_option('has_service');
my $sql = qq| 0 < ( SELECT COUNT(cs.svcpart)
FROM cust_bill_pkg cbp, cust_svc cs
WHERE cbp.invnum = cust_bill.invnum
AND cs.pkgnum = cbp.pkgnum
- AND cs.svcpart = CAST( $servicenum AS $integer )
+ AND cs.svcpart = $servicenum
)
|;
return $sql;
Index: times.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_event/Condition/times.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- times.pm 24 Mar 2011 23:24:55 -0000 1.3
+++ times.pm 11 Apr 2011 17:22:37 -0000 1.4
@@ -39,17 +39,20 @@
}
sub condition_sql {
- my( $class, $table ) = @_;
+ my( $class, $table, %opt ) = @_;
my %tablenum = %{ FS::part_event->eventtable_pkey_sql };
+ my $run_times =
+ $class->condition_sql_option_integer('run_times', $opt{'driver_name'});
+
my $existing = "( SELECT COUNT(*) FROM cust_event
WHERE cust_event.eventpart = part_event.eventpart
AND cust_event.tablenum = $tablenum{$table}
AND status != 'failed'
)";
- "$existing <= ". $class->condition_sql_option_integer('run_times');
+ "$existing <= $run_times";
}
More information about the freeside-commits
mailing list