select * 
from rpt.f131_5001_2019_pg(
cast($1 as int8),
cast($2 as varchar),
cast($3 as int8), 
cast($4 as int8), 
cast(TO_TIMESTAMP($5,'DD.MM.YYYY') as timestamp), 
cast(TO_TIMESTAMP($6,'DD.MM.YYYY') as timestamp)
) order by 1
