Sign in to follow this  
Followers 0
kaotkbliss

Bill Calculator

10 posts in this topic

#1 ·  Posted (edited)

Download

I got tired of trying to remember all of my bills each pay and figure out which ones were going to be due before next pay.

So I made a small calculator that will show you which bills are going to be due before your next pay, how much the total will be and how much you will have left from your pay.

You can add, edit and remove bills.

Calculate and select bill as paid.

Let me know what you think and of caourse any bugs and suggestions!

*edit*

Included in the zip is the source, the icon I used and a compiled version.

*edit*

Added a couple screen shots

post-52469-0-06276100-1291665089_thumb.j

post-52469-0-28046600-1291665101_thumb.j

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites



Made an internal change to the calculations gui.

one change was to loop through a bill that would be due more than 1 time before the next pay date and list it each time.

Changed the update of the ini to only save the last date paid when the "paid" bill button was clicked.

Source, .ico and compiled exe are all in the zip in the updated download link.


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

why so narrow in scope? why not use a worksheet with controls and macros to add a wishlist for discretionary income (pick and choose what gets paid and what can wait, separate sheets for checking and savings accounts, linked balances, transfers from next month to this month, the ability to print current and next month's budgets, pick a sales tax rate by county (if you state is organized that way), transfer money from savings to checking by clicking a command button, calculate your gas mileage, automatically transfer money out of your check to your savings account and move all wishlist purchases to an archive file for later database queries (where did i buy that torque converter from, when did i buy it and how much did it cost??).

It's easy enough to do using XL and I have not written software regularly for 15 years.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Well, it wasn't supposed to be a complete banking software.

Basically, after I pay all my personal bills out of my paycheck, whatever is left over I give to my GF to help pay house payment and other bills.

Ever pay I had to look up each bill and check to see if it was due before my next pay, add up all my bills that were due by next pay and subtract from my paycheck just to see how much I could take out of the bank. It became a real PITA so now I can just enter my paycheck, click and go get the money.

Although I have thought about adding in some of the features you have mentioned, such as keeping track of what is left in the bank.

*edit*

there is no way I would ever write a program that would automatically mess with anyone's bank dirrectly, autoit is too insecure for that and since I am still at hobbyist level, I would never want to put anyone's financial accounts at risk due to poor code.

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Ver 1.2

A few changes:

-Added a Withdrawal and Deposit button to add or remove funds beyond Bills

-Changed pay amount to Available funds (pay can be added by using the new deposit button)

-Available funds now gets saved to the ini so it doesn't have to be entered at every run

*edit*

Oh, and I remembered to compile it as 32 bit instead of 64 bit.

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Virus when I try to download your zip file ! (Bitdefender)

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Virus when I try to download your zip file ! (Bitdefender)

View the sorce if you wish, it's included

*edit*

Source so you can see zip is safe

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=calculator.ico
#AutoIt3Wrapper_outfile=Bill Calculator.exe
#AutoIt3Wrapper_Res_Fileversion=1.2.0.0
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
://////=__=
://////=__=
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_AU3Check_Parameters=-w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <Date.au3>
AutoItSetOption("TrayIconDebug", 1)

$exist = FileExists(@ScriptDir & "\billconfig.ini")
If $exist <> 1 Then
    IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 1, "0")
EndIf

$setup = Int(IniRead(@ScriptDir & "\billconfig.ini", "Setup", 1, "0"))
If $setup = 0 Then
    _addbill()
EndIf

_Main()

Func _addbill()
    $setup = Int(IniRead(@ScriptDir & "\billconfig.ini", "Setup", 1, "0"))
    If $setup = 0 Then
        IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 1, "1")
    EndIf
    $addbill = GUICreate("Add Bills", 200, 300)
    GUICtrlCreateLabel("Name", 2, 10)
    $name = GUICtrlCreateInput("", 34, 8, 125, 20)
    GUICtrlCreateLabel("Amount", 6, 230)
    $amnt = GUICtrlCreateInput("", 48, 228, 60, 20)
    $add = GUICtrlCreateButton("Add", 75, 260, 50)
    $variable = GUICtrlCreateCheckbox("", 150, 220, 20, 20)
    GUICtrlCreateLabel("Is variable?", 130, 242)
    GUICtrlCreateLabel("Last billed in M/d/yyyy format", 10, 160, 142, 18)
    $lastbilled = GUICtrlCreateInput("", 10, 176, 80, 20)

    GUICtrlCreateGroup("", 2, 143, 161, 66)
    GUICtrlCreateGroup("Frequency", 2, 30, 181, 104)
    GUIStartGroup()
    $monthrad = GUICtrlCreateRadio("Monthly", 4, 43)
    GUICtrlCreateLabel("Day of Month", 80, 46.5, 80, 18)
    $monthdate = GUICtrlCreateInput("", 150, 41, 20, 20)
    $dayrad = GUICtrlCreateRadio("Every", 4, 66)
    $days = GUICtrlCreateInput("", 49, 67, 20, 20)
    GUICtrlCreateLabel("Days", 72, 71, 40, 18)
    $weekrad = GUICtrlCreateRadio("Weekly", 4, 89, 60, 20)
    $biweekrad = GUICtrlCreateRadio("BiWeekly", 4, 112, 65, 18)

    GUISetState()

    While 1
        $msg = GUIGetMsg($addbill)
        Select
            Case $msg = $GUI_EVENT_CLOSE
                GUIDelete($addbill)
                _View()
            Case $msg = $add
                $mrstate = GUICtrlRead($monthrad)
                $drstate = GUICtrlRead($dayrad)
                $wrstate = GUICtrlRead($weekrad)
                $brstate = GUICtrlRead($biweekrad)
                Select
                    Case $mrstate = $GUI_CHECKED
                        $getname = GUICtrlRead($name)
                        $getmonth = GUICtrlRead($monthdate)
                        $getamnt = GUICtrlRead($amnt)
                        $getdaylp = GUICtrlRead($lastbilled)
                        If $getname = "" Or $getmonth = "" Or $getamnt = "" Or $getdaylp = "" Then
                            If $getname = "" Then
                                $blank = "Bill Name"
                            ElseIf $getmonth = "" Then
                                $blank = "Day of Month"
                            ElseIf $getamnt = "" Then
                                $blank = "Amount"
                            ElseIf $getdaylp = "" Then
                                $blank = "Last Billed"
                            EndIf
                            MsgBox(48, "Error", "All fields need to be filled." & @CRLF & $blank & " was left empty")
                        Else
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 1, "Monthly")
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 2, $getmonth)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 3, $getamnt)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 4, $getdaylp)
                            $check = GUICtrlRead($variable)
                            If $check = $GUI_CHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "1")
                            ElseIf $check = $GUI_UNCHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "0")
                            EndIf
                            GUIDelete($addbill)
                            _View()
                        EndIf
                    Case $drstate = $GUI_CHECKED
                        $getname = GUICtrlRead($name)
                        $getday = GUICtrlRead($days)
                        $getamnt = GUICtrlRead($amnt)
                        $getdaylp = GUICtrlRead($lastbilled)
                        If $getname = "" Or $getday = "" Or $getamnt = "" Or $getdaylp = "" Then
                            If $getname = "" Then
                                $blank = "Bill Name"
                            ElseIf $getday = "" Then
                                $blank = "Number of Days"
                            ElseIf $getamnt = "" Then
                                $blank = "Amount"
                            ElseIf $getdaylp = "" Then
                                $blank = "Last Billed"
                            EndIf
                            MsgBox(48, "Error", "All fields need to be filled." & @CRLF & $blank & " was left empty")
                        Else
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 1, "Day")
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 2, $getday)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 3, $getamnt)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 4, $getdaylp)
                            $check = GUICtrlRead($variable)
                            If $check = $GUI_CHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "1")
                            ElseIf $check = $GUI_UNCHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "0")
                            EndIf
                            GUIDelete($addbill)
                            _View()
                        EndIf
                    Case $wrstate = $GUI_CHECKED
                        $getname = GUICtrlRead($name)
                        $getamnt = GUICtrlRead($amnt)
                        $getdaylp = GUICtrlRead($lastbilled)
                        If $getname = "" Or $getamnt = "" Or $getdaylp = "" Then
                            If $getname = "" Then
                                $blank = "Bill Name"
                            ElseIf $getamnt = "" Then
                                $blank = "Amount"
                            ElseIf $getdaylp = "" Then
                                $blank = "Last Billed"
                            EndIf
                            MsgBox(48, "Error", "All fields need to be filled." & @CRLF & $blank & " was left empty")
                        Else
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 1, "Week")
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 3, $getamnt)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 4, $getdaylp)
                            $check = GUICtrlRead($variable)
                            If $check = $GUI_CHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "1")
                            ElseIf $check = $GUI_UNCHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "0")
                            EndIf
                            GUIDelete($addbill)
                            _View()
                        EndIf
                    Case $brstate = $GUI_CHECKED
                        $getname = GUICtrlRead($name)
                        $getamnt = GUICtrlRead($amnt)
                        $getdaylp = GUICtrlRead($lastbilled)
                        If $getname = "" Or $getamnt = "" Or $getdaylp = "" Then
                            If $getname = "" Then
                                $blank = "Bill Name"
                            ElseIf $getamnt = "" Then
                                $blank = "Amount"
                            ElseIf $getdaylp = "" Then
                                $blank = "Last Billed"
                            EndIf
                            MsgBox(48, "Error", "All fields need to be filled." & @CRLF & $blank & " was left empty")
                        Else
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 1, "BiWeek")
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 3, $getamnt)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 4, $getdaylp)
                            $check = GUICtrlRead($variable)
                            If $check = $GUI_CHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "1")
                            ElseIf $check = $GUI_UNCHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "0")
                            EndIf
                            GUIDelete($addbill)
                            _View()
                        EndIf
                    Case Else
                        MsgBox(48, "Error", "No frequency chosen")
                EndSelect
        EndSelect
    WEnd
EndFunc   ;==>_addbill

Func _Main()
    $main = GUICreate("Main", 165, 100)
    $view = GUICtrlCreateButton("View Bills", 20, 35)
    $calc = GUICtrlCreateButton("Calculate", 85, 35, 60)
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $calc
                GUIDelete($main)
                _Calculate()
            Case $msg = $view
                GUIDelete($main)
                _View()
            Case $msg = $GUI_EVENT_CLOSE
                Exit
        EndSelect
    WEnd
EndFunc   ;==>_Main

Func _Calculate()
    $amtspent=0
    $extradep=0
    $cost = 0
    $calgui = GUICreate("Money after Expenses", 250, 300)
    GUICtrlCreateLabel("Last pay date", 2, 4)
    $nextpay = GUICtrlCreateInput("", 80, 2, 90, 20)
    GUICtrlCreateLabel("In format M/d/yyyy", 80, 22)
    GUICtrlCreateLabel("Available Funds", 2, 44)
    $funds=IniRead(@ScriptDir & "\billconfig.ini", "Setup", 4, "0")
    $pay = GUICtrlCreateInput($funds, 80, 40, 50, 20)
    $spent=GUICtrlCreateButton("Withdrawal",175,30,70,20)
    $deposit=GUICtrlCreateButton("Deposit",175,5,70,20)
    $ListView = GUICtrlCreateListView("Bill                  |Amount |Date Due", 10, 66, 230, 100)
    $calc = GUICtrlCreateButton("Calculate", 150, 270)
    $paid = GUICtrlCreateButton("Paid", 30, 270, 50)
    $bills = IniReadSectionNames(@ScriptDir & "\billconfig.ini")
    $nextpaydate = GUICtrlCreateLabel("", 120, 170, 100, 24)
    $leftover = GUICtrlCreateLabel("", 120, 200, 100, 24)
    $bill = GUICtrlCreateLabel("", 120, 230, 100, 24)
    GUICtrlCreateGroup("Pay Frequency", 2, 170, 100, 98)
    GUIStartGroup()
    $dayrad = GUICtrlCreateRadio("Daily", 4, 185)
    $weekrad = GUICtrlCreateRadio("Weekly", 4, 205)
    $biweekrad = GUICtrlCreateRadio("BiWeekly", 4, 225)
    $monthrad = GUICtrlCreateRadio("Monthly", 4, 245)
    $curpay = IniRead(@ScriptDir & "\billconfig.ini", "Setup", 2, "")
    $payfrequency = IniRead(@ScriptDir & "\billconfig.ini", "Setup", 3, "")
    $dateadd = ""

    If $curpay <> "" Then
        GUICtrlSetData($nextpay, $curpay)
    EndIf

    If $payfrequency <> "" Then
        If $payfrequency = "1" Then GUICtrlSetState($dayrad, $GUI_CHECKED)
        If $payfrequency = "2" Then GUICtrlSetState($weekrad, $GUI_CHECKED)
        If $payfrequency = "3" Then GUICtrlSetState($biweekrad, $GUI_CHECKED)
        If $payfrequency = "4" Then GUICtrlSetState($monthrad, $GUI_CHECKED)
    EndIf

    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                GUIDelete($calgui)
                _Main()
            Case $msg = $paid
                $select = _GUICtrlListView_GetItemText($ListView, Int(_GUICtrlListView_GetSelectedIndices($ListView)), 0)
                $paiddate = _GUICtrlListView_GetItemText($ListView, Int(_GUICtrlListView_GetSelectedIndices($ListView)), 2)
                $funds2 = GUICtrlRead($pay)
                ;$lastpaid = IniRead(@ScriptDir & "\billconfig.ini", $select, 4, "")
                $duefrequency = IniRead(@ScriptDir & "\billconfig.ini", $select, 1, "")
                $amntdue = IniRead(@ScriptDir & "\billconfig.ini", $select, 3, "")
                $splitpaid = StringSplit($paiddate, "/")
                If $duefrequency = "Monthly" Then
                    $newpay = _DateAdd("M", 1, $splitpaid[3] & "/" & $splitpaid[1] & "/" & $splitpaid[2])
                    $newdue = _DateTimeFormat($newpay, 2)
                    IniWrite(@ScriptDir & "\billconfig.ini", $select, 4, $newdue)
                    $funds2 -= $amntdue
                    GUICtrlSetData($pay, $funds2)
                    _GUICtrlListView_DeleteItemsSelected($ListView)
                    $cost -= $amntdue
                    GUICtrlSetData($bill, "Total Bills " & $cost)
                ElseIf $duefrequency = "Day" Then
                    $newpay = _DateAdd("D", 1, $splitpaid[3] & "/" & $splitpaid[1] & "/" & $splitpaid[2])
                    $newdue = _DateTimeFormat($newpay, 2)
                    IniWrite(@ScriptDir & "\billconfig.ini", $select, 4, $newdue)
                    $funds2 -= $amntdue
                    GUICtrlSetData($pay, $funds2)
                    _GUICtrlListView_DeleteItemsSelected($ListView)
                    $cost -= $amntdue
                    GUICtrlSetData($bill, "Total Bills " & $cost)
                ElseIf $duefrequency = "Week" Then
                    $newpay = _DateAdd("D", 7, $splitpaid[3] & "/" & $splitpaid[1] & "/" & $splitpaid[2])
                    $newdue = _DateTimeFormat($newpay, 2)
                    IniWrite(@ScriptDir & "\billconfig.ini", $select, 4, $newdue)
                    $funds2 -= $amntdue
                    GUICtrlSetData($pay, $funds2)
                    _GUICtrlListView_DeleteItemsSelected($ListView)
                    $cost -= $amntdue
                    GUICtrlSetData($bill, "Total Bills " & $cost)
                ElseIf $duefrequency = "BiWeek" Then
                    $newpay = _DateAdd("D", 14, $splitpaid[3] & "/" & $splitpaid[1] & "/" & $splitpaid[2])
                    $newdue = _DateTimeFormat($newpay, 2)
                    IniWrite(@ScriptDir & "\billconfig.ini", $select, 4, $newdue)
                    $funds2 -= $amntdue
                    GUICtrlSetData($pay, $funds2)
                    _GUICtrlListView_DeleteItemsSelected($ListView)
                    $cost -= $amntdue
                    GUICtrlSetData($bill, "Total Bills " & $cost)
                EndIf
            Case $msg = $calc
                _GUICtrlListView_DeleteAllItems($ListView)
                $getnextpay = GUICtrlRead($nextpay)
                $funds = GUICtrlRead($pay)
                IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 4, $funds)
                $cost = 0
                If $getnextpay <> "" Then
                    $mrstate = GUICtrlRead($monthrad)
                    $drstate = GUICtrlRead($dayrad)
                    $wrstate = GUICtrlRead($weekrad)
                    $brstate = GUICtrlRead($biweekrad)
                    Select
                        Case $mrstate = $GUI_CHECKED
                            $split = StringSplit($getnextpay, "/")
                            $payperiod = _DateAdd("M", 1, $split[3] & "/" & $split[1] & "/" & $split[2])
                            IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 3, "4")
                        Case $drstate = $GUI_CHECKED
                            $split = StringSplit($getnextpay, "/")
                            $payperiod = _DateAdd("D", 1, $split[3] & "/" & $split[1] & "/" & $split[2])
                            IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 3, "1")
                        Case $wrstate = $GUI_CHECKED
                            $split = StringSplit($getnextpay, "/")
                            $payperiod = _DateAdd("D", 7, $split[3] & "/" & $split[1] & "/" & $split[2])
                            IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 3, "2")
                        Case $brstate = $GUI_CHECKED
                            $split = StringSplit($getnextpay, "/")
                            $payperiod = _DateAdd("D", 14, $split[3] & "/" & $split[1] & "/" & $split[2])
                            IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 3, "3")
                        Case Else
                            MsgBox(48, "Error", "Must check a pay frequency")
                    EndSelect
                Else
                    MsgBox(48, "Error", "Must enter pay date")
                EndIf
                IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 2, $getnextpay)
                For $i = 1 To UBound($bills) - 1
                    If $bills[$i] <> "Setup" Then
                        $change = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 5, "0")
                        $frequency = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 1, "Week")
                        If $frequency = "Week" Then
                            $dateadd = "D"
                            $due = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 4, "")
                            If $due = "" Then
                                $curday = _DateToDayOfWeek(@YEAR, @MON, @MDAY)
                                $newday = 6 - Int($curday)
                                $friday = _DateAdd("D", $newday, @YEAR & "/" & @MON & "/" & @MDAY)
                                $defaultdue = _DateTimeFormat($friday, 2)
                                $due = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 2, $defaultdue)
                            EndIf
                            $payperiod2 = _DateTimeFormat($payperiod, 2)
                            $duesplit = StringSplit($due, "/")
                            If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                            If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                            $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                            $nextpaysplit = StringSplit($getnextpay, "/")
                            If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                            If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                            $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                            If $check1 < $check2 Then
                                $split = StringSplit($due, "/")
                                $newdue = _DateAdd("D", 7, $split[3] & "/" & $split[1] & "/" & $split[2])
                                $due = _DateTimeFormat($newdue, 2)
                            EndIf
                            $duesplit = StringSplit($due, "/")
                            If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                            If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                            $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                            $nextpaysplit = StringSplit($payperiod2, "/")
                            If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                            If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                            $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                            If $check1 < $check2 Then
                                $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
                                $amt2 = $amt
                                If $change = "1" Then
                                    $yesno = MsgBox(36, $bills[$i], "Has this bill amount changed?")
                                    If $yesno = 6 Then
                                        $amt = InputBox($bills[$i], "Enter new amount", $amt, "", 100, 200)
                                        IniWrite(@ScriptDir & "\billconfig.ini", $bills[$i], 3, $amt)
                                        If @error = 1 Then
                                            $amt = $amt2
                                        EndIf
                                    EndIf
                                EndIf
                                GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
                                IniWrite(@ScriptDir & "\billconfig.ini", $bills[$i], 4, $due)
                                $funds -= $amt
                                $cost += $amt
                            EndIf
                        ElseIf $frequency = "Monthly" Then
                            $dateadd = "M"
                            $due = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 4, "")
                            If $due = "" Then
                                $curday = _DateToDayOfWeek(@YEAR, @MON, @MDAY)
                                $newday = 6 - Int($curday)
                                $friday = _DateAdd("D", $newday, @YEAR & "/" & @MON & "/" & @MDAY)
                                $defaultdue = _DateTimeFormat($friday, 2)
                                $due2 = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 2, $defaultdue)
                                $due = @MON & "/" & $due2 & "/" & @YEAR
                            EndIf
                            $payperiod2 = _DateTimeFormat($payperiod, 2)
                            $duesplit = StringSplit($due, "/")
                            If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                            If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                            $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                            $nextpaysplit = StringSplit($getnextpay, "/")
                            If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                            If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                            $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                            If $check1 < $check2 Then
                                $split = StringSplit($due, "/")
                                $newdue = _DateAdd("M", 1, $split[3] & "/" & $split[1] & "/" & $split[2])
                                $due = _DateTimeFormat($newdue, 2)
                            EndIf
                            $duesplit = StringSplit($due, "/")
                            If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                            If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                            $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                            $nextpaysplit = StringSplit($payperiod2, "/")
                            If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                            If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                            $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                            If $check1 < $check2 Then
                                $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
                                $amt2 = $amt
                                If $change = "1" Then
                                    $yesno = MsgBox(36, $bills[$i], "Has this bill amount changed?")
                                    If $yesno = 6 Then
                                        $amt = InputBox($bills[$i], "Enter new amount", $amt, "", 100, 200)
                                        IniWrite(@ScriptDir & "\billconfig.ini", $bills[$i], 3, $amt)
                                        If @error = 1 Then
                                            $amt = $amt2
                                        EndIf
                                    EndIf
                                EndIf
                                GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
                                IniWrite(@ScriptDir & "\billconfig.ini", $bills[$i], 4, $due)
                                $funds -= $amt
                                $cost += $amt
                            EndIf
                        ElseIf $frequency = "BiWeek" Then
                            $dateadd = "D"
                            $due = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 4, "")
                            If $due = "" Then
                                $curday = _DateToDayOfWeek(@YEAR, @MON, @MDAY)
                                $newday = 6 - Int($curday)
                                $newday += 7
                                $friday = _DateAdd("D", $newday, @YEAR & "/" & @MON & "/" & @MDAY)
                                $defaultdue = _DateTimeFormat($friday, 2)
                                $lastpay = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 4, $defaultdue)
                                $format = StringSplit($lastpay, "/")
                                $dueunformat = _DateAdd("D", 14, $format[3] & "/" & $format[1] & "/" & $format[2])
                                $due = _DateTimeFormat($dueunformat, 2)
                            EndIf
                            $payperiod2 = _DateTimeFormat($payperiod, 2)
                            $duesplit = StringSplit($due, "/")
                            If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                            If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                            $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                            $nextpaysplit = StringSplit($getnextpay, "/")
                            If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                            If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                            $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                            If $check1 < $check2 Then
                                $split = StringSplit($due, "/")
                                $newdue = _DateAdd("D", 14, $split[3] & "/" & $split[1] & "/" & $split[2])
                                $due = _DateTimeFormat($newdue, 2)
                            EndIf
                            $duesplit = StringSplit($due, "/")
                            If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                            If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                            $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                            $nextpaysplit = StringSplit($payperiod2, "/")
                            If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                            If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                            $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                            If $check1 < $check2 Then
                                $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
                                $amt2 = $amt
                                If $change = "1" Then
                                    $yesno = MsgBox(36, $bills[$i], "Has this bill amount changed?")
                                    If $yesno = 6 Then
                                        $amt = InputBox($bills[$i], "Enter new amount", $amt, "", 100, 200)
                                        IniWrite(@ScriptDir & "\billconfig.ini", $bills[$i], 3, $amt)
                                        If @error = 1 Then
                                            $amt = $amt2
                                        EndIf
                                    EndIf
                                EndIf
                                GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
                                IniWrite(@ScriptDir & "\billconfig.ini", $bills[$i], 4, $due)
                                $funds -= $amt
                                $cost += $amt
                            EndIf
                        ElseIf $frequency = "Day" Then
                            $dateadd = "D"
                            $due = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 4, "")
                            If $due = "" Then
                                $curday = _DateToDayOfWeek(@YEAR, @MON, @MDAY)
                                $newday = 6 - Int($curday)
                                $friday = _DateAdd("D", $newday, @YEAR & "/" & @MON & "/" & @MDAY)
                                $defaultdue = _DateTimeFormat($friday, 2)
                                $lastpay = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 4, $defaultdue)
                                $addday = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 2, $newday)
                                $format = StringSplit($lastpay, "/")
                                $dueunformat = _DateAdd("D", $addday, $format[3] & "/" & $format[1] & "/" & $format[2])
                                $due = _DateTimeFormat($dueunformat, 2)
                            EndIf
                            $payperiod2 = _DateTimeFormat($payperiod, 2)
                            $duesplit = StringSplit($due, "/")
                            If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                            If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                            $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                            $nextpaysplit = StringSplit($getnextpay, "/")
                            If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                            If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                            $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                            If $check1 < $check2 Then
                                $split = StringSplit($due, "/")
                                $newdue = _DateAdd("D", 1, $split[3] & "/" & $split[1] & "/" & $split[2])
                                $due = _DateTimeFormat($newdue, 2)
                            EndIf
                            $duesplit = StringSplit($due, "/")
                            If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                            If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                            $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                            $nextpaysplit = StringSplit($payperiod2, "/")
                            If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                            If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                            $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                            If $check1 < $check2 Then
                                $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
                                $amt2 = $amt
                                If $change = "1" Then
                                    $yesno = MsgBox(36, $bills[$i], "Has this bill amount changed?"&@CRLF&$amt)
                                    If $yesno = 6 Then
                                        $amt = InputBox($bills[$i], "Enter new amount", $amt, "", 100, 100)
                                        IniWrite(@ScriptDir & "\billconfig.ini", $bills[$i], 3, $amt)
                                        If @error = 1 Then
                                            $amt = $amt2
                                        EndIf
                                    EndIf
                                EndIf
                                GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
                                IniWrite(@ScriptDir & "\billconfig.ini", $bills[$i], 4, $due)
                                $funds -= $amt
                                $cost += $amt
                            EndIf
                        EndIf
                    EndIf
                    ;add multiple here
                    If $bills[$i] <> "Setup" Then
                        Do
                            If $dateadd = "D" And $frequency = "Week" Then
                                $duesplit = StringSplit($due, "/")
                                $due = _DateAdd("D", 7, $duesplit[3] & "/" & $duesplit[1] & "/" & $duesplit[2])
                                $due = _DateTimeFormat($due, 2)
                                $duesplit = StringSplit($due, "/")
                                If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                                If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                                $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                                $nextpaysplit = StringSplit($getnextpay, "/")
                                If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                                If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                                $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                                If $check1 < $check2 Then
                                    $split = StringSplit($due, "/")
                                    $newdue = _DateAdd("D", 7, $split[3] & "/" & $split[1] & "/" & $split[2])
                                    $due = _DateTimeFormat($newdue, 2)
                                EndIf
                                $duesplit = StringSplit($due, "/")
                                If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                                If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                                $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                                $nextpaysplit = StringSplit($payperiod2, "/")
                                If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                                If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                                $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                                If $check1 < $check2 Then
                                    $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
                                    $amt2 = $amt
                                    GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
                                    $funds -= $amt
                                    $cost += $amt
                                EndIf
                            ElseIf $dateadd = "D" And $frequency = "BiWeek" Then
                                $duesplit = StringSplit($due, "/")
                                $due = _DateAdd("D", 14, $duesplit[3] & "/" & $duesplit[1] & "/" & $duesplit[2])
                                $due = _DateTimeFormat($due, 2)
                                $duesplit = StringSplit($due, "/")
                                If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                                If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                                $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                                $nextpaysplit = StringSplit($getnextpay, "/")
                                If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                                If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                                $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                                If $check1 < $check2 Then
                                    $split = StringSplit($due, "/")
                                    $newdue = _DateAdd("D", 14, $split[3] & "/" & $split[1] & "/" & $split[2])
                                    $due = _DateTimeFormat($newdue, 2)
                                EndIf
                                $duesplit = StringSplit($due, "/")
                                If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                                If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                                $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                                $nextpaysplit = StringSplit($payperiod2, "/")
                                If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                                If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                                $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                                If $check1 < $check2 Then
                                    $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
                                    $amt2 = $amt
                                    GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
                                    $funds -= $amt
                                    $cost += $amt
                                EndIf
                            ElseIf $dateadd = "M" And $frequency = "Monthly" Then
                                $duesplit = StringSplit($due, "/")
                                $due = _DateAdd("M", 1, $duesplit[3] & "/" & $duesplit[1] & "/" & $duesplit[2])
                                $due = _DateTimeFormat($due, 2)
                                $duesplit = StringSplit($due, "/")
                                If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                                If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                                $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                                $nextpaysplit = StringSplit($getnextpay, "/")
                                If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                                If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                                $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                                If $check1 < $check2 Then
                                    $split = StringSplit($due, "/")
                                    $newdue = _DateAdd("M", 1, $split[3] & "/" & $split[1] & "/" & $split[2])
                                    $due = _DateTimeFormat($newdue, 2)
                                EndIf
                                $duesplit = StringSplit($due, "/")
                                If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                                If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                                $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                                $nextpaysplit = StringSplit($payperiod2, "/")
                                If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                                If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                                $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                                If $check1 < $check2 Then
                                    $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
                                    $amt2 = $amt
                                    GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
                                    $funds -= $amt
                                    $cost += $amt
                                EndIf
                            ElseIf $dateadd = "D" And $frequency = "Day" Then
                                $duesplit = StringSplit($due, "/")
                                $due = _DateAdd("D", 1, $duesplit[3] & "/" & $duesplit[1] & "/" & $duesplit[2])
                                $due = _DateTimeFormat($due, 2)
                                $duesplit = StringSplit($due, "/")
                                If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                                If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                                $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                                $nextpaysplit = StringSplit($getnextpay, "/")
                                If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                                If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                                $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                                If $check1 < $check2 Then
                                    $split = StringSplit($due, "/")
                                    $newdue = _DateAdd("D", 1, $split[3] & "/" & $split[1] & "/" & $split[2])
                                    $due = _DateTimeFormat($newdue, 2)
                                EndIf
                                $duesplit = StringSplit($due, "/")
                                If StringLen($duesplit[1]) = 1 Then $duesplit[1] = 0 & $duesplit[1]
                                If StringLen($duesplit[2]) = 1 Then $duesplit[2] = 0 & $duesplit[2]
                                $check1 = $duesplit[3] & $duesplit[1] & $duesplit[2]
                                $nextpaysplit = StringSplit($payperiod2, "/")
                                If StringLen($nextpaysplit[1]) = 1 Then $nextpaysplit[1] = 0 & $nextpaysplit[1]
                                If StringLen($nextpaysplit[2]) = 1 Then $nextpaysplit[2] = 0 & $nextpaysplit[2]
                                $check2 = $nextpaysplit[3] & $nextpaysplit[1] & $nextpaysplit[2]
                                If $check1 < $check2 Then
                                    $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
                                    $amt2 = $amt
                                    GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
                                    $funds -= $amt
                                    $cost += $amt
                                EndIf
                            EndIf
                        Until $check1 > $check2
                    EndIf
                Next
                $funds = Round($funds, 2)
                $split = StringSplit($payperiod, "/")
                GUICtrlSetData($nextpaydate, "Next pay date is " & @CRLF & $split[2] & "/" & $split[3] & "/" & $split[1])
                GUICtrlSetData($leftover, " Left-over funds " & @CRLF & $funds)
                GUICtrlSetData($bill, "Total Bills " & @CRLF & $cost)
            Case $msg=$spent
                $amtspent=Int(InputBox("Other Spendings","Enter Withdrawal",0,"",50,75))
                $funds=GUICtrlRead($pay)
                $funds-=$amtspent
                GUICtrlSetData($pay,$funds)
            Case $msg=$deposit
                $extradep=Int(InputBox("Additional Deposit","Enter Deposit",0,"",50,75))
                $funds=GUICtrlRead($pay)
                $funds+=$extradep
                GUICtrlSetData($pay,$funds)
        EndSelect
    WEnd
EndFunc   ;==>_Calculate

Func _View()
    $billgui = GUICreate("Bill List", 250, 300)
    $ListView = GUICtrlCreateListView("Bill                  |Amount |Date Due", 2, 2, 246, 230)
    $bills = IniReadSectionNames(@ScriptDir & "\billconfig.ini")
    $total = 0
    For $i = 1 To UBound($bills) - 1
        If $bills[$i] <> "Setup" Then
            $amt = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 3, "0.00")
            $due = IniRead(@ScriptDir & "\billconfig.ini", $bills[$i], 4, "")
            GUICtrlCreateListViewItem($bills[$i] & "|" & $amt & "|" & $due, $ListView)
            $total += $amt
        EndIf
    Next
    GUICtrlCreateLabel("Total: ", 5, 235)
    $totlbl = GUICtrlCreateLabel($total, 100, 235)
    $add = GUICtrlCreateButton("Add", 40, 260, 40)
    $delete = GUICtrlCreateButton("Remove", 100, 260)
    $edit = GUICtrlCreateButton("Edit", 167, 260, 40)
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                GUIDelete($billgui)
                _Main()
            Case $msg = $add
                GUIDelete($billgui)
                _addbill()
            Case $msg = $delete
                $select = _GUICtrlListView_GetItemText($ListView, Int(_GUICtrlListView_GetSelectedIndices($ListView)), 0)
                IniDelete(@ScriptDir & "\billconfig.ini", $select)
                _GUICtrlListView_DeleteItemsSelected($ListView)
                $total -= $amt
                GUICtrlSetData($totlbl, $total)
                $bills = IniReadSectionNames(@ScriptDir & "\billconfig.ini")
                If $bills[0] = 1 Then
                    IniWrite(@ScriptDir & "\billconfig.ini", "Setup", 1, "0")
                EndIf
            Case $msg = $edit
                $select = _GUICtrlListView_GetItemText($ListView, Int(_GUICtrlListView_GetSelectedIndices($ListView)), 0)
                GUIDelete($billgui)
                _Edit($select)

        EndSelect
    WEnd
EndFunc   ;==>_View

Func _Edit($select)
    $editgui = GUICreate("Edit", 200, 300)
    GUICtrlCreateLabel("Name", 2, 10)
    $name = GUICtrlCreateInput($select, 34, 8, 125, 20)
    GUICtrlCreateLabel("Amount", 6, 230)
    $amnt = GUICtrlCreateInput("", 48, 228, 60, 20)
    $amt2 = IniRead(@ScriptDir & "\billconfig.ini", $select, 3, "0.00")
    GUICtrlSetData($amnt, $amt2)
    $add = GUICtrlCreateButton("Save", 75, 260, 50)
    $variable = GUICtrlCreateCheckbox("", 150, 220, 20, 20)
    $variable2 = IniRead(@ScriptDir & "\billconfig.ini", $select, 5, "0")
    If $variable2 = "1" Then
        GUICtrlSetState($variable, $GUI_CHECKED)
    EndIf
    GUICtrlCreateLabel("Is variable?", 130, 242)
    GUICtrlCreateLabel("Last billed in M/d/yyyy format", 10, 160, 142, 18)
    $lastbilled = GUICtrlCreateInput("", 10, 176, 80, 20)

    GUICtrlCreateGroup("", 2, 143, 161, 66)
    GUICtrlCreateGroup("Frequency", 2, 30, 181, 104)
    GUIStartGroup()
    $monthrad = GUICtrlCreateRadio("Monthly", 4, 43)
    GUICtrlCreateLabel("Day of Month", 80, 46.5, 80, 18)
    $monthdate = GUICtrlCreateInput("", 150, 41, 20, 20)
    $dayrad = GUICtrlCreateRadio("Every", 4, 66)
    $days = GUICtrlCreateInput("", 49, 67, 20, 20)
    GUICtrlCreateLabel("Days", 72, 71, 40, 18)
    $weekrad = GUICtrlCreateRadio("Weekly", 4, 89, 60, 20)
    $biweekrad = GUICtrlCreateRadio("BiWeekly", 4, 112, 65, 18)
    $radio = IniRead(@ScriptDir & "\billconfig.ini", $select, 1, "Month")
    If $radio = "Monthly" Then
        GUICtrlSetState($monthrad, $GUI_CHECKED)
        $monthdate2 = IniRead(@ScriptDir & "\billconfig.ini", $select, 2, "1")
        $daylpaid2 = IniRead(@ScriptDir & "\billconfig.ini", $select, 4, "")
        GUICtrlSetData($lastbilled, $daylpaid2)
        GUICtrlSetData($monthdate, $monthdate2)
    ElseIf $radio = "BiWeek" Then
        GUICtrlSetState($biweekrad, $GUI_CHECKED)
        $bwlpaid2 = IniRead(@ScriptDir & "\billconfig.ini", $select, 4, "")
        GUICtrlSetData($lastbilled, $bwlpaid2)
    ElseIf $radio = "Week" Then
        GUICtrlSetState($weekrad, $GUI_CHECKED)
        $daylpaid2 = IniRead(@ScriptDir & "\billconfig.ini", $select, 4, "")
        GUICtrlSetData($lastbilled, $daylpaid2)
    ElseIf $radio = "Day" Then
        GUICtrlSetState($dayrad, $GUI_CHECKED)
        $days2 = IniRead(@ScriptDir & "\billconfig.ini", $select, 2, "30")
        $daylpaid2 = IniRead(@ScriptDir & "\billconfig.ini", $select, 4, "")
        GUICtrlSetData($days, $days2)
        GUICtrlSetData($lastbilled, $daylpaid2)
    EndIf

    GUISetState()

    While 1
        $msg = GUIGetMsg($editgui)
        Select
            Case $msg = $GUI_EVENT_CLOSE
                GUIDelete($editgui)
                _View()
            Case $msg = $add
                $mrstate = GUICtrlRead($monthrad)
                $drstate = GUICtrlRead($dayrad)
                $wrstate = GUICtrlRead($weekrad)
                $brstate = GUICtrlRead($biweekrad)
                Select
                    Case $mrstate = $GUI_CHECKED
                        $getname = GUICtrlRead($name)
                        $getmonth = GUICtrlRead($monthdate)
                        $getamnt = GUICtrlRead($amnt)
                        $getdaylp = GUICtrlRead($lastbilled)
                        If $getname = "" Or $getmonth = "" Or $getamnt = "" Or $getdaylp = "" Then
                            If $getname = "" Then
                                $blank = "Bill Name"
                            ElseIf $getmonth = "" Then
                                $blank = "Day of Month"
                            ElseIf $getamnt = "" Then
                                $blank = "Amount"
                            ElseIf $getdaylp = "" Then
                                $blank = "Last Billed"
                            EndIf
                            MsgBox(48, "Error", "All fields need to be filled." & @CRLF & $blank & " was left empty")
                        Else
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 1, "Monthly")
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 2, $getmonth)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 3, $getamnt)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 4, $getdaylp)
                            $check = GUICtrlRead($variable)
                            If $check = $GUI_CHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "1")
                            ElseIf $check = $GUI_UNCHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "0")
                            EndIf
                            GUIDelete($editgui)
                            _View()
                        EndIf
                    Case $drstate = $GUI_CHECKED
                        $getname = GUICtrlRead($name)
                        $getday = GUICtrlRead($days)
                        $getamnt = GUICtrlRead($amnt)
                        $getdaylp = GUICtrlRead($lastbilled)
                        If $getname = "" Or $getday = "" Or $getamnt = "" Or $getdaylp = "" Then
                            If $getname = "" Then
                                $blank = "Bill Name"
                            ElseIf $getday = "" Then
                                $blank = "Number of Days"
                            ElseIf $getamnt = "" Then
                                $blank = "Amount"
                            ElseIf $getdaylp = "" Then
                                $blank = "Last Billed"
                            EndIf
                            MsgBox(48, "Error", "All fields need to be filled." & @CRLF & $blank & " was left empty")
                        Else
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 1, "Day")
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 2, $getday)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 3, $getamnt)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 4, $getdaylp)
                            $check = GUICtrlRead($variable)
                            If $check = $GUI_CHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "1")
                            ElseIf $check = $GUI_UNCHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "0")
                            EndIf
                            GUIDelete($editgui)
                            _View()
                        EndIf
                    Case $wrstate = $GUI_CHECKED
                        $getname = GUICtrlRead($name)
                        $getamnt = GUICtrlRead($amnt)
                        $getdaylp = GUICtrlRead($lastbilled)
                        If $getname = "" Or $getamnt = "" Or $getdaylp = "" Then
                            If $getname = "" Then
                                $blank = "Bill Name"
                            ElseIf $getamnt = "" Then
                                $blank = "Amount"
                            ElseIf $getdaylp = "" Then
                                $blank = "Last Billed"
                            EndIf
                            MsgBox(48, "Error", "All fields need to be filled." & @CRLF & $blank & " was left empty")
                        Else
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 1, "Week")
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 3, $getamnt)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 4, $getdaylp)
                            $check = GUICtrlRead($variable)
                            If $check = $GUI_CHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "1")
                            ElseIf $check = $GUI_UNCHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "0")
                            EndIf
                            GUIDelete($editgui)
                            _View()
                        EndIf
                    Case $brstate = $GUI_CHECKED
                        $getname = GUICtrlRead($name)
                        $getamnt = GUICtrlRead($amnt)
                        $getdaylp = GUICtrlRead($lastbilled)
                        If $getname = "" Or $getamnt = "" Or $getdaylp = "" Then
                            If $getname = "" Then
                                $blank = "Bill Name"
                            ElseIf $getamnt = "" Then
                                $blank = "Amount"
                            ElseIf $getdaylp = "" Then
                                $blank = "Last Billed"
                            EndIf
                            MsgBox(48, "Error", "All fields need to be filled." & @CRLF & $blank & " was left empty")
                        Else
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 1, "BiWeek")
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 3, $getamnt)
                            IniWrite(@ScriptDir & "\billconfig.ini", $getname, 4, $getdaylp)
                            $check = GUICtrlRead($variable)
                            If $check = $GUI_CHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "1")
                            ElseIf $check = $GUI_UNCHECKED Then
                                IniWrite(@ScriptDir & "\billconfig.ini", $getname, 5, "0")
                            EndIf
                            GUIDelete($editgui)
                            _View()
                        EndIf
                    Case Else
                        MsgBox(48, "Error", "No frequency chosen")
                EndSelect
        EndSelect
    WEnd
EndFunc   ;==>_Edit

*another edit*

I know it's a false positive because our outlook here at work detects any compiled autoit script as virus and it uses bitdefender as well.

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

$50 a month for smokes? You either don't live in NY or don't smoke alot :x

Cool script

Share this post


Link to post
Share on other sites

LOL

Just some random stuff I threw in to get an example screen shot :x

I was thinking about having it "generate" a report, adding new information to a spread sheet at each run, if the month changes then start a new workbook sheet.

However, I want anyone who wants to use it to be able to and not everyone might have excel.


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

A couple of minor errors

Input boxes didn't show up correctly on my home pc (too squashed)

deposit and withdrawal weren't accepting decimals

Since it was little things, I am attaching a zip here until next update


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0