[freeside-commits] freeside/FS/FS/part_event/Condition times.pm, 1.1.2.4, 1.1.2.5 cust_bill_has_service.pm, 1.6.4.1, 1.6.4.2
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-serv13545/Condition
Modified Files:
Tag: FREESIDE_2_1_BRANCH
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.6.4.1
retrieving revision 1.6.4.2
diff -u -w -d -r1.6.4.1 -r1.6.4.2
--- cust_bill_has_service.pm 20 Jan 2011 05:34:47 -0000 1.6.4.1
+++ cust_bill_has_service.pm 11 Apr 2011 17:22:38 -0000 1.6.4.2
@@ -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.1.2.4
retrieving revision 1.1.2.5
diff -u -w -d -r1.1.2.4 -r1.1.2.5
--- times.pm 24 Mar 2011 23:25:08 -0000 1.1.2.4
+++ times.pm 11 Apr 2011 17:22:38 -0000 1.1.2.5
@@ -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