diff options
author | ivan <ivan> | 2007-10-04 04:08:05 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-10-04 04:08:05 +0000 |
commit | fa50dcaf8b9f1bdfd8ff717b0acc8cb72937c8aa (patch) | |
tree | 74e414a5736184a3c04950b71e4e415d6b3092d3 /FS | |
parent | 036745568d9eb34f2d64b09b00f1a1155ac3a82f (diff) |
whew, i think this might actually fix it
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_main.pm | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 4238b9889..064190a33 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -5803,23 +5803,25 @@ sub _agent_plandata { ) }, #'hashref' => { 'optionname' => $option }, - 'hashref' => { 'part_event_option.optionname' => $option }, - 'extra_sql' => " AND event = 'cust_bill_send_agent' ". - " AND disabled != 'Y' ". - " AND peo_agentnum.optionname = 'agentnum' ". - " AND agentnum IS NULL OR agentnum = $agentnum ". - " ORDER BY - CASE WHEN peo_cust_bill_age.optionname != 'cust_bill_age' - THEN -1 - ELSE EXTRACT( EPOCH FROM - REPLACE( peo_cust_bill_age.optionvalue, - 'm', - 'mon' - )::interval - ) - END - , part_event.weight". - " LIMIT 1" + #'hashref' => { 'part_event_option.optionname' => $option }, + 'extra_sql' => + " WHERE part_event_option.optionname = ". dbh->quote($option). + " AND action = 'cust_bill_send_agent' " + " AND ( disabled IS NULL OR disabled != 'Y' ) ". + " AND peo_agentnum.optionname = 'agentnum' ". + " AND agentnum IS NULL OR agentnum = $agentnum ". + " ORDER BY + CASE WHEN peo_cust_bill_age.optionname != 'cust_bill_age' + THEN -1 + ELSE EXTRACT( EPOCH FROM + REPLACE( peo_cust_bill_age.optionvalue, + 'm', + 'mon' + )::interval + ) + END + , part_event.weight". + " LIMIT 1" }); unless ( $part_event_option ) { |