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.SDSRequired ====== <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"."SDSRequired"( /* Application Maintained Function / Procedure - DO NOT EDIT*/ in "COID" char(20),in "PID" char(20) ) returns smallint not deterministic begin if "WPKMaintainGetSwitchValue"('IR35SDSON','','L') = 'N' then return 0 end if; -- if exists (select 1 from company where PrivateSector = 1 and companyid = COID) then return 0 -- end if; if exists(select 1 from "pay_employee" where "personid" = "PID" and "taxmethod" = 1) then return 0 end if; if exists(select 1 from "pay_employee" where "personid" = "PID" and "HMRCEngagementDetail" = 'F') then return 0 end if; if exists(select 1 from "companySDS" where "personid" = "PID" and "companyid" = "COID") then return 0 end if; return 1 end </code> database/functions/pears_sdsrequired.txt Last modified: 2026/08/07 19:24by 127.0.0.1