====== pears.NetCandidateAddEventsMultiDay ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetCandidateAddEventsMultiDay"( in "pWebUserID" char(20),in "pvacancyid" char(20),
in "p1Date" char(25) default null,in "p1Event" char(20) default null,in "p1From" char(25) default null,in "p1To" char(25) default null,in "p1Brk" char(20) default null,in "p1Qty" char(20) default null,in "p1Note" char(50) default null,
in "p2Date" char(25) default null,in "p2Event" char(20) default null,in "p2From" char(25) default null,in "p2To" char(25) default null,in "p2Brk" char(20) default null,in "p2Qty" char(20) default null,in "p2Note" char(50) default null,
in "p3Date" char(25) default null,in "p3Event" char(20) default null,in "p3From" char(25) default null,in "p3To" char(25) default null,in "p3Brk" char(20) default null,in "p3Qty" char(20) default null,in "p3Note" char(50) default null,
in "p4Date" char(25) default null,in "p4Event" char(20) default null,in "p4From" char(25) default null,in "p4To" char(25) default null,in "p4Brk" char(20) default null,in "p4Qty" char(20) default null,in "p4Note" char(50) default null,
in "p5Date" char(25) default null,in "p5Event" char(20) default null,in "p5From" char(25) default null,in "p5To" char(25) default null,in "p5Brk" char(20) default null,in "p5Qty" char(20) default null,in "p5Note" char(50) default null,
in "p6Date" char(25) default null,in "p6Event" char(20) default null,in "p6From" char(25) default null,in "p6To" char(25) default null,in "p6Brk" char(20) default null,in "p6Qty" char(20) default null,in "p6Note" char(50) default null,
in "p7Date" char(25) default null,in "p7Event" char(20) default null,in "p7From" char(25) default null,in "p7To" char(25) default null,in "p7Brk" char(20) default null,in "p7Qty" char(20) default null,in "p7Note" char(50) default null,
in "p8Date" char(25) default null,in "p8Event" char(20) default null,in "p8From" char(25) default null,in "p8To" char(25) default null,in "p8Brk" char(20) default null,in "p8Qty" char(20) default null,in "p8Note" char(50) default null,
in "p9Date" char(25) default null,in "p9Event" char(20) default null,in "p9From" char(25) default null,in "p9To" char(25) default null,in "p9Brk" char(20) default null,in "p9Qty" char(20) default null,in "p9Note" char(50) default null,
in "p10Date" char(25) default null,in "p10Event" char(20) default null,in "p10From" char(25) default null,in "p10To" char(25) default null,in "p10Brk" char(20) default null,in "p10Qty" char(20) default null,in "p10Note" char(50) default null )
result( "pResult" char(250) )
begin
declare "swebusername" char(50);
declare "CanAuthorise" smallint;
declare "thelog" long varchar;
declare local temporary table "IDs"(
"ID" char(20) null,
) not transactional;
insert into "IDs"( "ID" )
select distinct "e"."companyid" from "iqxnetuserlink" as "l" key join "employment" as "e" where "l"."iqxnetuserid" = "pWebUserID";
if not "pvacancyid" = any(select "v"."vacancyid" from "vacancy" as "v" key join "employment" as "e" join "IDs" on "e"."companyid" = "IDs"."ID") then
select '99:~Permission denied';
return
end if;
if "IQXNetHasPermission"("pWebUserID",'ORDERJOBS') = 0 then
select '99:~Permission denied';
return
end if;
set "swebusername" = (select "name" from "iqxnetuser" where "iqxnetuserid" = "pwebuserid");
set "CanAuthorise" = "IQXNetHasPermission"("pWebUserID",'AUTHORISEJOBS');
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p1date"),"pshifttemplateid" = "p1","ptimefrom" = "p1from","ptimeto" = "p1to","pbreak" = "p1brk","pnote" = "p1note","pqty" = "p1qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p2date"),"pshifttemplateid" = "p2","ptimefrom" = "p2from","ptimeto" = "p2to","pbreak" = "p2brk","pnote" = "p2note","pqty" = "p2qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p3date"),"pshifttemplateid" = "p3","ptimefrom" = "p3from","ptimeto" = "p3to","pbreak" = "p3brk","pnote" = "p3note","pqty" = "p3qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p4date"),"pshifttemplateid" = "p4","ptimefrom" = "p4from","ptimeto" = "p4to","pbreak" = "p4brk","pnote" = "p4note","pqty" = "p4qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p5date"),"pshifttemplateid" = "p5","ptimefrom" = "p5from","ptimeto" = "p5to","pbreak" = "p5brk","pnote" = "p5note","pqty" = "p5qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p6date"),"pshifttemplateid" = "p6","ptimefrom" = "p6from","ptimeto" = "p6to","pbreak" = "p6brk","pnote" = "p6note","pqty" = "p6qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p7date"),"pshifttemplateid" = "p7","ptimefrom" = "p7from","ptimeto" = "p7to","pbreak" = "p7brk","pnote" = "p7note","pqty" = "p7qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p8date"),"pshifttemplateid" = "p8","ptimefrom" = "p8from","ptimeto" = "p8to","pbreak" = "p8brk","pnote" = "p8note","pqty" = "p8qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p9date"),"pshifttemplateid" = "p9","ptimefrom" = "p9from","ptimeto" = "p9to","pbreak" = "p9brk","pnote" = "p9note","pqty" = "p9qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p10date"),"pshifttemplateid" = "p10","ptimefrom" = "p10from","ptimeto" = "p10to","pbreak" = "p10brk","pnote" = "p10note","pqty" = "p10qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
if "CanAuthorise" = 1 then
call "IQXNetPopup"("pWebUserID",null,null,"pvacancyid",null,null,'ADDSHIFTS','New shift requirement(s) added',"thelog")
end if;
select '0:~Success'
end
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetCandidateAddEventsMultiDay" IS
{create procedure pears."NetCandidateAddEventsMultiDay"( in "pWebUserID" char(20),in "pvacancyid" char(20),
in "p1Date" char(25) default null,in "p1Event" char(20) default null,in "p1From" char(25) default null,in "p1To" char(25) default null,in "p1Brk" char(20) default null,in "p1Qty" char(20) default null,in "p1Note" char(50) default null,
in "p2Date" char(25) default null,in "p2Event" char(20) default null,in "p2From" char(25) default null,in "p2To" char(25) default null,in "p2Brk" char(20) default null,in "p2Qty" char(20) default null,in "p2Note" char(50) default null,
in "p3Date" char(25) default null,in "p3Event" char(20) default null,in "p3From" char(25) default null,in "p3To" char(25) default null,in "p3Brk" char(20) default null,in "p3Qty" char(20) default null,in "p3Note" char(50) default null,
in "p4Date" char(25) default null,in "p4Event" char(20) default null,in "p4From" char(25) default null,in "p4To" char(25) default null,in "p4Brk" char(20) default null,in "p4Qty" char(20) default null,in "p4Note" char(50) default null,
in "p5Date" char(25) default null,in "p5Event" char(20) default null,in "p5From" char(25) default null,in "p5To" char(25) default null,in "p5Brk" char(20) default null,in "p5Qty" char(20) default null,in "p5Note" char(50) default null,
in "p6Date" char(25) default null,in "p6Event" char(20) default null,in "p6From" char(25) default null,in "p6To" char(25) default null,in "p6Brk" char(20) default null,in "p6Qty" char(20) default null,in "p6Note" char(50) default null,
in "p7Date" char(25) default null,in "p7Event" char(20) default null,in "p7From" char(25) default null,in "p7To" char(25) default null,in "p7Brk" char(20) default null,in "p7Qty" char(20) default null,in "p7Note" char(50) default null,
in "p8Date" char(25) default null,in "p8Event" char(20) default null,in "p8From" char(25) default null,in "p8To" char(25) default null,in "p8Brk" char(20) default null,in "p8Qty" char(20) default null,in "p8Note" char(50) default null,
in "p9Date" char(25) default null,in "p9Event" char(20) default null,in "p9From" char(25) default null,in "p9To" char(25) default null,in "p9Brk" char(20) default null,in "p9Qty" char(20) default null,in "p9Note" char(50) default null,
in "p10Date" char(25) default null,in "p10Event" char(20) default null,in "p10From" char(25) default null,in "p10To" char(25) default null,in "p10Brk" char(20) default null,in "p10Qty" char(20) default null,in "p10Note" char(50) default null )
result( "pResult" char(250) )
begin
declare "swebusername" char(50);
declare "CanAuthorise" smallint;
declare "thelog" long varchar;
declare local temporary table "IDs"(
"ID" char(20) null,
) not transactional;
insert into "IDs"( "ID" )
select distinct "e"."companyid" from "iqxnetuserlink" as "l" key join "employment" as "e" where "l"."iqxnetuserid" = "pWebUserID";
if not "pvacancyid" = any(select "v"."vacancyid" from "vacancy" as "v" key join "employment" as "e" join "IDs" on "e"."companyid" = "IDs"."ID") then
select '99:~Permission denied';
return
end if;
if "IQXNetHasPermission"("pWebUserID",'ORDERJOBS') = 0 then
select '99:~Permission denied';
return
end if;
set "swebusername" = (select "name" from "iqxnetuser" where "iqxnetuserid" = "pwebuserid");
set "CanAuthorise" = "IQXNetHasPermission"("pWebUserID",'AUTHORISEJOBS');
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p1date"),"pshifttemplateid" = "p1","ptimefrom" = "p1from","ptimeto" = "p1to","pbreak" = "p1brk","pnote" = "p1note","pqty" = "p1qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p2date"),"pshifttemplateid" = "p2","ptimefrom" = "p2from","ptimeto" = "p2to","pbreak" = "p2brk","pnote" = "p2note","pqty" = "p2qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p3date"),"pshifttemplateid" = "p3","ptimefrom" = "p3from","ptimeto" = "p3to","pbreak" = "p3brk","pnote" = "p3note","pqty" = "p3qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p4date"),"pshifttemplateid" = "p4","ptimefrom" = "p4from","ptimeto" = "p4to","pbreak" = "p4brk","pnote" = "p4note","pqty" = "p4qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p5date"),"pshifttemplateid" = "p5","ptimefrom" = "p5from","ptimeto" = "p5to","pbreak" = "p5brk","pnote" = "p5note","pqty" = "p5qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p6date"),"pshifttemplateid" = "p6","ptimefrom" = "p6from","ptimeto" = "p6to","pbreak" = "p6brk","pnote" = "p6note","pqty" = "p6qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p7date"),"pshifttemplateid" = "p7","ptimefrom" = "p7from","ptimeto" = "p7to","pbreak" = "p7brk","pnote" = "p7note","pqty" = "p7qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p8date"),"pshifttemplateid" = "p8","ptimefrom" = "p8from","ptimeto" = "p8to","pbreak" = "p8brk","pnote" = "p8note","pqty" = "p8qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p9date"),"pshifttemplateid" = "p9","ptimefrom" = "p9from","ptimeto" = "p9to","pbreak" = "p9brk","pnote" = "p9note","pqty" = "p9qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
call "NetCandidateAddEventsOneDay"("pdate" = "iqxnetstringtodate"("p10date"),"pshifttemplateid" = "p10","ptimefrom" = "p10from","ptimeto" = "p10to","pbreak" = "p10brk","pnote" = "p10note","pqty" = "p10qty","pwebuserid" = "pwebuserid","pvacancyid" = "pvacancyid","pcanauthorise" = "canauthorise","ptheirref" = "ptheirref","porderreason" = "porderreason","pwebusername" = "swebusername","plog" = "thelog");
if "CanAuthorise" = 1 then
call "IQXNetPopup"("pWebUserID",null,null,"pvacancyid",null,null,'ADDSHIFTS','New shift requirement(s) added',"thelog")
end if;
select '0:~Success'
end
}