select *
from rpt.f37_2013_2200_1_pg(
cast($1 as int8),
$2,
cast($3 as int8),
cast($4 as int8),
cast($5 as int8),
cast(to_timestamp($6,'dd.mm.yyyy') as timestamp),
cast(to_timestamp($7,'dd.mm.yyyy') as timestamp))
order by "v2"
