pears.NetCandidateProvTimesheetCount
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
Original SQL
CREATE PROCEDURE "pears"."NetCandidateProvTimesheetCount"( IN "pWebUserID" CHAR(20),IN "pCompleted" SMALLINT DEFAULT NULL ) RESULT( "pResult" long VARCHAR ) // IQXNet BEGIN SELECT "count"() FROM "NetProvTimesheets"("pWebUserID",0) WHERE("completed" = "pCompleted" OR "pCompleted" IS NULL) END /* DOC 2017-05-10 PC front-page widget to provide a count of provisional timesheets 2018-05-21 MHS allow optional specification of completed status. Simplify tests. */ /* TEST call NetTestSetup(''); delete from tempprovtimesheetline from tempprovtimesheetline key join tempprovtimesheet s where s.personid='TEST'; delete from tempprovtimesheet where personid='TEST'; insert into tempprovtimesheet (tempprovtimesheetid,personid,vacancyid,tempdeskid,periodlength,period,extnumber) values (uniquekey(''),'TEST','TEST','TEST','W',weekcontaining(current date),1); select * from NetCandidateProvTimesheetCount('test.candidate'); expect 1; select * from NetCandidateProvTimesheetCount('test.candidate',1); expect 0; update tempprovtimesheet set extnumber=2 where personid='TEST'; select * from NetCandidateProvTimesheetCount('test.candidate'); expect 1; select * from NetCandidateProvTimesheetCount('test.candidate',0); expect 0; select * from NetCandidateProvTimesheetCount('test.candidate',1); expect 1; */ GO COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."NetCandidateProvTimesheetCount" IS {CREATE PROCEDURE pears."NetCandidateProvTimesheetCount"(pWebUserID CHAR(20), pCompleted SMALLINT DEFAULT NULL) RESULT(pResult long VARCHAR ) // IQXNet BEGIN SELECT COUNT(*) FROM "NetProvTimesheets"(pWebUserID, 0) WHERE completed=pCompleted OR pCompleted IS NULL END /* DOC 2017-05-10 PC front-page widget to provide a count of provisional timesheets 2018-05-21 MHS allow optional specification of completed status. Simplify tests. */ /* TEST call NetTestSetup(''); delete from tempprovtimesheetline from tempprovtimesheetline key join tempprovtimesheet s where s.personid='TEST'; delete from tempprovtimesheet where personid='TEST'; insert into tempprovtimesheet (tempprovtimesheetid,personid,vacancyid,tempdeskid,periodlength,period,extnumber) values (uniquekey(''),'TEST','TEST','TEST','W',weekcontaining(current date),1); select * from NetCandidateProvTimesheetCount('test.candidate'); expect 1; select * from NetCandidateProvTimesheetCount('test.candidate',1); expect 0; update tempprovtimesheet set extnumber=2 where personid='TEST'; select * from NetCandidateProvTimesheetCount('test.candidate'); expect 1; select * from NetCandidateProvTimesheetCount('test.candidate',0); expect 0; select * from NetCandidateProvTimesheetCount('test.candidate',1); expect 1; */ }