Details
Description
When fetching a list of absence-requests by period-id, the the period-id is determined by the request-date. It would be more sensible to base it on the start-date. See also comments from:
http://issues.civicrm.org/jira/browse/HR-239
http://issues.civicrm.org/jira/browse/HR-240
One approach is to reimplement the API so that a typical request uses SQL more like:
----- BEGIN -----
SELECT request.*
FROM civicrm_activity request
INNER JOIN civicrm_activity absence
ON request.id = absence.source_record_id
AND absence.activity_type_id = 123
INNER JOIN civicrm_activity_contact ac
ON request.id = ac.activity_id
AND ac.type = 'target'
WHERE
request.activity_type_id in (:list)
AND absence.activity_date_time BETWEEN :periodStart AND :periodEnd
GROUP BY request.id
----- END ------