Novice Level Project - simple, fun and useful
- Posted by Senator Sep 23, 2020
- 1916 views
Greetings All,
After a few years in and out of the hospital, I decided I had better get a better handle on my finances. So I wrote a very simple little program I call "Budget Buddy" using the Euphoria Database System (EDS).
I created has two main tables - register, and cash. I record my income as deposits, expenditures and cash withdrawals as debits in/from the register table. The register table has only three fields: a datetime date is the key for each for each entry, The second field is a transaction note, and the last field is the transaction amount. Debits are entered and maintained internally as negative numbers, but in table listings they are reported without a sign and color coded red. Deposits are color coded blue.
Cash debits from the register table are "deposited" into the cash table which has the same structure and operation as the register table.
Transaction notes which exceed the allotted space are truncated with an asterisk color coded yellow.
In the table listings the current balance is calculated on the fly.
register # Day Transaction Amount BALANCE ----------------------------------------------------------------------------------- 44 8-17 Debit cash $300.00 $4,141.40 ---- 74 9-21 Accordia PA Amanda referring me to ~ $60.00 $1,391.60 75 9-21 Walmart groceries $93.87 $1,297.73 -----------------------------------------------------------------------------------A menu selection calls a routine which displays the full record:
Display full note of record #: 74 74 9-21 Accordia PA Amanda referring me to Cardiologist. Suggested a Urologist in Dublin. Next appointment 12-21-20 walk in. $60.00
CASH # Day Transaction Amount BALANCE ----------------------------------------------------------------------------------- 1 7-6 Cash on hand $233.21 $233.21 2 7-6 groceries $40.00 $193.21 3 7-13 ALLCARE ADDERALL MEDICAL $14.40 $178.81
Reports of expenditures can be generated using search terms from the transaction notes:
<keyword: GROCERIES> Year: 2020 Month: 8 ----------------------------------------------------------------------------------- *****register***** 33 8-3 groceries Walmart $98.82 34 8-3 groceries meat Thriftway $266.19 total $365.01 ----------------------------------------------------------------------------------- *****CASH***** 19 8-17 groceries Walmart $40.00 20 8-17 groceries Thriftway $22.00 total $62.00 ----------------------------------------------------------------------------------- total $427.01I wrote several menu selected routines to edit the record data:
#:79 DATE: 2020-9-26-4-10-13 1 Transaction Note: autolog DEPOSIT interest paid 2 $ 2.48 Enter # of data element to edit, Enter 0 to abort: 1 Transaction Note: autolog DEPOSIT interest paid 1. Append Keyword to transaction note 2. Replace Keyword in transaction note 3. Remove Keyword in transaction note 4. Replace entire transaction note
I also added a budget table which contains my income and budget category data. Each time the program is executed a file called AUTOLOG.DAT which contains the month number of the last budget autolog. If the AUTOLOG.DAT month is not the current month, the database is backed up and then the budget table data is automatically logged into the register table. The AUTOLOG.DAT file is then updated. I added a prompt with an opt-out option for good measure. The budget data can also be autologged from a menu selection.
Regards, Ken