mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Fixed issue: System sorting giving low priority where some quotas exist and not others
Note: Default system sort order is: 1. Appointments 2. Defined priority by quotas 3. Sample sort order as defined by administrator 4. Time zone of respondent (later in the day for respondent called first) 5. Time of last call (call further in the past made first)
This commit is contained in:
@@ -285,7 +285,7 @@ while (!is_process_killed($process_id)) //check if process killed every $sleepin
|
||||
AND ((apn.appointment_id IS NOT NULL) or qs.call_max = 0 or ((SELECT count(*) FROM `call` WHERE `call`.case_id = c.case_id) < qs.call_max))
|
||||
AND (SELECT count(*) FROM `questionnaire_sample_quota` WHERE questionnaire_id = c.questionnaire_id AND sample_import_id = s.import_id AND quota_reached = 1) = 0
|
||||
GROUP BY c.case_id
|
||||
ORDER BY IF(ISNULL(apn.end),1,0),apn.end ASC, qsep.priority DESC, CONVERT_TZ(NOW(), 'System' , s.Time_zone_name) DESC , a.start ASC, qs.sort_order ASC";
|
||||
ORDER BY IF(ISNULL(apn.end),1,0),apn.end ASC, IFNULL(qsep.priority,50) DESC, qs.sort_order ASC, CONVERT_TZ(NOW(), 'System' , s.Time_zone_name) DESC , a.start ASC";
|
||||
|
||||
$rs = $db->GetAll($sql);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user