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.EntityRateFilter ====== <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"."EntityRateFilter"( in "FilterNo" smallint,in "WeekNo" integer,in "VacID" char(20),in "PersID" char(20),in "PlacID" char(20),in "ShiftID" char(20) ) returns char(4) begin declare "rv" char(4); declare "qual" integer; -- Used to filter the rate tables -- Return null if specified FilterNo is not applicable to this entity set "rv" = null; if "filterno" = 1 then -- AWR if "weekno" is null then return null -- Filter only applied in timesheet entry end if; set "qual" = "AWRQualified"(null,"WeekNo","VacID","PersID","PlacID","ShiftID"); if "qual" is null then return null else if "qual" = 0 then return 'N' else return 'Y' end if end if end if; if "filterno" = 2 then -- Ltd Co. if "trim"("isnull"("persid",'')) <> '' then -- Note empty parameters cannot be relied upon to be null if exists(select * from "pay_employee" where "personid" = "persid" and "taxmethod" = 2) then set "rv" = 'Y' else set "rv" = 'N' -- If persid not supplied then leave rv as NULL for don't know end if end if end if; if "filterno" = 3 then return "EntitySpeciality"("VacID","PersID","PlacID","ShiftID") end if; return "rv" end </code> database/functions/pears_entityratefilter.txt Last modified: 2026/08/07 19:24by 127.0.0.1