Pay Calculator

Recommended Posts

ever started a new job and got sick of them mucking your pay up so you don't really know what your suppose to be coming out with per month, I did, so i wrote a program to work it out for you.

note: works in british £

```; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        Richard Easton
; Script Function:
;   Calculates tax national insurance and outcome pay
;
; ----------------------------------------------------------------------------

#include <GuiConstants.au3>

Opt("GUIOnEventMode", 1)

GuiCreate("Pay Calculator", 270, 150,(@DesktopWidth-392)/2, (@DesktopHeight-311)/2 , \$WS_OVERLAPPEDWINDOW + \$WS_VISIBLE + \$WS_CLIPSIBLINGS)

\$pay = GUICtrlCreateInput("", 15, 15, 100, 20)
GUICtrlCreateLabel("Input pay (Before TAX/NI)", 125, 20, 200, 20)

GUICtrlCreateLabel("TAX PAID", 15, 50, 200, 25)
\$t = GUICtrlCreateLabel("", 125, 50, 200, 25)

GUICtrlCreateLabel("NI PAID", 15, 70, 200, 25)
\$n = GUICtrlCreateLabel("", 125, 70, 200, 25)

GUICtrlCreateLabel("Outcome pay", 15, 90, 200, 25)
\$o = GUICtrlCreateLabel("", 125, 90, 200, 25)

\$calc = GUICtrlCreateButton("Calculate", 15, 110, 80, 20)
GUICtrlSetOnEvent(-1, "calculate")

\$cancel = GUICtrlCreateButton("Close", 160, 110, 80, 20)
GUICtrlSetOnEvent(-1, "close")

func calculate()
msgbox(0, "WARNING!!!", "No Pay Input", 10)
Else
\$op = GUICtrlRead(\$pay) - Round(\$tax,2) - round(\$NI,2)

GUICtrlSetData(\$t, "£" & Round(\$tax,2))
GUICtrlSetData(\$n, "£" & round(\$NI,2))
GUICtrlSetData(\$o, "£" & round(\$op,2))
EndIf
EndFunc

func close()
msgbox(64, "Thanks", "for using Pay Calculator" & @CRLF & "Written by Richard Easton", 5)
Exit
endfunc

GuiSetState()
While 1
\$msg = GuiGetMsg()
Select
Case \$msg = \$GUI_EVENT_CLOSE
ExitLoop
Case Else
;;;
EndSelect
WEnd
Exit```

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Create an account

Register a new account