Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.VacancyExtraHols ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> create function "pears"."VacancyExtraHols"( in @TempTimeSheetID char(20) ) returns double begin declare "rv" double; -- check earns hol pay if exists(select * from "temptimesheetline" key join "temppayband" where "temptimesheetid" = @temptimesheetid and "includeinholidaypay" = 1) then select "vacancy"."ExtraHols" into "rv" from "temptimesheet" key join "placement" key join "vacancy" where "temptimesheetid" = @TempTimeSheetID end if; -- deal with contras if(select "sum"("unitspaid"*"payrate") from "temptimesheetline" key join "temppayband" where "temptimesheetid" = @temptimesheetid and "includeinholidaypay" = 1) < 0 then set "rv" = 0 end if; return "isnull"("rv",0) end </code> database/functions/pears_vacancyextrahols.txt Last modified: 2026/08/07 19:24by 127.0.0.1