-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
103 lines (92 loc) · 2.69 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
######################
# PAYROLL SYS
This system is based on current IRS code with Utah state tax calculation.
Input is a Comma-Seperated-File which associates the employee to pay due.
Payroll is a very complex system to code. Below is a HowTo.
From CSV this code will output employee payroll stubs as an encrypted pdf emailed out respectively.
# CONTENTS ###############
ee - employee info files
email - pdf stubs plain & encrypted
last - last stub paid per ee csv & ytd csv
src - payroll code files
tables - annual-static files: tax, VAR
ytd - dir per payroll, has individual & ttl csv fils
INPUT.xls - spreadsheet
# arrays #################
@tax - tax tables
@var - payroll variables
@ee - employee static info
@pr - new stub
@last - prior stub
@ytd - ytd stub
@time - timeclock detail
# STEP 0 #################
open INPUT.xls
first sheet, "INPUT", update employee time
save & close
# STEP 1 #################
each employee has a same-structure-file of data
for each ee file read into 3-dimensional array
@ee[$name][$attribute]
$ee[0][0] = molly
$ee[0][7] = 8751
use w4 form to fill in status information
single married headofhouse
number of children
number of dependents
married with 2 children under 17
$ee{$emp_name}[9] = m_2_0
# STEP 2 #################
verify type of payroll (weekly or biweekly)
refer to "tables/HOWTO_Tax_Tables" to create tables at start of every year
load tax tables into a 3-dimensional array
@table[$status][$exemption]
$table[0][2] = single with 2 exemptions
# STEP 3 #################
read INPUT.xls
only the second sheet "TTL" will be read
populate a 2-dimensional array
@pr[$ee][$attribute]
$pr[2][4] = bill's PTO
$pr[2][5] = bill's OT
# STEP 4 #################
calculate gross income
use @ee & @pr
# STEP 5 #################
reduce gross income by deductions
update @pr
# STEP 6 #################
reduce gross income by tax
update @pr
# STEP 7 #################
for each ee
open "last/" csv file
create a new array of old data
concatenate @pr data
read "last/ytd.csv" into @oldytd
use @oldytd & @pr to calc @newytd
# STEP 8 #################
create new ee payroll dir
copy new csv into ee "$ee.csv" file
# STEP 9 #################
read INPUT.xls sheet "INPUT"
each ee will have a 24x15 array called @time[$ee][]
# STEP 10 ################
create pdf stub from @pr & @time
encrypt pdf stub
email to ee
# HOW TO CREATE TAX TABLES
IRS p15t
extract the page (2020 page 52)
ocr pdf
cp the data to text
there are 6 sections
each section will have own txt file named 0-5
Married 2, 3
Single 0, 1
Head 4, 5
remove all comma
add a comma between entries
you will see a blank entry in each it means boundless
add $100000 as a filler for this entry
seperate each section into a different file