Jump to content

Module:GS pay: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Updated for 2022
Updated values to 2023
Line 11: Line 11:
local WIGIncrease = {}
local WIGIncrease = {}


-- UPDATE THESE. Last Update: 2022
-- UPDATE THESE. Last Update: 2023
-- https://www.opm.gov/policy-data-oversight/pay-leave/salaries-wages/salary-tables/pdf/2022/GS.pdf
-- https://www.opm.gov/policy-data-oversight/pay-leave/salaries-wages/salary-tables/pdf/2023/GS.pdf
--For GS [Grade] Step 1 pay
--For GS [Grade] Step 1 pay
stepOnePay[3] = 24749
stepOnePay[3] = 25764
stepOnePay[4] = 27782
stepOnePay[4] = 28921
stepOnePay[5] = 31083
stepOnePay[5] = 32357
stepOnePay[6] = 34649
stepOnePay[6] = 36070
stepOnePay[7] = 38503
stepOnePay[7] = 40082
stepOnePay[8] = 42641
stepOnePay[8] = 44389
stepOnePay[9] = 47097
stepOnePay[9] = 49028
stepOnePay[10] = 51864
stepOnePay[10] = 53990
stepOnePay[11] = 56983
stepOnePay[11] = 59319
stepOnePay[12] = 68299
stepOnePay[12] = 71099
stepOnePay[13] = 81216
stepOnePay[13] = 84546
stepOnePay[14] = 95973
stepOnePay[14] = 99908
stepOnePay[15] = 112890
stepOnePay[15] = 117518
-- Within Grade increase for GS [Grade]
-- Within Grade increase for GS [Grade]
WIGIncrease[3] = 825
WIGIncrease[3] = 859
WIGIncrease[4] = 926
WIGIncrease[4] = 964
WIGIncrease[5] = 1036
WIGIncrease[5] = 1079
WIGIncrease[6] = 1155
WIGIncrease[6] = 1202
WIGIncrease[7] = 1283
WIGIncrease[7] = 1336
WIGIncrease[8] = 1421
WIGIncrease[8] = 1480
WIGIncrease[9] = 1570
WIGIncrease[9] = 1634
WIGIncrease[10] = 1729
WIGIncrease[10] = 1800
WIGIncrease[11] = 1899
WIGIncrease[11] = 1977
WIGIncrease[12] = 2277
WIGIncrease[12] = 2370
WIGIncrease[13] = 2707
WIGIncrease[13] = 2818
WIGIncrease[14] = 3199
WIGIncrease[14] = 3330
WIGIncrease[15] = 3763
WIGIncrease[15] = 3917
-- GS1 Pay Table (because it has inconsistent WIG)
-- GS1 Pay Table (because it has inconsistent WIG)
GSOnePay[1] = 20172
GSOnePay[1] = 20999
GSOnePay[2] = 20849
GSOnePay[2] = 21704
GSOnePay[3] = 21519
GSOnePay[3] = 22401
GSOnePay[4] = 22187
GSOnePay[4] = 23097
GSOnePay[5] = 22857
GSOnePay[5] = 23794
GSOnePay[6] = 23249
GSOnePay[6] = 24202
GSOnePay[7] = 23913
GSOnePay[7] = 24893
GSOnePay[8] = 24581
GSOnePay[8] = 25589
GSOnePay[9] = 24608
GSOnePay[9] = 25617
GSOnePay[10] = 25234
GSOnePay[10] = 26273
-- GS2 Pay Table (because it has inconsistent WIG}
-- GS2 Pay Table (because it has inconsistent WIG}
GSTwoPay[1] = 22682
GSTwoPay[1] = 23612
GSTwoPay[2] = 23222
GSTwoPay[2] = 24174
GSTwoPay[3] = 23973
GSTwoPay[3] = 24956
GSTwoPay[4] = 24608
GSTwoPay[4] = 25617
GSTwoPay[5] = 24886
GSTwoPay[5] = 25906
GSTwoPay[6] = 25618
GSTwoPay[6] = 26668
GSTwoPay[7] = 26350
GSTwoPay[7] = 27430
GSTwoPay[8] = 27082
GSTwoPay[8] = 28192
GSTwoPay[9] = 27814
GSTwoPay[9] = 28954
GSTwoPay[10] = 28546
GSTwoPay[10] = 29716


-- Base pay calculation
-- Base pay calculation

Revision as of 06:12, 31 December 2022

--
-- 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: 2023
-- https://www.opm.gov/policy-data-oversight/pay-leave/salaries-wages/salary-tables/pdf/2023/GS.pdf
	--For GS [Grade] Step 1 pay
	stepOnePay[3] = 25764
	stepOnePay[4] = 28921
	stepOnePay[5] = 32357
	stepOnePay[6] = 36070
	stepOnePay[7] = 40082
	stepOnePay[8] = 44389
	stepOnePay[9] = 49028
	stepOnePay[10] = 53990
	stepOnePay[11] = 59319
	stepOnePay[12] = 71099
	stepOnePay[13] = 84546
	stepOnePay[14] = 99908
	stepOnePay[15] = 117518
	-- Within Grade increase for GS [Grade]
	WIGIncrease[3] = 859
	WIGIncrease[4] = 964
	WIGIncrease[5] = 1079
	WIGIncrease[6] = 1202
	WIGIncrease[7] = 1336
	WIGIncrease[8] = 1480
	WIGIncrease[9] = 1634
	WIGIncrease[10] = 1800
	WIGIncrease[11] = 1977
	WIGIncrease[12] = 2370
	WIGIncrease[13] = 2818
	WIGIncrease[14] = 3330
	WIGIncrease[15] = 3917
	-- GS1 Pay Table (because it has inconsistent WIG)
	GSOnePay[1] = 20999
	GSOnePay[2] = 21704
	GSOnePay[3] = 22401
	GSOnePay[4] = 23097
	GSOnePay[5] = 23794
	GSOnePay[6] = 24202
	GSOnePay[7] = 24893
	GSOnePay[8] = 25589
	GSOnePay[9] = 25617
	GSOnePay[10] = 26273
	-- GS2 Pay Table (because it has inconsistent WIG}
	GSTwoPay[1] = 23612
	GSTwoPay[2] = 24174
	GSTwoPay[3] = 24956
	GSTwoPay[4] = 25617
	GSTwoPay[5] = 25906
	GSTwoPay[6] = 26668
	GSTwoPay[7] = 27430
	GSTwoPay[8] = 28192
	GSTwoPay[9] = 28954
	GSTwoPay[10] = 29716

-- 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