Jump to content

Module:GS pay: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Reverted edits by 2804:7F2:68A:9C6A:DDE3:A470:93F1:ECE0 (talk) to last version by Bulhis899
Updated values based on pay increase for CY21
Line 14: Line 14:
-- https://www.opm.gov/policy-data-oversight/pay-leave/salaries-wages/salary-tables/pdf/2020/GS.pdf
-- https://www.opm.gov/policy-data-oversight/pay-leave/salaries-wages/salary-tables/pdf/2020/GS.pdf
--For GS [Grade] Step 1 pay
--For GS [Grade] Step 1 pay
stepOnePay[3] = 23976
stepOnePay[3] = 24216
stepOnePay[4] = 26915
stepOnePay[4] = 27184
stepOnePay[5] = 30113
stepOnePay[5] = 30414
stepOnePay[6] = 33567
stepOnePay[6] = 33903
stepOnePay[7] = 37301
stepOnePay[7] = 37674
stepOnePay[8] = 41310
stepOnePay[8] = 41723
stepOnePay[9] = 45627
stepOnePay[9] = 46083
stepOnePay[10] = 50246
stepOnePay[10] = 50748
stepOnePay[11] = 55204
stepOnePay[11] = 55756
stepOnePay[12] = 66167
stepOnePay[12] = 66829
stepOnePay[13] = 78681
stepOnePay[13] = 79468
stepOnePay[14] = 92977
stepOnePay[14] = 93907
stepOnePay[15] = 109366
stepOnePay[15] = 110460
-- Within Grade increase for GS [Grade]
-- Within Grade increase for GS [Grade]
WIGIncrease[3] = 799
WIGIncrease[3] = 807
WIGIncrease[4] = 897
WIGIncrease[4] = 906
WIGIncrease[5] = 1004
WIGIncrease[5] = 1014
WIGIncrease[6] = 1119
WIGIncrease[6] = 1130
WIGIncrease[7] = 1243
WIGIncrease[7] = 1256
WIGIncrease[8] = 1377
WIGIncrease[8] = 1391
WIGIncrease[9] = 1521
WIGIncrease[9] = 1536
WIGIncrease[10] = 1675
WIGIncrease[10] = 1692
WIGIncrease[11] = 1840
WIGIncrease[11] = 1859
WIGIncrease[12] = 2206
WIGIncrease[12] = 2228
WIGIncrease[13] = 2623
WIGIncrease[13] = 2649
WIGIncrease[14] = 3099
WIGIncrease[14] = 3130
WIGIncrease[15] = 3646
WIGIncrease[15] = 3682
-- GS1 Pay Table (because it has inconsistent WIG)
-- GS1 Pay Table (because it has inconsistent WIG)
GSOnePay[1] = 19543
GSOnePay[1] = 19738
GSOnePay[2] = 20198
GSOnePay[2] = 20400
GSOnePay[3] = 20848
GSOnePay[3] = 21056
GSOnePay[4] = 21494
GSOnePay[4] = 21709
GSOnePay[5] = 22144
GSOnePay[5] = 22365
GSOnePay[6] = 22524
GSOnePay[6] = 22749
GSOnePay[7] = 23166
GSOnePay[7] = 23398
GSOnePay[8] = 23814
GSOnePay[8] = 24052
GSOnePay[9] = 23840
GSOnePay[9] = 24078
GSOnePay[10] = 24448
GSOnePay[10] = 24690
-- GS2 Pay Table (because it has inconsistent WIG}
-- GS2 Pay Table (because it has inconsistent WIG}
GSTwoPay[1] = 21974
GSTwoPay[1] = 22194
GSTwoPay[2] = 22497
GSTwoPay[2] = 22722
GSTwoPay[3] = 23225
GSTwoPay[3] = 23457
GSTwoPay[4] = 23840
GSTwoPay[4] = 24078
GSTwoPay[5] = 24108
GSTwoPay[5] = 24349
GSTwoPay[6] = 24817
GSTwoPay[6] = 25065
GSTwoPay[7] = 22526
GSTwoPay[7] = 25781
GSTwoPay[8] = 26235
GSTwoPay[8] = 26497
GSTwoPay[9] = 26944
GSTwoPay[9] = 27213
GSTwoPay[10] = 27653
GSTwoPay[10] = 27929


-- Base pay calculation
-- Base pay calculation

Revision as of 17:44, 18 February 2021

--
-- This module implements {{GS pay}}
-- There are 150 cells in the GS Pay table. This LUA reduces the amount of
--   manual input needed to 46
--

local p = {}
local stepOnePay = {}
local GSOnePay = {}
local GSTwoPay = {}
local WIGIncrease = {}

-- UPDATE THESE. Last Update: 2020
-- https://www.opm.gov/policy-data-oversight/pay-leave/salaries-wages/salary-tables/pdf/2020/GS.pdf
	--For GS [Grade] Step 1 pay
	stepOnePay[3] = 24216
	stepOnePay[4] = 27184
	stepOnePay[5] = 30414
	stepOnePay[6] = 33903
	stepOnePay[7] = 37674
	stepOnePay[8] = 41723
	stepOnePay[9] = 46083
	stepOnePay[10] = 50748
	stepOnePay[11] = 55756
	stepOnePay[12] = 66829
	stepOnePay[13] = 79468
	stepOnePay[14] = 93907
	stepOnePay[15] = 110460
	-- Within Grade increase for GS [Grade]
	WIGIncrease[3] = 807
	WIGIncrease[4] = 906
	WIGIncrease[5] = 1014
	WIGIncrease[6] = 1130
	WIGIncrease[7] = 1256
	WIGIncrease[8] = 1391
	WIGIncrease[9] = 1536
	WIGIncrease[10] = 1692
	WIGIncrease[11] = 1859
	WIGIncrease[12] = 2228
	WIGIncrease[13] = 2649
	WIGIncrease[14] = 3130
	WIGIncrease[15] = 3682
	-- GS1 Pay Table (because it has inconsistent WIG)
	GSOnePay[1] = 19738
	GSOnePay[2] = 20400
	GSOnePay[3] = 21056
	GSOnePay[4] = 21709
	GSOnePay[5] = 22365
	GSOnePay[6] = 22749
	GSOnePay[7] = 23398
	GSOnePay[8] = 24052
	GSOnePay[9] = 24078
	GSOnePay[10] = 24690
	-- GS2 Pay Table (because it has inconsistent WIG}
	GSTwoPay[1] = 22194
	GSTwoPay[2] = 22722
	GSTwoPay[3] = 23457
	GSTwoPay[4] = 24078
	GSTwoPay[5] = 24349
	GSTwoPay[6] = 25065
	GSTwoPay[7] = 25781
	GSTwoPay[8] = 26497
	GSTwoPay[9] = 27213
	GSTwoPay[10] = 27929

-- Base pay calculation
function p.basePay(grade, step)
	-- For Step 1 pay for all grades
	if step == nil then
		if grade > 2 then
			-- Returns the Step 1 Pay for [grade]
			return stepOnePay[grade]
		elseif grade == 1 then
			-- Returns GS1 Step 1
			return GSOnePay[1]
		else
			-- Returns GS2 Step 1
			return GSTwoPay[1]
		end
	-- For grades where step is specified
	else
		if grade > 2 then
			-- Calculate GS [grade #], Step [step #] pay
			local pay = stepOnePay[grade] + (WIGIncrease[grade] * (step - 1))
			return pay
		elseif grade == 1 then
			return GSOnePay[step]
		else
			return GSTwoPay[step]
		end
	end
end
	
-- 'Main' function
function p.get(frame)
	-- Error checking
	if frame.args[1] == nil then
		if frame.args[2] == nil then
			return
		end
	else
		-- Grab the basic pay number based on inputs
		return p.basePay(tonumber(frame.args[1]), tonumber(frame.args[2]))
	end
end
	
return p