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