====== pears.NetCandidateDisplayHolidayPay ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Original SQL =====
create procedure "pears"."NetCandidateDisplayHolidayPay"( in "pWebUserID" char(20),in "pPersonID" char(20) default null )
result( "HolidayYear" char(50),"WeeksWorked" char(20),"WeeksHolidayEarned" char(20),
"WeeksHolidayTaken" char(20),"WeeksHolidayDue" char(20),
"WeeklyHours" char(20),"WeeklyPay" char(20),"PayInLieu" char(20),
"DaysWorked" char(20),"WeekNo" char(20) )
// IQXWeb
begin
declare "ThisYear" integer;
declare "ThisWeek" integer;
set "pPersonID" = "NetCandidateValidPersonID"("pWebUserID","pPersonID");
set "ThisYear" = "left"("weekContaining"(current date),4);
set "ThisWeek" = "right"("weekContaining"(current date),2);
select "tempholidaycalc"("p"."personid","ThisYear","ThisWeek",104), -- holiday year
"tempholidaycalc"("p"."personid","ThisYear","ThisWeek",101), -- weeks worked
"tempholidaycalc"("p"."personid","ThisYear","ThisWeek",121), -- weeks holiday earned
"tempholidaycalc"("p"."personid","ThisYear","ThisWeek",122), -- weeks holiday taken
"tempholidaycalc"("p"."personid","ThisYear","ThisWeek",123), -- weeks holiday due
"tempholidaycalc"("p"."personid","ThisYear","ThisWeek",111), -- 12 week average weekly hours
"tempholidaycalc"("p"."personid","ThisYear","ThisWeek",113), -- 12 week average weekly pay
"tempholidaycalc"("p"."personid","ThisYear","ThisWeek",131), -- pay-in-lieu earned
"trim"("str"("round"("tempholidaycalc"("p"."personid","ThisYear","ThisWeek",4)*"tempholidaycalc"("p"."personid",2018,8,2),2),20,2)), -- average days worked
"trim"("str"("ThisWeek")) -- week number
from "person" as "p" where "p"."personid" = "pPersonID"
end /* DOC
2018-07-30 PC IW-528 display holiday pay details
2018-10-22 MHS IW-456 multi-cand fix and tests
*/
/* TEST
select * from NetCandidateDisplayHolidayPay(null);
expect eof;
select * from NetCandidateDisplayHolidayPay('test.candidate');
expect row;
*/
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetCandidateDisplayHolidayPay" IS
{create PROCEDURE pears."NetCandidateDisplayHolidayPay"(in pWebUserID char(20), in pPersonID char(20) default null)
RESULT(HolidayYear char(50),WeeksWorked char(20),WeeksHolidayEarned char(20),
WeeksHolidayTaken char(20),WeeksHolidayDue char(20),
WeeklyHours char(20),WeeklyPay char(20),PayInLieu char(20),
DaysWorked char(20),WeekNo char(20))
// IQXWeb
BEGIN
declare ThisYear int;
declare ThisWeek int;
set pPersonID=NetCandidateValidPersonID(pWebUserID,pPersonID);
set ThisYear=left(weekContaining(current date),4);
set ThisWeek=right(weekContaining(current date),2);
select
tempholidaycalc(p.personid,ThisYear,ThisWeek,104), -- holiday year
tempholidaycalc(p.personid,ThisYear,ThisWeek,101), -- weeks worked
tempholidaycalc(p.personid,ThisYear,ThisWeek,121), -- weeks holiday earned
tempholidaycalc(p.personid,ThisYear,ThisWeek,122), -- weeks holiday taken
tempholidaycalc(p.personid,ThisYear,ThisWeek,123), -- weeks holiday due
tempholidaycalc(p.personid,ThisYear,ThisWeek,111), -- 12 week average weekly hours
tempholidaycalc(p.personid,ThisYear,ThisWeek,113), -- 12 week average weekly pay
tempholidaycalc(p.personid,ThisYear,ThisWeek,131), -- pay-in-lieu earned
trim(str(round(tempholidaycalc(p.personid,ThisYear,ThisWeek,4)*tempholidaycalc(p.personid,2018,8,2),2),20,2)), -- average days worked
trim(str(ThisWeek)) -- week number
from
person p where p.personid=pPersonID;
END
/* DOC
2018-07-30 PC IW-528 display holiday pay details
2018-10-22 MHS IW-456 multi-cand fix and tests
*/
/* TEST
select * from NetCandidateDisplayHolidayPay(null);
expect eof;
select * from NetCandidateDisplayHolidayPay('test.candidate');
expect row;
*/
}