sa39-00

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sa39-00 [2015/08/07 17:01] Justin Willeysa39-00 [2017/12/01 16:35] (current) – external edit 127.0.0.1
Line 29: Line 29:
 returns double returns double
 begin begin
-  --  declare rv double; +rates
-  --  function modified for Geneva Healthcare by GJW 2015-08-07 to apply rules for care workers with own contracted rates+
   declare @UserID char(50);   declare @UserID char(50);
   declare @TempBaseRate double;   declare @TempBaseRate double;
Line 42: Line 41:
   select(select UserID from Staff where StaffID = UserStaffID),   select(select UserID from Staff where StaffID = UserStaffID),
     (select Division.Name from Division key join TempDesk key join Vacancy where VacancyID = vacid),     (select Division.Name from Division key join TempDesk key join Vacancy where VacancyID = vacid),
-    (select first value from tagvalue where TagLocation = 'P' and TagID = 'BPY' and ID = persid order by taglocation asc), //Get the employee base rate +    (select first value from tagvalue where TagLocation = 'P' and TagID = 'BPY' and ID = persid order by taglocation asc), --Get the employee base rate 
-    (select first value from tagvalue where TagLocation = 'P' and TagID = 'NEE' and ID = persid order by taglocation asc), //Get the employee evening rate +    (select first value from tagvalue where TagLocation = 'P' and TagID = 'NEE' and ID = persid order by taglocation asc), --Get the employee evening rate 
-    (select first value from tagvalue where TagLocation = 'P' and TagID = 'WEE' and ID = persid order by taglocation asc), //Get the employee weekend rate +    (select first value from tagvalue where TagLocation = 'P' and TagID = 'WEE' and ID = persid order by taglocation asc), --Get the employee weekend rate 
-    (select first tagchoiceid from tagvalue where TagLocation = 'L' and TagID = 'PAY' and ID = placid order by taglocation asc) into @UserID, //Get the placement overide switch value+    (select first tagchoiceid from tagvalue where TagLocation = 'L' and TagID = 'PAY' and ID = placid order by taglocation asc) into @UserID, --Get the placement overide switch value
     @DivisionName,@TempBaseRate,@TempEveningRate,@TempWeekEndRate,     @DivisionName,@TempBaseRate,@TempEveningRate,@TempWeekEndRate,
     @UseTempBaseRate from Dummy;     @UseTempBaseRate from Dummy;
Line 51: Line 50:
     @TempBaseRate is null     @TempBaseRate is null
     or @UseTempBaseRate = 'NO' //Placement overide applies     or @UseTempBaseRate = 'NO' //Placement overide applies
-    or @DivisionName not in( 'Geneva Care','Geneva Iris','Geneva Northlink')  +    or @DivisionName not in( 'Division1','Division4')  
-    or @USERID not in( 'user','ANNAC','CAROLG'then +    or @USERID not in( 'TestUser1','TestUser2') 
-    -- if any of the above true then employee base rate does not apply+    -- if any of the above true then Temp base rate does not apply 
 +  then
     return BaseRate     return BaseRate
   else   else
-    // calculate the applicable base rate+    -- calculate the applicable base rate
     set @PayrollFlag=(select PayrollFlag from TempPayBand where TempPayBandID = bandid);     set @PayrollFlag=(select PayrollFlag from TempPayBand where TempPayBandID = bandid);
     case     case
-    when @PayrollFlag = '02' then return round(@TempBaseRate*1.5,2) //Time + one half +    when @PayrollFlag = 'THLF' then return round(@TempBaseRate*1.5,2) --Time + one half 
-    when @PayrollFlag = '16' then return round(@TempBaseRate*1.25,2) //Time + one quarter +    when @PayrollFlag = 'TQTR' then return round(@TempBaseRate*1.25,2) --Time + one quarter 
-    when @PayrollFlag = '75' then return round(@TempBaseRate+isnull(@TempEveningRate,0),2) //Employees evening uplift  +    when @PayrollFlag = 'EVE' then return round(@TempBaseRate+isnull(@TempEveningRate,0),2) --Temps evening uplift  
-    when @PayrollFlag = '76' then return round(@TempBaseRate+isnull(@TempWeekEndRate,0),2) //Employees weekend uplift +    when @PayrollFlag = 'NIGHT' then return round(@TempBaseRate+isnull(@TempWeekEndRate,0),2) --Temps weekend uplift 
-    when @PayrollFlag in( '45','46','47','48','990','PETALL','EXPEN','ONCALL','SLEEPO') then return BaseRate //Expenses and Holiday Pay etc excluded so use placement or vacancy rate+    when @PayrollFlag in( 'EXP1','EXP2','HP') then return BaseRate --Expenses and Holiday Pay etc excluded so use placement or vacancy rate
     else     else
-      return round(@TempBaseRate,2) //Employee base rate applies+      return round(@TempBaseRate,2) --Temp base rate applies
     end case     end case
   end if   end if
Line 71: Line 71:
 </code> </code>
  
 +Note the way the function exits immediately for **charge** rates to minimise processing, as the scheme does not effect charge rates. Also note how in this example the calculations are only made for certain test users to facilitate testing of the scheme. This clause //or @USERID not in( 'TestUser1','TestUser2')// would be removed for go live. 
  • sa39-00.1438966867.txt.gz
  • Last modified: 2017/11/16 21:57
  • (external edit)