diff options
author | ivan <ivan> | 2009-01-20 20:08:37 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-01-20 20:08:37 +0000 |
commit | 2f0584c5150a5b95556756f9731d70b2a4d37bab (patch) | |
tree | b512cca4053a14ed67e877c3637436e925f4e51d | |
parent | bfd85806a865e8428c99aadbe4fd11a7af19f731 (diff) |
whew, hopefully that will actually fix agent-specific invoices migrated from 1.7->1.9, RT#4645
-rw-r--r-- | FS/FS/cust_main.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 7544b80e0..77e08fe1c 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -7057,9 +7057,13 @@ sub _agent_plandata { AND peo_agentnum.optionname = 'agentnum' AND peo_agentnum.optionvalue }. $regexp. q{ '(^|,)}. $agentnum. q{(,|$)' ) - LEFT JOIN part_event_option AS peo_cust_bill_age - ON ( part_event.eventpart = peo_cust_bill_age.eventpart - AND peo_cust_bill_age.optionname = 'cust_bill_age' + LEFT JOIN part_event_condition + ON ( part_event.eventpart = part_event_condition.eventpart + AND part_event_condition.conditionname = 'cust_bill_age' + ) + LEFT JOIN part_event_condition_option + ON ( part_event_condition.eventconditionnum = part_event_condition_option.eventconditionnum + AND part_event_condition_option.optionname = 'age' ) }, #'hashref' => { 'optionname' => $option }, @@ -7073,7 +7077,7 @@ sub _agent_plandata { " ORDER BY CASE WHEN peo_cust_bill_age.optionname != 'cust_bill_age' THEN -1 - ELSE ". FS::part_event::Condition->age2seconds_sql('peo_cust_bill_age.optionvalue'). + ELSE ". FS::part_event::Condition->age2seconds_sql('part_event_condition_option.optionvalue'). " END , part_event.weight". " LIMIT 1" |