Fix date selection when using period in products_by_location

effective_date and planned_date could be both NULL so they must be considered
as date.max to be included.

review897003
(transplanted from 880fcffdafa24b42dc163309b6b24eb3ad5528e4)

--HG--
extra : transplant_source : %88%0F%CF%FD%AF%A2KB%DC%163%09%B6%B2N%B3%ADU%28%E4