whew, hopefully that will actually fix agent-specific invoices migrated from 1.7...
[freeside.git] / FS / FS / cust_main.pm
index 77e08fe..e6c8084 100644 (file)
@@ -7075,7 +7075,7 @@ sub _agent_plandata {
         " AND peo_agentnum.optionname = 'agentnum' ".
         " AND ( agentnum IS NULL OR agentnum = $agentnum ) ".
         " ORDER BY
-           CASE WHEN peo_cust_bill_age.optionname != 'cust_bill_age'
+           CASE WHEN part_event_condition_option.optionname IS NULL
            THEN -1
           ELSE ". FS::part_event::Condition->age2seconds_sql('part_event_condition_option.optionvalue').
         " END