select *
from rpt.han_diag_leavetype2020_pg(
cast($1 as int8), 
cast($2 as int8), 
cast($3 as int8), 
cast($4 as int8), 
cast($5 as int8), 
cast($6 as int8), 
cast($7 as int8), 
cast($8 as int8), 
cast(to_timestamp($9,'dd.mm.yyyy') as timestamp), 
cast(to_timestamp($10,'dd.mm.yyyy') as timestamp), 
cast($11 as int8), 
cast($12 as int8), 
cast($13 as int8))
